tonsky / tongue

Do-it-yourself i18n library for Clojure/Script
Eclipse Public License 1.0
307 stars 19 forks source link

Support for ICU numbered (zero-indexed) substitutions #14

Closed jeroenheijmans closed 6 years ago

jeroenheijmans commented 6 years ago

We integrate with a SAAS for translations called "Lokalise", which can import and export translations in JSON format, assuming "ICU" as a standard for placeholders in substitutions.

However, ICU prescribes a zero-indexed set of placeholders, e.g. `"This translation has placeholders like {0} and {1}", whereas tongue expects 1-based placeholders.

It might be nice if build-translate would somehow accept an option/parameter to change the base index from 1 to 0, i.e. "ICU Mode".

(I can also imagine this would be considered feature creep and closed as wontfix for that reason.)

If you agree with some kind of approach here I'd be happy to take a crack at creating a PR for this feature.

tonsky commented 6 years ago

Yeah, this seems like out of scope. As we don’t directly support ICU, there needs to be a translation layer, and indexes translation best be handled there