https://github.com/mozilla/fluent-migrate
Toolchain for migrating translations to Fluent
https://github.com/mozilla/fluent-migrate
fluent l10n localization
Last synced: 12 months ago
JSON representation
Toolchain for migrating translations to Fluent
- Host: GitHub
- URL: https://github.com/mozilla/fluent-migrate
- Owner: mozilla
- License: other
- Created: 2023-05-16T05:54:54.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-29T08:53:43.000Z (over 1 year ago)
- Last Synced: 2025-06-17T00:32:32.994Z (about 1 year ago)
- Topics: fluent, l10n, localization
- Language: Python
- Homepage: https://pypi.org/project/fluent.migrate
- Size: 369 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
Fluent Migration Tools
======================
Programmatically create Fluent files from existing content in both legacy
and Fluent formats. Use recipes written in Python to migrate content for each
of your localizations.
`migrate-l10n` is a CLI script which uses the `fluent.migrate` module under
the hood to run migrations on existing translations.
`validate-l10n-recipe` is a CLI script to test a migration recipe for common
errors, without trying to apply it.
Installation
------------
Install from PyPI:
pip install fluent.migrate[hg]
If you only want to use the `MigrationContext` API, you can drop the
requirement on `python-hglib`:
pip install fluent.migrate
Usage
-----
Migrations consist of _recipes_, which are applied to a _localization repository_, based on _template files_.
You can find recipes for Firefox in `mozilla-central/python/l10n/fluent_migrations/`,
the reference repository is [gecko-strings](https://hg.mozilla.org/l10n/gecko-strings/) or _quarantine_.
You apply those migrations to l10n repositories in [l10n-central](https://hg.mozilla.org/l10n-central/), or to `gecko-strings` for testing.
The migrations are run as python modules, so you need to have their file location in `PYTHONPATH`.
An example would look like
$ migrate-l10n --lang it --reference-dir gecko-strings --localization-dir l10n-central/it bug_1451992_preferences_sitedata bug_1451992_preferences_translation