dart-lang / i18n

A general mono-repo for Dart i18n and l10n packages.
BSD 3-Clause "New" or "Revised" License
64 stars 39 forks source link

Translating after Google Translator Toolkit #166

Open creativecreatorormaybenot opened 5 years ago

creativecreatorormaybenot commented 5 years ago

Google Translator Toolkit is shutting down and I do not know what other software would translate the files generated by intl_translation.
Having said that, I was not sure where to open the issue, so there is one over there as well: https://github.com/dart-lang/i18n/issues/534

jorgecoca commented 5 years ago

Since Google Translator Toolkit seems to be the only platform supporting ARB files, maybe an alternative for intl would be to produce a JSON format that is supported across major translation services.

In any case, if it helps, at BMW we wrote this CLI utility to transform to/from ARB files to JSON: https://github.com/bmw-tech/arb-converter-cli

alan-knight commented 5 years ago

Thanks. That seems very helpful and gives people an immediate option. How widely is "Hierarchical JSON" supported?

jorgecoca commented 5 years ago

I do not know, to be honest, I just know it works with our vendor of choice, but if you feel like a new format should be supported, you can file a new issue on arb-converter-cli... also, PRs are welcomed ;)

eltonmorais commented 5 years ago

Translator Toolkit has a poor suport for use last version translate on a new version (more strings) of the same APP. The Translation Memory sucks.

So, maybe an option is to work on a simple system for those translation, and that just allow to add new strings to translate without the need of create a entire new translation.

truongsinh commented 4 years ago

Hi, our vendor is Lokalise, and here's their supported format list: https://docs.lokalise.com/en/collections/652248-supported-file-formats

Notably, I think "GNU Gettext / PO", "ICU", some kinds of jsons...

alan-knight commented 4 years ago

Note that the ARB format is essentially ICU message strings in a JSON format. So it ought to be quite simple to emit/consume a different format. The most difficult part is understanding the other format, and if it handles things like "meaning", or how it defines parameters.

I started doing an experiment writing an equivalent to the extract_to_arb/generate_from_arb scripts in a separate package for XLIFF, which is one of the more complex alternatives, and it doesn't seem like there are many obstacles to doing that. If the strings are not ICU then understanding PetitParser enough to write a different grammar for them is an issue, and understanding XLIFF is another.

It requires importing files from lib/src in intl_translation, but that works, and I think we can reasonably move those out of src/re-export them to make it easier for people to do that. The thing I was doing is still pretty rough, doesn't actually have a specific target, and I have to do some paperwork to publish a new package. But if someone has a specific target they want to use/test against and are willing to try writing support for such a format, I'd be happy to help and to make supporting changes to intl_translation.

goranluledzija commented 4 years ago

Localizely supports ARB files.

I hope this helps.

mdoelker commented 4 years ago

Here is something to convert to XLIFF or Gettext and back https://www.npmjs.com/package/arb-convert

ChiefWiggum commented 4 years ago

BabelEdit has added support for arb files, works like a charm and doesn't cost a fortune.

fkirc commented 3 years ago

I wrote the free tool attranslate to compensate for the death of "Google Translator Toolkit": https://github.com/fkirc/attranslate You can give attranslate a try if this is still an issue for you. attranslate supports both JSON-files and ARB-files, and it also supports conversions between file-formats.

mosuem commented 2 years ago

See also this stackoverflow thread.