fluent icon indicating copy to clipboard operation
fluent copied to clipboard

Transpilers to switch/convert old/other localisation files?

Open rugk opened this issue 5 years ago • 2 comments

Are there any converters from other language/localisation file formats?

I've seen https://github.com/projectfluent/fluent/issues/233 asked for po(t) files, but my ideas would also be:

  • usual XAML/JSON "key-value" files (that are simple)
  • things like the files WebExtensions currently use (in case they could also switch to this in the future or one uses the same or the similar project for a website/different project)

rugk avatar Jan 27 '20 20:01 rugk

You can use fluent.migrate, which is now on pypi, and add custom parsers to compare-locales.

This isn't documented, really, but you can follow what we do in https://github.com/mozilla/bedrock/blob/master/lib/l10n_utils/management/commands/_fluent_ftl.py along with https://hg.mozilla.org/l10n/compare-locales/file/tip/contrib/lang.

We haven't put this into something shrink-wrapped because our need for bedrock was to integrate into the django commands there.

Pike avatar Jan 27 '20 20:01 Pike

That last sentence exceeds my linguistic capabilities as a non-native English speaker, ughm, I guess you mean it's not yet a "nice polished thing". :laughing: :wink:

Anyway, ehm, then maybe use this issue to document that thing? As a migrator/transpiler may be useful for other's outside of Mozilla too, that want to use Fluent? (Actually IMHO/I guess that hurdle of converting odl/legacy files or so may be one of the biggest preventing projects to switch to this.)

rugk avatar Jan 27 '20 21:01 rugk