Closed Bug 1370176 Opened 7 years ago Closed 7 years ago

Unify l10n.ini and filter.py into a single (python-independent) format

Categories

(Toolkit Graveyard :: Build Config, defect)

defect
Not set
normal

Tracking

(firefox55 fixed)

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: Pike, Assigned: Pike)

References

Details

(Whiteboard: [gecko-l20n])

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #1165906 +++

Creating this clone, as mozreview doesn't like me continuing the work on bug 1165906.

l10n.ini and filter.py are overly complex, and they're only accessible to tools written in python.

Just .ini files aren't great, but I came across .toml, https://github.com/toml-lang/toml, which is also used by Rust/Cargo, which seems like a good fit.

Work on compare-locales is mostly done, see 1368025.

The documentation for the upcoming configuration is in its own project, as we'll share the configuration logic with all projects at mozilla eventually. Those docs are at http://moz-l10n-config.readthedocs.io/.
Depends on: 1165906
A few comments on the number of config files here, compared to https://dxr.mozilla.org/mozilla-central/search?q=path%3Al10n.ini.

services/sync has an ini file on its own to be included by SeaMonkey, we won't need that in the new configuration scheme.

Devtools are also just a dir per file, but I want to be able to reduce the number of locales there, independent of them probably moving out of central anyway. That's why they have files and locale lists on their own.

PS: Might be a good idea to remove the locale lists for now, until we have proper support for forking in all our toolchains.
(In reply to Axel Hecht [:Pike] from comment #2)
> PS: Might be a good idea to remove the locale lists for now, until we have
> proper support for forking in all our toolchains.

Also, the current list is out of date, e.g. missing lo for browser.
Comment on attachment 8874360 [details]
bug 1370176, generic configuration for l10n,

https://reviewboard.mozilla.org/r/145730/#review149686

I think it makes sense to drop locales for this first landing. The build part for mobile is documented in the docs, so we don't risk losing it.

::: python/compare-locales/docs/index.rst:24
(Diff revision 1)
>  
>  Localizers only handle a few file formats in well-known locations in the
>  source tree.
>  
> -The locations are in directories like
> +The locations are specified by TOML files. They're part of the bigger
> +localization ecosystem at mozilla, and `the documentation about the

Mozilla, file format right after

::: python/compare-locales/docs/index.rst:37
(Diff revision 1)
> +        l10n = {l}browser/**
> +
> +to add a directory for all localizations. Changes to these files are best
> +submitted for review by :Pike or :flod.
> +
> +These configurations files are the future, and right now, we still have

configuration files
Rebased the patch on central, fixed the locale lists for browser and mobile, dropped the locale lists in devtools.

Fixed some python comparisons in filter.py to be explicitly checking for None for file checks.

Fixed typos.
Comment on attachment 8874360 [details]
bug 1370176, generic configuration for l10n,

https://reviewboard.mozilla.org/r/145730/#review150158
Attachment #8874360 - Flags: review?(francesco.lodolo) → review+
Comment on attachment 8874360 [details]
bug 1370176, generic configuration for l10n,

https://reviewboard.mozilla.org/r/145730/#review151588

I have some questions about where this is going and I could bikeshed about implementation details. But I don't want to get in the way of progress. Most of this commit is duplicating existing functionality in a machine readable manner. It will be easy enough to mass convert things in the future if things don't pan out. So perfect is the enemy of good. Land it.
Attachment #8874360 - Flags: review?(gps) → review+
Pushed by axel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/91ddd0674124
generic configuration for l10n, r=flod,gps
Pushed by axel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cd6899d44b57
generic configuration for l10n, r=flod,gps
Tested the build failure locally and pushed to try, **/l10n.toml instead of l10n.toml works and make mach echo the right bugzilla info for browser/locales/l10n.toml.

Pushed again to autoland.
Flags: needinfo?(l10n)
https://hg.mozilla.org/mozilla-central/rev/cd6899d44b57
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Blocks: 1372167
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: