3 ms·
Localisation is one of several cases where I've come to the conclusion that frameworks that are supposed to help you end up doing more harm than good. What you
by lmm 8y ago
Localisation is one of several cases where I've come to the conclusion that frameworks that are supposed to help you end up doing more harm than good. What you really want is to express a bunch of functions that conform to a common interface: you pass in a number of files and a number of directories and you get back a user-facing string.
But we already have a very well-optimised system for expressing functions: whatever programming language we're actually working in. We already have the concept of a bundle of related functions that implements a particular polymorphic interface: a class.
Make an interface that represents what you need each translation - that is, language implementation - to provide. Write implementations of that interface, in collaboration with your translators (if your language doesn't let you write code in a way that a reasonably intelligent translator can read and verify, if not write, get a better language). Less awkward than gettext, and far more effective.
- skissane 8y agoMany translators aren't comfortable with editing source code. They want to get a file, e.g. in XLIFF format [1], which they can then load into their translation management system, and then use a GUI or web based tool to enter the translations for each string, and then at the end export the updated file and send it back to the developers. Plus, the translation management system makes it easy to keep track of progress (what % of strings have been translated so far), automate review (require each translation to be signed off by a second translator), etc – but, translation management systems can't import/export source code, but they often can import/export message catalogs. [1] https://en.wikipedia.org/wiki/XLIFF https://en.wikipedia.org/wiki/XLIFF
- dooglius 8y agoI wonder if you could create some kind of domain-specific language that would be easier for a translator to interact with, without said translator needing to understand the nuances of the underlying programming language, or deal with anything more complicated than non-nested if/case statements.
- gnoack 8y agoThe ICU project does that: http://userguide.icu-project.org/formatparse/messages http://userguide.icu-project.org/formatparse/messages
- lmm 8y agoNone of my translator friends has had anything good to say about those tools, though admittedly I know a small skewed sample of more technically-inclined types.