diff --git a/locale/compile-mo.sh b/locale/compile-mo.sh index a0e98a8918..810ae89ab9 100755 --- a/locale/compile-mo.sh +++ b/locale/compile-mo.sh @@ -20,7 +20,7 @@ for pofile in `find $1 -type f -name "django.po"`; do dir=`dirname $pofile` lang=`echo $pofile | cut -d "/" -f2` stem=`basename $pofile .po` - if [ $lang != 'dbr' ] && [ $lang != 'dbl' ] + if [ $lang != 'dbg' ] then # lint the .po file dennis-cmd lint --quiet --errorsonly "$pofile" @@ -41,7 +41,7 @@ for pofile in `find $1 -type f -name "djangojs.po"`; do lang=`echo $pofile | cut -d "/" -f2` stem=`basename $pofile .po` touch "${dir}/${stem}.mo" - if [ $lang != 'dbr' ] && [ $lang != 'dbl' ] + if [ $lang != 'dbg' ] then # lint the .po file dennis-cmd lint --quiet --errorsonly "$pofile" diff --git a/locale/dbg/LC_MESSAGES/django.mo b/locale/dbg/LC_MESSAGES/django.mo new file mode 100644 index 0000000000..1c5fdc5fb4 Binary files /dev/null and b/locale/dbg/LC_MESSAGES/django.mo differ diff --git a/locale/dbl/LC_MESSAGES/django.po b/locale/dbg/LC_MESSAGES/django.po similarity index 99% rename from locale/dbl/LC_MESSAGES/django.po rename to locale/dbg/LC_MESSAGES/django.po index 6320a4e4ba..580a77475e 100644 --- a/locale/dbl/LC_MESSAGES/django.po +++ b/locale/dbg/LC_MESSAGES/django.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT 1.0\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2017-05-15 02:55+0000\n" +"POT-Creation-Date: 2017-05-02 11:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -192,6 +192,14 @@ msgstr "Ḿẏ ȧḓḓ-ǿƞ ḓǿḗşƞ'ŧ ƒīŧ īƞŧǿ ȧƞẏ ǿƒ ŧħ msgid "No compatible versions" msgstr "Ƞǿ ƈǿḿƥȧŧīƀŀḗ ṽḗřşīǿƞş" +#: src/olympia/addons/templates/addons/button.html src/olympia/addons/templates/addons/impala/button.html +msgid "Added to Mobile" +msgstr "Ȧḓḓḗḓ ŧǿ Ḿǿƀīŀḗ" + +#: src/olympia/addons/templates/addons/button.html src/olympia/addons/templates/addons/impala/button.html +msgid "Add to Mobile" +msgstr "Ȧḓḓ ŧǿ Ḿǿƀīŀḗ" + #. {0} is a platform name like Windows or Mac OS X. #: src/olympia/addons/templates/addons/button.html src/olympia/addons/templates/addons/includes/install_button.html msgid "for {0}" @@ -692,10 +700,6 @@ msgstr "ɊŘ ƈǿḓḗ ƒǿř ȧḓḓ-ǿƞ" msgid "Want {0} on your mobile Firefox? Scan this QR code to install directly to your phone. (You'll need a QR reader. Search your phone's marketplace if don't have one.)" msgstr "Ẇȧƞŧ {0} ǿƞ ẏǿŭř ḿǿƀīŀḗ Ƒīřḗƒǿẋ? Şƈȧƞ ŧħīş ɊŘ ƈǿḓḗ ŧǿ īƞşŧȧŀŀ ḓīřḗƈŧŀẏ ŧǿ ẏǿŭř ƥħǿƞḗ. (Ẏǿŭ'ŀŀ ƞḗḗḓ ȧ ɊŘ řḗȧḓḗř. Şḗȧřƈħ ẏǿŭř ƥħǿƞḗ'ş ḿȧřķḗŧƥŀȧƈḗ īƒ ḓǿƞ'ŧ ħȧṽḗ ǿƞḗ.)" -#: src/olympia/addons/templates/addons/replacement_addons.html -msgid "Replacement Add-ons for {0}" -msgstr "Řḗƥŀȧƈḗḿḗƞŧ Ȧḓḓ-ǿƞş ƒǿř {0}" - #: src/olympia/addons/templates/addons/impala/details-more.html src/olympia/addons/templates/addons/impala/details.html src/olympia/addons/templates/addons/report_abuse.html msgid "Report Abuse" msgstr "Řḗƥǿřŧ Ȧƀŭşḗ" @@ -1091,6 +1095,10 @@ msgstr "Ḿẏ Ȧḓḓ-ǿƞş" msgid "My Themes" msgstr "Ḿẏ Ŧħḗḿḗş" +#: src/olympia/addons/templates/addons/includes/install_button.html +msgid "Add to Firefox" +msgstr "Ȧḓḓ ŧǿ Ƒīřḗƒǿẋ" + #. This is a caption for a table. {0} is an add-on name. #: src/olympia/addons/templates/addons/includes/persona.html src/olympia/editors/templates/editors/addon_details_box.html msgid "Add-on Information for {0}" @@ -4179,8 +4187,7 @@ msgstr[1] "{0} ŧħḗḿḗş" msgid "Edit Information" msgstr "Ḗḓīŧ Īƞƒǿřḿȧŧīǿƞ" -#: src/olympia/devhub/templates/devhub/addons/edit.html src/olympia/devhub/templates/devhub/includes/macros.html src/olympia/editors/templates/editors/includes/files_view.html -#: src/olympia/translations/templates/translations/all-locales.html +#: src/olympia/devhub/templates/devhub/addons/edit.html src/olympia/devhub/templates/devhub/includes/macros.html src/olympia/translations/templates/translations/all-locales.html msgid "None" msgstr "Ƞǿƞḗ" @@ -6369,18 +6376,6 @@ msgstr "Ħȧş ŧǿǿ ḿȧƞẏ ḓȧīŀẏ ŭşḗřş." msgid "Has too few consecutive human-approved updates." msgstr "Ħȧş ŧǿǿ ƒḗẇ ƈǿƞşḗƈŭŧīṽḗ ħŭḿȧƞ-ȧƥƥřǿṽḗḓ ŭƥḓȧŧḗş." -#: src/olympia/editors/models.py -msgid "Has a pending info request." -msgstr "Ħȧş ȧ ƥḗƞḓīƞɠ īƞƒǿ řḗɋŭḗşŧ." - -#: src/olympia/editors/models.py -msgid "Is flagged for admin review." -msgstr "Īş ƒŀȧɠɠḗḓ ƒǿř ȧḓḿīƞ řḗṽīḗẇ." - -#: src/olympia/editors/models.py -msgid "Is locked by a reviewer." -msgstr "Īş ŀǿƈķḗḓ ƀẏ ȧ řḗṽīḗẇḗř." - #: src/olympia/editors/tasks.py msgid "Duplicate Submission" msgstr "Ḓŭƥŀīƈȧŧḗ Şŭƀḿīşşīǿƞ" @@ -6473,8 +6468,18 @@ msgid "{addon} :: Abuse Reports" msgstr "{ȧḓḓǿƞ} :: Ȧƀŭşḗ Řḗƥǿřŧş" #: src/olympia/editors/templates/editors/abuse_reports.html -msgid "Abuse Reports for {addon} and its developers ({num})" -msgstr "Ȧƀŭşḗ Řḗƥǿřŧş ƒǿř {ȧḓḓǿƞ} ȧƞḓ īŧş ḓḗṽḗŀǿƥḗřş ({ƞŭḿ})" +msgid "Abuse Reports for {addon} ({num})" +msgstr "Ȧƀŭşḗ Řḗƥǿřŧş ƒǿř {ȧḓḓǿƞ} ({ƞŭḿ})" + +#: src/olympia/editors/templates/editors/abuse_reports.html +#, python-format +msgid "%(user)s on %(date)s [%(ip_address)s]" +msgstr "%(user)s ǿƞ %(date)s [%(ip_address)s]" + +#: src/olympia/editors/templates/editors/abuse_reports.html +#, python-format +msgid "anonymous on %(date)s [%(ip_address)s]" +msgstr "ȧƞǿƞẏḿǿŭş ǿƞ %(date)s [%(ip_address)s]" #. This refers to this version's compatible applications, such as Firefox 8.0 #: src/olympia/editors/templates/editors/addon_details_box.html src/olympia/search/templates/search/results.html src/olympia/versions/templates/versions/version.html @@ -6513,14 +6518,6 @@ msgstr "Ŀȧşŧ Ȧƥƥřǿṽȧŀ Ḓȧŧḗ" msgid "Approvals Since Last Automatic Review" msgstr "Ȧƥƥřǿṽȧŀş Şīƞƈḗ Ŀȧşŧ Ȧŭŧǿḿȧŧīƈ Řḗṽīḗẇ" -#: src/olympia/editors/templates/editors/addon_details_box.html -msgid "Abuse Reports ({num})" -msgstr "Ȧƀŭşḗ Řḗƥǿřŧş ({ƞŭḿ})" - -#: src/olympia/editors/templates/editors/addon_details_box.html -msgid "Bad User Reviews ({num})" -msgstr "Ɓȧḓ Ŭşḗř Řḗṽīḗẇş ({ƞŭḿ})" - #: src/olympia/editors/templates/editors/addon_details_box.html msgid "More about this add-on" msgstr "Ḿǿřḗ ȧƀǿŭŧ ŧħīş ȧḓḓ-ǿƞ" @@ -6864,12 +6861,12 @@ msgid "The developer has provided source code." msgstr "Ŧħḗ ḓḗṽḗŀǿƥḗř ħȧş ƥřǿṽīḓḗḓ şǿŭřƈḗ ƈǿḓḗ." #: src/olympia/editors/templates/editors/review.html -msgid "Not Auto Approved Because" -msgstr "Ƞǿŧ Ȧŭŧǿ Ȧƥƥřǿṽḗḓ Ɓḗƈȧŭşḗ" +msgid "Auto Approval Summary" +msgstr "Ȧŭŧǿ Ȧƥƥřǿṽȧŀ Şŭḿḿȧřẏ" #: src/olympia/editors/templates/editors/review.html -msgid "Auto-Approval script has not run yet on this version." -msgstr "Ȧŭŧǿ-Ȧƥƥřǿṽȧŀ şƈřīƥŧ ħȧş ƞǿŧ řŭƞ ẏḗŧ ǿƞ ŧħīş ṽḗřşīǿƞ." +msgid "No attempt recorded yet." +msgstr "Ƞǿ ȧŧŧḗḿƥŧ řḗƈǿřḓḗḓ ẏḗŧ." #: src/olympia/editors/templates/editors/review.html msgid "This version has not been reviewed." @@ -6945,11 +6942,6 @@ msgstr "Ħīḓḗ Ƈǿḿḿḗƞŧş" msgid "No reviews found for this period." msgstr "Ƞǿ řḗṽīḗẇş ƒǿŭƞḓ ƒǿř ŧħīş ƥḗřīǿḓ." -#: src/olympia/editors/templates/editors/includes/abuse_reports_list.html -#, python-format -msgid "%(user)s [%(ip_address)s] reported %(object)s on %(date)s" -msgstr "%(user)s [%(ip_address)s] řḗƥǿřŧḗḓ %(object)s ǿƞ %(date)s" - #: src/olympia/editors/templates/editors/includes/daily-message.html msgid "Dismiss this announcement" msgstr "Ḓīşḿīşş ŧħīş ȧƞƞǿŭƞƈḗḿḗƞŧ" @@ -6966,10 +6958,6 @@ msgstr "Ƈǿƞŧḗƞŧş" msgid "Compare" msgstr "Ƈǿḿƥȧřḗ" -#: src/olympia/editors/templates/editors/includes/files_view.html -msgid "Permissions:" -msgstr "Ƥḗřḿīşşīǿƞş:" - #: src/olympia/editors/templates/editors/includes/history.html #, python-format msgid "
By %(user)s on %(date)s
" @@ -7008,11 +6996,6 @@ msgstr "Ȧŀŀ Ŧīḿḗ" msgid "You have {0} points." msgstr "Ẏǿŭ ħȧṽḗ {0} ƥǿīƞŧş." -#: src/olympia/editors/templates/editors/includes/user_reviews_list.html -#, python-format -msgid "%(user)s on %(date)s [%(ip_address)s]" -msgstr "%(user)s ǿƞ %(date)s [%(ip_address)s]" - #: src/olympia/editors/templates/editors/themes/deleted.html msgid "Date Deleted" msgstr "Ḓȧŧḗ Ḓḗŀḗŧḗḓ" @@ -9459,7 +9442,7 @@ msgstr "Ẇħȧŧ īş ŧħḗ Ḿẏ Ƒȧṽǿřīŧḗş ƈǿŀŀḗƈŧīǿƞ msgid "Favorite add-ons are add-ons that you have bookmarked to easily get back to later. You can add an add-on to your favorites collection by clicking \"Add to favorites\" on its details page." msgstr "Ƒȧṽǿřīŧḗ ȧḓḓ-ǿƞş ȧřḗ ȧḓḓ-ǿƞş ŧħȧŧ ẏǿŭ ħȧṽḗ ƀǿǿķḿȧřķḗḓ ŧǿ ḗȧşīŀẏ ɠḗŧ ƀȧƈķ ŧǿ ŀȧŧḗř. Ẏǿŭ ƈȧƞ ȧḓḓ ȧƞ ȧḓḓ-ǿƞ ŧǿ ẏǿŭř ƒȧṽǿřīŧḗş ƈǿŀŀḗƈŧīǿƞ ƀẏ ƈŀīƈķīƞɠ \"Ȧḓḓ ŧǿ ƒȧṽǿřīŧḗş\" ǿƞ īŧş ḓḗŧȧīŀş ƥȧɠḗ." -#: src/olympia/pages/templates/pages/faq.html +#: src/olympia/pages/templates/pages/faq.html src/olympia/templates/impala/header_title.html msgid "Mobile Add-ons" msgstr "Ḿǿƀīŀḗ Ȧḓḓ-ǿƞş" @@ -10575,6 +10558,10 @@ msgstr "\"Firefox\" Ȧḓḓ-ǿƞş" msgid "\"Thunderbird\" Add-ons" msgstr "\"Thunderbird\" Ȧḓḓ-ǿƞş" +#: src/olympia/templates/header_title.html +msgid "\"Firefox\" Mobile Add-ons" +msgstr "\"Firefox\" Ḿǿƀīŀḗ Ȧḓḓ-ǿƞş" + #: src/olympia/templates/header_title.html msgid "\"SeaMonkey\" Add-ons" msgstr "\"SeaMonkey\" Ȧḓḓ-ǿƞş" @@ -10696,6 +10683,10 @@ msgstr "Ƒīřḗƒǿẋ Ȧƈƈǿŭƞŧş ŭşḗřş ƈȧƞƞǿŧ ƈŭřřḗƞ msgid "Profile Photo" msgstr "Ƥřǿƒīŀḗ Ƥħǿŧǿ" +#: src/olympia/users/forms.py src/olympia/users/templates/users/edit.html +msgid "Default locale" +msgstr "Ḓḗƒȧŭŀŧ ŀǿƈȧŀḗ" + #: src/olympia/users/forms.py msgid "This URL has an invalid format. Valid URLs look like http://example.com/my_page." msgstr "Ŧħīş ŬŘĿ ħȧş ȧƞ īƞṽȧŀīḓ ƒǿřḿȧŧ. Ṽȧŀīḓ ŬŘĿş ŀǿǿķ ŀīķḗ http://example.com/my_page." @@ -10921,6 +10912,10 @@ msgstr "Ƈħǿǿşḗ Ƥħǿŧǿ…" msgid "Delete current photo" msgstr "Ḓḗŀḗŧḗ ƈŭřřḗƞŧ ƥħǿŧǿ" +#: src/olympia/users/templates/users/edit.html +msgid "This is the default locale used to display information about you (like your description)." +msgstr "Ŧħīş īş ŧħḗ ḓḗƒȧŭŀŧ ŀǿƈȧŀḗ ŭşḗḓ ŧǿ ḓīşƥŀȧẏ īƞƒǿřḿȧŧīǿƞ ȧƀǿŭŧ ẏǿŭ (ŀīķḗ ẏǿŭř ḓḗşƈřīƥŧīǿƞ)." + #: src/olympia/users/templates/users/edit.html msgid "Introduce yourself to the community, if you like! This text will appear publicly on your user info page." msgstr "Īƞŧřǿḓŭƈḗ ẏǿŭřşḗŀƒ ŧǿ ŧħḗ ƈǿḿḿŭƞīŧẏ, īƒ ẏǿŭ ŀīķḗ! Ŧħīş ŧḗẋŧ ẇīŀŀ ȧƥƥḗȧř ƥŭƀŀīƈŀẏ ǿƞ ẏǿŭř ŭşḗř īƞƒǿ ƥȧɠḗ." diff --git a/locale/dbg/LC_MESSAGES/djangojs.mo b/locale/dbg/LC_MESSAGES/djangojs.mo new file mode 100644 index 0000000000..b6ec279738 Binary files /dev/null and b/locale/dbg/LC_MESSAGES/djangojs.mo differ diff --git a/locale/dbl/LC_MESSAGES/djangojs.po b/locale/dbg/LC_MESSAGES/djangojs.po similarity index 99% rename from locale/dbl/LC_MESSAGES/djangojs.po rename to locale/dbg/LC_MESSAGES/djangojs.po index 3cfce9983b..81d6385b7b 100644 --- a/locale/dbl/LC_MESSAGES/djangojs.po +++ b/locale/dbg/LC_MESSAGES/djangojs.po @@ -3,7 +3,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT 1.0\n" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2017-05-15 02:55+0000\n" +"POT-Creation-Date: 2017-05-02 11:20+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/locale/dbg/README b/locale/dbg/README new file mode 100644 index 0000000000..b52cb5baf2 --- /dev/null +++ b/locale/dbg/README @@ -0,0 +1,2 @@ +This is a fake language used for debugging the site. Files generated with +podebug. Ask clouserw for help. diff --git a/locale/dbl/LC_MESSAGES/django.mo b/locale/dbl/LC_MESSAGES/django.mo deleted file mode 100644 index 4f31a41768..0000000000 Binary files a/locale/dbl/LC_MESSAGES/django.mo and /dev/null differ diff --git a/locale/dbl/LC_MESSAGES/djangojs.mo b/locale/dbl/LC_MESSAGES/djangojs.mo deleted file mode 100644 index d7f182bf4d..0000000000 Binary files a/locale/dbl/LC_MESSAGES/djangojs.mo and /dev/null differ diff --git a/locale/omg_new_l10n.sh b/locale/omg_new_l10n.sh index 4c612e9ba9..10ee793631 100755 --- a/locale/omg_new_l10n.sh +++ b/locale/omg_new_l10n.sh @@ -24,38 +24,48 @@ EMAIL_SOURCE="https://github.com/mozilla/olympia/tree/master/locale" CLEAN_FLAGS="--no-obsolete --width=200 --add-location=file" MERGE_FLAGS="--update --width=200 --backup=none" UNIQ_FLAGS="--width=200" - -# We don't do `dbr` for now, see -# https://github.com/mozilla/addons-server/pull/5402#discussion_r116455162 -# for a few more details -DEBUG_LOCALES="dbl" +unset DOALLTHETHINGS # ------------------------------------------------------------------- +function confirm { + if [ ! -z $DOALLTHETHINGS ]; then + return 0 + fi + + PROMPT=$1 + read -p "$PROMPT [y/n]: " YESNO + if [[ $YESNO == 'y' ]] + then + return 0 + else + return 1 + fi +} + +if [[ "$1" == "--do-all-the-things" ]]; then + DOALLTHETHINGS=1 +fi + if [ ! -d "locale" ]; then echo "Sorry, please run from the root of the project, eg. ./locale/omg_new_l10n.sh" exit 1 fi +#if [ ! -z "$(git status --porcelain)" ]; then +# echo "Looks like you have some local changes. Please clean up your root before we start committing random things." +# git status +# exit 1 +#fi + echo "Alright, here we go..." ./manage.py extract pushd locale > /dev/null -for debugLocale in $DEBUG_LOCALES; do - for domain in django djangojs; do - if [ "$debugLocale" == "dbr" ]; then - rewrite="flipped" - else - rewrite="unicode" - fi - - echo "generating debug locale '$debugLocale' for '$domain' using '$rewrite'" - - podebug -i "templates/LC_MESSAGES/$domain.pot" -o "$debugLocale/LC_MESSAGES/$domain.po" --rewrite "$rewrite" - done -done +podebug --rewrite=unicode templates/LC_MESSAGES/django.pot dbg/LC_MESSAGES/django.po +podebug --rewrite=unicode templates/LC_MESSAGES/djangojs.pot dbg/LC_MESSAGES/djangojs.po echo "Merging any new keys..." for i in `find . -name "django.po" | grep -v "en_US"`; do @@ -79,9 +89,56 @@ for i in `find . -name "djangojs.po"`; do msgattrib $CLEAN_FLAGS --output-file=$i $i done +msgattrib $CLEAN_FLAGS --output-file=dbg/LC_MESSAGES/django.po dbg/LC_MESSAGES/django.po +msgattrib $CLEAN_FLAGS --output-file=dbg/LC_MESSAGES/djangojs.po dbg/LC_MESSAGES/djangojs.po msgfilter -i sr/LC_MESSAGES/django.po -o sr_Latn/LC_MESSAGES/django.po recode-sr-latin popd > /dev/null +# pushd locale > /dev/null +# ./compile-mo.sh . +# popd > /dev/null + +#if confirm "Commit your changes?"; then +# git commit locale -m "Extract/compile script. Today's lucky number is $RANDOM." +# git push mozilla master +#fi + +# echo "Calculating changes...." +# pushd locale > /dev/null +# CHANGES=$(cat < /dev/null + +# echo "-----------------------------------------------" +# echo "$CHANGES" +# echo "-----------------------------------------------" + +# Uses sendmail so we can set a real From address +#if confirm "Do you want to send that to $EMAIL_TO?"; then +# echo "$CHANGES" | /usr/lib/sendmail -t +#fi + unset DOALLTHETHINGS echo "done." diff --git a/settings.py b/settings.py index 5f0b8a6a2d..baa4764be4 100644 --- a/settings.py +++ b/settings.py @@ -146,12 +146,6 @@ INBOUND_EMAIL_VALIDATION_KEY = 'totally-unsecure-validation-string' GITHUB_API_USER = '' GITHUB_API_TOKEN = '' - -AMO_LANGUAGES = AMO_LANGUAGES + DEBUG_LANGUAGES - -LANGUAGES = lazy(lazy_langs, dict)(AMO_LANGUAGES) -LANGUAGE_URL_MAP = dict([(i.lower(), i) for i in AMO_LANGUAGES]) - # If you have settings you want to overload, put them in a local_settings.py. try: from local_settings import * # noqa diff --git a/src/olympia/amo/utils.py b/src/olympia/amo/utils.py index bbcdd824fc..d6f2dd02b3 100644 --- a/src/olympia/amo/utils.py +++ b/src/olympia/amo/utils.py @@ -587,7 +587,7 @@ def get_locale_from_lang(lang): """Pass in a language (u'en-US') get back a Locale object courtesy of Babel. Use this to figure out currencies, bidi, names, etc.""" # Special fake language can just act like English for formatting and such - if not lang or lang in ('dbg', 'dbr', 'dbl'): + if not lang or lang == 'dbg': lang = 'en' return Locale.parse(translation.to_locale(lang)) diff --git a/src/olympia/conf/dev/settings.py b/src/olympia/conf/dev/settings.py index 80c749a878..846413a1c3 100644 --- a/src/olympia/conf/dev/settings.py +++ b/src/olympia/conf/dev/settings.py @@ -223,8 +223,7 @@ PAYPAL_CHAINS = ( SENTRY_DSN = env('SENTRY_DSN') -AMO_LANGUAGES = AMO_LANGUAGES + DEBUG_LANGUAGES - +AMO_LANGUAGES = AMO_LANGUAGES + ('dbg',) LANGUAGES = lazy(lazy_langs, dict)(AMO_LANGUAGES) LANGUAGE_URL_MAP = dict([(i.lower(), i) for i in AMO_LANGUAGES]) diff --git a/src/olympia/conf/stage/settings.py b/src/olympia/conf/stage/settings.py index cce02d18f5..a1c76b2b62 100644 --- a/src/olympia/conf/stage/settings.py +++ b/src/olympia/conf/stage/settings.py @@ -217,8 +217,7 @@ PAYPAL_CHAINS = ( SENTRY_DSN = env('SENTRY_DSN') -AMO_LANGUAGES = AMO_LANGUAGES + DEBUG_LANGUAGES - +AMO_LANGUAGES = AMO_LANGUAGES + ('dbg',) LANGUAGES = lazy(lazy_langs, dict)(AMO_LANGUAGES) LANGUAGE_URL_MAP = dict([(i.lower(), i) for i in AMO_LANGUAGES]) diff --git a/src/olympia/files/management/commands/update_permissions_from_mc.py b/src/olympia/files/management/commands/update_permissions_from_mc.py index cd47c53c78..accd1ff6d0 100644 --- a/src/olympia/files/management/commands/update_permissions_from_mc.py +++ b/src/olympia/files/management/commands/update_permissions_from_mc.py @@ -23,7 +23,7 @@ class Command(BaseCommand): central_url = settings.WEBEXT_PERM_DESCRIPTIONS_URL locales_url = settings.WEBEXT_PERM_DESCRIPTIONS_LOCALISED_URL amo_locales = [l for l in settings.AMO_LANGUAGES - if l not in ['en-US', 'dbg', 'dbr', 'dbl']] + if l not in ['en-US', 'dbg']] # Fetch canonical en-US descriptions first; then l10n after. update_webext_descriptions_all.apply_async( args=[(central_url, 'en-US'), diff --git a/src/olympia/lib/settings_base.py b/src/olympia/lib/settings_base.py index 5a3d5840c7..805a52df14 100644 --- a/src/olympia/lib/settings_base.py +++ b/src/olympia/lib/settings_base.py @@ -173,31 +173,13 @@ SHORTER_LANGUAGES = { # L10n dashboard. Generally languages start here and move into AMO_LANGUAGES. HIDDEN_LANGUAGES = ('cy', 'hr', 'sr', 'sr-Latn', 'tr') -# We don't do `dbr` for now, see -# https://github.com/mozilla/addons-server/pull/5402#discussion_r116455162 -# for a few more details -DEBUG_LANGUAGES = ('dbl',) - def lazy_langs(languages): from product_details import product_details - if not product_details.languages: return {} - - language_mapping = {} - - for lang in languages: - if lang == 'dbl': - lang_name = product_details.languages['dbg']['native'] - elif lang == 'dbr': - lang_name = product_details.languages['dbg']['native'] + ' (RTL)' - else: - lang_name = product_details.languages[lang]['native'] - - language_mapping[lang.lower()] = lang_name - - return language_mapping + return dict([(i.lower(), product_details.languages[i]['native']) + for i in languages]) # Where product details are stored see django-mozilla-product-details @@ -206,7 +188,7 @@ PROD_DETAILS_STORAGE = 'olympia.lib.product_details_backend.NoCachePDFileStorage # Override Django's built-in with our native names LANGUAGES = lazy(lazy_langs, dict)(AMO_LANGUAGES) -LANGUAGES_BIDI = ('ar', 'fa', 'fa-IR', 'he', 'dbr') +RTL_LANGUAGES = ('ar', 'fa', 'fa-IR', 'he') LANGUAGE_URL_MAP = dict([(i.lower(), i) for i in AMO_LANGUAGES]) diff --git a/src/olympia/translations/helpers.py b/src/olympia/translations/helpers.py index 925541e91b..473f37f7d3 100644 --- a/src/olympia/translations/helpers.py +++ b/src/olympia/translations/helpers.py @@ -24,7 +24,7 @@ def locale_html(translatedfield): if locale == site_locale: return '' else: - rtl_locales = map(translation.to_locale, settings.LANGUAGES_BIDI) + rtl_locales = map(translation.to_locale, settings.RTL_LANGUAGES) textdir = 'rtl' if locale in rtl_locales else 'ltr' return jinja2.Markup(' lang="%s" dir="%s"' % ( jinja2.escape(translatedfield.locale), textdir)) diff --git a/src/olympia/translations/tests/test_helpers.py b/src/olympia/translations/tests/test_helpers.py index 69c552e4c8..26616ccec2 100644 --- a/src/olympia/translations/tests/test_helpers.py +++ b/src/olympia/translations/tests/test_helpers.py @@ -36,7 +36,7 @@ def test_locale_html(): assert s == ' lang="de" dir="ltr"' # rtl language - for lang in settings.LANGUAGES_BIDI: + for lang in settings.RTL_LANGUAGES: testfield.locale = lang s = helpers.locale_html(testfield) assert s == ' lang="%s" dir="rtl"' % testfield.locale diff --git a/src/olympia/zadmin/forms.py b/src/olympia/zadmin/forms.py index 70482dbb16..bd00a804ed 100644 --- a/src/olympia/zadmin/forms.py +++ b/src/olympia/zadmin/forms.py @@ -136,8 +136,8 @@ class NotifyForm(happyforms.Form): class FeaturedCollectionForm(happyforms.ModelForm): LOCALES = (('', u'(Default Locale)'),) + tuple( - (lang, product_details.languages[lang]['native']) - for lang in settings.AMO_LANGUAGES) + (i, product_details.languages[i]['native']) + for i in settings.AMO_LANGUAGES) application = forms.ChoiceField(amo.APPS_CHOICES) collection = forms.CharField(widget=forms.HiddenInput)