Compare and lint Mozilla localizations
Перейти к файлу
Eemeli Aro 41e148f6ed
Merge pull request #25 from mozilla/bug1905520
Android: flag extra parameters as error when reference has none
2024-07-01 04:27:37 -04:00
.github/workflows Update actions and Python versions in test workflow (#24) 2024-04-18 14:36:48 +03:00
compare_locales Bump to version 0.9.4 2024-06-30 08:52:47 +02:00
contrib/lang Refactor project configuration (#15) 2023-03-22 09:33:14 +02:00
.arcconfig In-repo phabricator config for bug 1481586. rs=me 2018-08-10 10:48:25 +02:00
.git-blame-ignore-revs chore: Add a .git-blame-ignore-revs file 2023-03-21 15:35:29 +02:00
.gitignore Add support for fluent.syntax 0.19 (#11) 2023-03-16 20:10:38 +02:00
.hgignore Bug 1592561, adapt Pontoon parser to compare-locales, some basic tests, r=mathjazz 2019-11-06 18:13:59 +01:00
.hgtags Added tag RELEASE_8_1_0 for changeset 0f3cc6226011 2020-09-16 17:21:59 +02:00
LICENSE.md Add MPL 2.0 license to repository 2023-02-21 16:34:46 +01:00
README.md docs: Update ci test badge 2021-10-22 14:37:07 +03:00
pyproject.toml Refactor project configuration (#15) 2023-03-22 09:33:14 +02:00
tox.ini Refactor project configuration (#15) 2023-03-22 09:33:14 +02:00

README.md

Build tests

compare-locales

Lint Mozilla localizations

Finds

  • missing strings
  • obsolete strings
  • errors on runtime errors without false positives
  • warns on possible runtime errors

It also includes l10n-merge functionality, which pads localizations with missing English strings, and replaces entities with errors with English.

If you want to check your original code for errors like duplicated messages, use moz-l10n-lint, which is also part of this package. You can also use this to check for conflicts between your strings and those already exposed to l10n.

Configuration

You configure compare-locales (and moz-l10n-lint) through a project configuration file, l10n.toml.

Examples

To check all locales in a project use

compare-locales l10n.toml .

To check Firefox against a local check-out of l10n-central, use

compare-locales browser/locales/l10n.toml ../l10n-central

If you just want to check particular locales, specify them as additional commandline parameters.

To lint your local work, use

moz-l10n-lint l10n.toml

To check for conflicts against already existing strings:

moz-l10n-lint --reference-project ../android-l10n/mozilla-mobile/fenix l10n.toml
moz-l10n-lint --l10n-reference ../gecko-strings browser/locales/l10n.toml

to check for a monolithic project like Fenix or a gecko project like Firefox, resp.