In Fluent each term you use in a string has to be availalbe in that
locale bundle. This change adds the english brands.ftl to every
non-en bundle so that it will fall back to en brand names if the
locale doesn't have a translation for that string.
If a list of ftl_files that was defined in the view was passed
to render() it would have updated the original list in place with
the list of default files, and this would have incresed the size of the
list every call to render() for that function.
* Update Fluent python view utils with better dev UX
This updates the `ftl`, `ftl_lazy`, and `has_messages` functions that
are for use in Python code to not require fluent files to be defined
if using the default files, to allow passing a single fluent file
as a string instead of a list, and to require fluent files to be
passed in via the `ftl_files` keyword argument.
* Update docs with new usage pattern for Python ftl function
Pick up fixes from `fluent.migrate`, and pass the right argument
when converting the en FTL file.
Also, update docs to suggest running `moz-l10n-lint`.
Some minor fixes to the fluent recipes, and really small improvement
on the `fluent activation` command.
This command does multiple things:
1. Update both the mozmeao/www-l10n repo and the mozilla-l10n/www-l10n one.
2. Copy all of the .ftl files from the mozilla-l10n repo to mozmeao
3. Check if they are valid .ftl files, and if not do not copy them
4. Check all of the successfully copied ones for activation rules
5. Write any newly activated locales to the metadata files
* Fix dict cache default timeout
* Add fallback strings and checking for translations in template
* Add ftl alias and ftl_lazy for use in py files
* Move git repos and add fluent to l10n_update
* Add percent_translated and required_messages to the l10n object
* Add management commands for converting en-US .lang file and templates
* Add command to convert en-US .lang file to .ftl file
* Using data from above command add a command that will convert a
template to use the .ftl strings
* Update the l10n_update command to update both external l10n repos
* Convert the /mission/ page to Fluent
* Add command to convert .lang translations to .ftl
* Copy en .ftl file when porting translations
* Removes the original string hash comments as well.
* Add Fluent docs.
* Add indentation and key sorting to metadata JSON output
* Add FTL file linting command
* Update mission template for FTL and remove FTL specific template
* Set l10n cache to 10s when DEBUG=True
* Fix and add tests for get_l10n_path
* Fix some style mistakes in docs and code
* Support multiline group comments for required strings
fix#7725, fix#7822, and fix#7726
pathlib2 is a backport of the Python 3.4+ standard library
pathlib. This PR just removes the now superfluous library
and switches all code to use the stdlib version. It also cleans
up some flake8 errors in some of the files updated.
Django 1.11 switched to argparse for arguments and added a method
for adding them. This was missed for the l10n commands during the
Django upgrade. Also the Puente library needed to be updated to a
supported version.
Fix#7181
* Localize Protocol navigation (Fixes#6498)
* Add navigation.lang to DOTLANG_FILES
* Update functional tests for new navigation
* Remove some old Tabzilla cruft
This modifies how several parts of translation in bedrock work:
1. You can now provide a list of locales in `active_locales` in
the template context that will be the list of available
translations for the page.
2. You can now provide a list of locales in `add_active_locales`
to add extra available translations for the page.
3. The `page()` and `LangFilesMixin` helpers are updated to support
these new context items.
4. You can now create and use `en-US` locale-specific-templates.
* Fix#6000: Map legal-docs locales to bedrock prod locales
Also filter out legal-docs translations that are not production
bedrock locales.
* Extract translations dict function for later use as well
Using Django's i18n infra for activation of translation
means that it looks for .mo files to decide whether to
activate it. This means that only those languages that
ship with Django will activate. Since we have our own
i18n system anyway we can copy their mechnics with a
much more simple system.
* newsletter.lang is no longer loaded as a default langfile for all templates (because only 8 locales do the newsletters and default files are assigned to all locales)
* all newsletter templates and newsletter python files except the hacks blog get their strings extracted to mozorg/newsletters.lang
* newsletter/views.py was loading strings from the contribute page, now they are also loaded from mozorg/newsletters.lang
* mozorg/forms.py now also loads strings from mozorg/newsletter.lang
* One string was corrected in a template (2 spaces instead of 1)
* tests and documentation updated
The mozorg/newsletters.lang file already has all the string copied from newsletter.lang and the file is on production on svn for the 8 locales that translate newsletters.
Strings in newsletter.lang that were used outside of newsletters were moved to main.lang
We will remove the old newsletter.lang from svn only once bedrock will run the new code and will no longer include newsletter.lang by default for all pages.
* Remove pytest-xdist from standard run. It's slower than normal if testing the local server.
* Add recommendation to use it if testing a remote instance to README.
* Remove pytest.ini in favor of using setup.cfg.
* Fix tests after redirects modification.
* Add py to redirects requirements.
* Upgrade south migrations to new Django native ones.
* Update deployment to use `migrate` in place of `syncdb`.
* Upgrade waffle and django-extensions for 1.7 compat.
Well... actually it mostly just moves most of funfactory
from an external lib to bedrock.base. But at least this way
we can remove the bits we don't need and be ready to make
the changes we need to upgrade to Django 1.8.
I can't come close to writing as perfect a commit message
for this as @willkg did for fjord, so I'll just leave this here.
https://github.com/mozilla/fjord/commit/9d7c97b
Tags (including "active") should be from all .lang files associated with
a template. So l10n_has_tag() as well as the active state of a page
should include information from all included .lang files from
add_lang_file and set_lang_files calls.
This also moves the check for DEV==True to the helpers, so checking
settings.DEV in templates is no longer necessary.
Use bug_list and bug_search_url fields in template
Add jingo_markdown
Upgrade RNA (4ae910da)
Add firefox.system_requirements view using RNA
Use latest RNA as submodule instead of pip install
Adjust views, settings, templates to use latest RNA
Restore lib/l10n_utils/helpers.py and tests from rebase mistake
Move django-extensions to submodule
Cleanup old rna egg-info
Move django-rest-framework to submodule
Move requests to submodule
Move Python-Markdown to submodule
Move jingo-markdown to submodule
Move six to submodule
Test RNA views + flake8 fixes
Fix flake8
Try to fix Jenkins test breakage
Clean up templates
Cleanup template some more
Reword test docstring and add comments
Update requiremnts/prod.txt to match submodules
Use settings.LANGUAGE_CODE for default locale
Try to make Jenkins happy
* Add sqlite config to base settings.
* Update tests to use Django's database aware TestCase.
* Install south.
* Install django-waffle.
* Update jenkins to use the database for CI.
Django admin will be enabled in a separate PR.
If a template uses the "set_lang_files" template tag
we should check the first lang file in that list if
the lang file for the specific template name isn't
active.
- Specified locales get FxOS messaging.
- Old messaging retained for legacy/other use.
- Update l10n_utils render function to handle list of
templates.