Unverified Commit 5bded871 authored by Philipp Winter's avatar Philipp Winter
Browse files

Merge branch 'release-0.9.1'

parents 681963de 5a4c9723
......@@ -14,7 +14,7 @@
#
#------------------------------------------------------------------------------
Babel==2.7.0
BeautifulSoup==3.2.1
BeautifulSoup==3.2.2
Mako==1.1.0
pycryptodome==3.9.0
Twisted==19.7.0
......@@ -23,7 +23,7 @@ coveralls==1.8.2
gnupg==2.3.1
ipaddr==2.2.0
mechanize==0.4.3
Pillow==6.1.0
Pillow==6.2.1
pygeoip==0.3.2
qrcode==6.1
service_identity==18.1.0
......
Changes in version 0.9.1 - 2019-10-29
* FIXES https://bugs.torproject.org/32203
The metrics code used to weed out vanilla bridges, so they did not show
up in our metrics. This patch fixes this issue.
* FIXES https://bugs.torproject.org/32134
While implementing our language switcher (#26543), we added a new
string, "Language", that requires translations. This patch adds a new
translation request and also updates our instructions on how to request
new translations.
* FIXES https://bugs.torproject.org/32105
Mention an undocumented OS-level dependency: python3-dkim.
Changes in version 0.9.0 - 2019-10-16
* FIXES https://bugs.torproject.org/26543
......
......@@ -80,6 +80,7 @@ BridgeDB requires the following OS-level dependencies:
- python>=2.7
- python-dev
- `python3-dkim <https://pypi.org/project/dkimpy/>`__ (it contains the ``dkimverify`` binary)
- build-essential
- gnupg (preferrably, gnupg2)
- OpenSSL>=1.0.1g
......@@ -162,6 +163,10 @@ Enabling additional features
Translations
------------
For general information on the translation process, take a look at
`our translation guidelines for developers
<https://trac.torproject.org/projects/tor/wiki/doc/translation/developers>`__.
**Using New Translations**:
This should be done when newly completed translations are available in
......@@ -180,31 +185,20 @@ This should be done whenever any of the strings requiring translation --
``_("the ones inside the weird underscore function, like this")`` -- are
changed, or new ones are added. See ``lib/bridgedb/strings.py``.
Translations for Tor Project repos are kept `in a separate
repo <https://gitweb.torproject.org/translation.git>`__. You'll need to
extract the strings from BridgeDB's source code into .pot templates, and
place these .po files into the ``translation`` repo in the ``bridgedb``
branch. After than the .po files should be put into Transifex (don't ask
me how this works…) and translated. After the translations are complete,
the finished .po files should be placed into the ``bridgedb_completed``
branch.
- To extract all strings from BridgeDB's source::
Translations for Tor Project repos are kept `in a separate repo
<https://gitweb.torproject.org/translation.git>`__. To request new or updated
translations, you'll need to extract the strings from BridgeDB's source code
into our ./i18n/templates/bridgedb.pot template, and then commit it to our
``develop`` branch. From there, the translation system takes over and
eventually, new translations will be available. To extract all strings from
BridgeDB's source, run::
python setup.py extract_messages
A .pot file will be created in ./i18n/templates/bridgedb.pot
- Initialise catalogs for each desired language::
python setup.py init_catalog -l LANG
where ``LANG`` is the 2 or 4 letter country-code, eg. 'es'. If you've
already initialised a particular language, do instead::
python setup.py update_catalog
Transifex uses the resulting file ./i18n/templates/bridgedb.pot (and this file
only) as input and fetches it from BridgeDB's ``develop`` branch, so we don't
need to release a new BridgeDB version (which we only do in the ``master``
branch) to request translations.
-------
......
......@@ -5,11 +5,11 @@
#
msgid ""
msgstr ""
"Project-Id-Version: bridgedb 0.8.0+15.gd9d886f.dirty\n"
"Project-Id-Version: bridgedb 0.9.0+3.gfd0c28d.dirty\n"
"Report-Msgid-Bugs-To: "
"'https://trac.torproject.org/projects/tor/newticket?component=BridgeDB&keywords"
"=bridgedb-reported,msgid&cc=isis,sysrqb&owner=isis'\n"
"POT-Creation-Date: 2019-10-03 15:04-0700\n"
"POT-Creation-Date: 2019-10-19 14:51-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
......@@ -33,7 +33,8 @@ msgstr ""
#. recompiled). `collection_size` sets the number of compiled templates which
#. are cached before the least recently used ones are removed. See:
#. http://docs.makotemplates.org/en/latest/usage.html#using-templatelookup
#. : Localisations which BridgeDB supports which should be rendered right-to-left.
#. : A list of supported language tuples. Use getSortedLangList() to read this
#. variable.
#. We use our metrics singleton to keep track of BridgeDB metrics such as
#. "number of failed HTTPS bridge requests."
#. TRANSLATORS: Please DO NOT translate the following words and/or phrases in
......@@ -47,19 +48,23 @@ msgstr ""
#. "fteproxy"
#. "Tor"
#. "Tor Browser"
#: bridgedb/distributors/https/server.py:135
#: bridgedb/distributors/https/server.py:138
msgid "Sorry! Something went wrong with your request."
msgstr ""
#: bridgedb/distributors/https/templates/base.html:79
#: bridgedb/distributors/https/templates/base.html:42
msgid "Language"
msgstr ""
#: bridgedb/distributors/https/templates/base.html:92
msgid "Report a Bug"
msgstr ""
#: bridgedb/distributors/https/templates/base.html:82
#: bridgedb/distributors/https/templates/base.html:95
msgid "Source Code"
msgstr ""
#: bridgedb/distributors/https/templates/base.html:85
#: bridgedb/distributors/https/templates/base.html:98
msgid "Changelog"
msgstr ""
......@@ -98,7 +103,8 @@ msgstr ""
msgid "There currently aren't any bridges available..."
msgstr ""
#: bridgedb/distributors/https/templates/bridges.html:132
#: bridgedb/distributors/https/templates/bridges.html:133
#: bridgedb/distributors/https/templates/bridges.html:137
#, python-format
msgid " Perhaps you should try %s going back %s and choosing a different bridge type!"
msgstr ""
......@@ -118,17 +124,19 @@ msgstr ""
msgid "Step %s2%s"
msgstr ""
#: bridgedb/distributors/https/templates/index.html:27
#: bridgedb/distributors/https/templates/index.html:28
#: bridgedb/distributors/https/templates/index.html:30
#, python-format
msgid "Get %s bridges %s"
msgstr ""
#: bridgedb/distributors/https/templates/index.html:36
#: bridgedb/distributors/https/templates/index.html:40
#, python-format
msgid "Step %s3%s"
msgstr ""
#: bridgedb/distributors/https/templates/index.html:38
#: bridgedb/distributors/https/templates/index.html:43
#: bridgedb/distributors/https/templates/index.html:47
#, python-format
msgid "Now %s add the bridges to Tor Browser %s"
msgstr ""
......@@ -137,27 +145,27 @@ msgstr ""
#. beginning of words are present in your final translation. Thanks!
#. (These are used to insert HTML5 underlining tags, to mark accesskeys
#. for disabled users.)
#: bridgedb/distributors/https/templates/options.html:38
#: bridgedb/distributors/https/templates/options.html:42
#, python-format
msgid "%sJ%sust give me bridges!"
msgstr ""
#: bridgedb/distributors/https/templates/options.html:51
#: bridgedb/distributors/https/templates/options.html:55
msgid "Advanced Options"
msgstr ""
#: bridgedb/distributors/https/templates/options.html:86
#: bridgedb/distributors/https/templates/options.html:93
msgid "No"
msgstr ""
#: bridgedb/distributors/https/templates/options.html:87
#: bridgedb/distributors/https/templates/options.html:94
msgid "none"
msgstr ""
#. TRANSLATORS: Please make sure the '%s' surrounding single letters at the
#. beginning of words are present in your final translation. Thanks!
#. TRANSLATORS: Translate "Yes!" as in "Yes! I do need IPv6 addresses."
#: bridgedb/distributors/https/templates/options.html:124
#: bridgedb/distributors/https/templates/options.html:131
#, python-format
msgid "%sY%ses!"
msgstr ""
......@@ -165,7 +173,7 @@ msgstr ""
#. TRANSLATORS: Please make sure the '%s' surrounding single letters at the
#. beginning of words are present in your final translation. Thanks!
#. TRANSLATORS: Please do NOT translate the word "bridge"!
#: bridgedb/distributors/https/templates/options.html:147
#: bridgedb/distributors/https/templates/options.html:154
#, python-format
msgid "%sG%set Bridges"
msgstr ""
......@@ -209,7 +217,7 @@ msgstr ""
msgid "Hello, friend!"
msgstr ""
#: bridgedb/distributors/https/templates/base.html:87 bridgedb/strings.py:58
#: bridgedb/distributors/https/templates/base.html:100 bridgedb/strings.py:58
msgid "Public Keys"
msgstr ""
......@@ -288,47 +296,49 @@ msgstr ""
msgid "My bridges don't work! I need help!"
msgstr ""
#. TRANSLATORS: Please DO NOT translate "Tor".
#: bridgedb/strings.py:117
#. TRANSLATORS: Please DO NOT translate "Tor Browser".
#. TRANSLATORS: The two '%s' are substituted with "Tor Browser Manual" and
#. "Support Portal", respectively.
#: bridgedb/strings.py:119
#, python-format
msgid "If your Tor cannot connect, please take a look at the %s and our %s."
msgid "If your Tor Browser cannot connect, please take a look at the %s and our %s."
msgstr ""
#: bridgedb/strings.py:121
#: bridgedb/strings.py:123
msgid "Here are your bridge lines:"
msgstr ""
#: bridgedb/strings.py:122
#: bridgedb/strings.py:124
msgid "Get Bridges!"
msgstr ""
#: bridgedb/strings.py:126
#: bridgedb/strings.py:128
msgid "Please select options for bridge type:"
msgstr ""
#: bridgedb/strings.py:127
#: bridgedb/strings.py:129
msgid "Do you need IPv6 addresses?"
msgstr ""
#: bridgedb/strings.py:128
#: bridgedb/strings.py:130
#, python-format
msgid "Do you need a %s?"
msgstr ""
#: bridgedb/strings.py:132
#: bridgedb/strings.py:134
msgid "Your browser is not displaying images properly."
msgstr ""
#: bridgedb/strings.py:133
#: bridgedb/strings.py:135
msgid "Enter the characters from the image above..."
msgstr ""
#: bridgedb/strings.py:137
#: bridgedb/strings.py:139
msgid "How to start using your bridges"
msgstr ""
#. TRANSLATORS: Please DO NOT translate "Tor Browser".
#: bridgedb/strings.py:139
#: bridgedb/strings.py:141
#, python-format
msgid ""
"To enter bridges into Tor Browser, first go to the %s Tor Browser download\n"
......@@ -337,7 +347,7 @@ msgid ""
msgstr ""
#. TRANSLATORS: Please DO NOT translate "Tor".
#: bridgedb/strings.py:144
#: bridgedb/strings.py:146
msgid ""
"When the 'Tor Network Settings' dialogue pops up, click 'Configure' and "
"follow\n"
......@@ -345,7 +355,7 @@ msgid ""
msgstr ""
#. TRANSLATORS: Please DO NOT translate "Tor".
#: bridgedb/strings.py:148
#: bridgedb/strings.py:150
msgid ""
"Does your Internet Service Provider (ISP) block or otherwise censor "
"connections\n"
......@@ -353,7 +363,7 @@ msgid ""
msgstr ""
#. TRANSLATORS: Please DO NOT translate "Tor".
#: bridgedb/strings.py:152
#: bridgedb/strings.py:154
msgid ""
"Select 'Yes' and then click 'Next'. To configure your new bridges, copy and\n"
"paste the bridge lines into the text input box. Finally, click 'Connect', and"
......@@ -362,29 +372,29 @@ msgid ""
"button in the 'Tor Network Settings' wizard for further assistance."
msgstr ""
#: bridgedb/strings.py:160
#: bridgedb/strings.py:162
msgid "Displays this message."
msgstr ""
#. TRANSLATORS: Please try to make it clear that "vanilla" here refers to the
#. same non-Pluggable Transport bridges described above as being
#. "plain-ol'-vanilla" bridges.
#: bridgedb/strings.py:164
#: bridgedb/strings.py:166
msgid "Request vanilla bridges."
msgstr ""
#: bridgedb/strings.py:165
#: bridgedb/strings.py:167
msgid "Request IPv6 bridges."
msgstr ""
#. TRANSLATORS: Please DO NOT translate the word the word "TYPE".
#: bridgedb/strings.py:167
#: bridgedb/strings.py:169
msgid "Request a Pluggable Transport by TYPE."
msgstr ""
#. TRANSLATORS: Please DO NOT translate "BridgeDB".
#. TRANSLATORS: Please DO NOT translate "GnuPG".
#: bridgedb/strings.py:170
#: bridgedb/strings.py:172
msgid "Get a copy of BridgeDB's public GnuPG key."
msgstr ""
......@@ -83,17 +83,20 @@ def setSupportedTransports(supportedTransports):
SUPPORTED_TRANSPORTS = supportedTransports
def isTransportSupported(transport):
"""Return `True' if the given transport is supported or `False' otherwise.
def isBridgeTypeSupported(bridgeType):
"""Return `True' or `False' depending on if the given bridge type is
supported.
:param str transport: The transport protocol.
:param str bridgeType: The bridge type, e.g., "vanilla" or "obfs4".
"""
if SUPPORTED_TRANSPORTS is None:
logging.error("Bug: Variable SUPPORTED_TRANSPORTS is None.")
return False
return transport in SUPPORTED_TRANSPORTS
# Note that "vanilla" isn't a transport protocol (in fact, it's the absence
# of a transport), which is why it isn't in SUPPORTED_TRANSPORTS.
return (bridgeType in SUPPORTED_TRANSPORTS) or (bridgeType == "vanilla")
def export(fh, measurementInterval):
......@@ -334,7 +337,7 @@ class HTTPSMetrics(Metrics):
# BridgeDB's HTTPS interface exposes transport types as a drop down
# menu but users can still request anything by manipulating HTTP
# parameters.
if not isTransportSupported(bridgeType):
if not isBridgeTypeSupported(bridgeType):
logging.warning("User requested unsupported transport type %s "
"over HTTPS." % bridgeType)
return
......@@ -393,7 +396,7 @@ class EmailMetrics(Metrics):
# Over email, transports are requested by typing them. Typos happen
# and users can request anything, really.
if not isTransportSupported(bridgeType):
if not isBridgeTypeSupported(bridgeType):
logging.warning("User requested unsupported transport type %s "
"over email." % bridgeType)
return
......@@ -439,7 +442,7 @@ class MoatMetrics(Metrics):
logging.warning("Could not decode request: %s" % err)
return
if not isTransportSupported(bridgeType):
if not isBridgeTypeSupported(bridgeType):
logging.warning("User requested unsupported transport type %s "
"over moat." % bridgeType)
return
......
......@@ -113,8 +113,10 @@ send the email using an address from one of the following email providers:
HELP = {
0: _("My bridges don't work! I need help!"),
# TRANSLATORS: Please DO NOT translate "Tor".
1: _("""If your Tor cannot connect, please take a look at the %s and our %s."""),
# TRANSLATORS: Please DO NOT translate "Tor Browser".
# TRANSLATORS: The two '%s' are substituted with "Tor Browser Manual" and
# "Support Portal", respectively.
1: _("""If your Tor Browser cannot connect, please take a look at the %s and our %s."""),
}
BRIDGES = {
......
......@@ -202,3 +202,14 @@ class StateTest(unittest.TestCase):
key2 = "moat.obfs4.us.fail.none"
self.assertTrue(metrix.hotMetrics[key1] == 1)
self.assertTrue(metrix.hotMetrics[key2] == 1)
def test_is_bridge_type_supported(self):
oldTransports = metrics.SUPPORTED_TRANSPORTS
metrics.setSupportedTransports({})
self.assertFalse(metrics.isBridgeTypeSupported("obfs4"))
metrics.setSupportedTransports(oldTransports)
self.assertTrue(metrics.isBridgeTypeSupported("obfs4"))
self.assertTrue(metrics.isBridgeTypeSupported("vanilla"))
self.assertFalse(metrics.isBridgeTypeSupported("xxx"))
Babel==2.7.0
BeautifulSoup==3.2.1
BeautifulSoup==3.2.2
Mako==1.1.0
pycryptodome==3.9.0
Twisted==19.7.0
gnupg==2.3.1
ipaddr==2.2.0
Pillow==6.1.0
Pillow==6.2.1
pyOpenSSL==19.0.0
pygeoip==0.3.2
qrcode==6.1
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment