3 ms·
It's not a problem of HTML, but the method you use to construct translation string key names. If you have `<button>file</button>` and use it in both "[file] a
by pornel 15y ago
It's not a problem of HTML, but the method you use to construct translation string key names.
If you have `<button>file</button>` and use it in both "[file] a complaint" and "save to a [file]", then you're in trouble indeed.
But you can fix that by adding context to translation keys in the template, e.g. in TAL you can do `<button i18n:translate="'file (verb)'">file</button>`.
- _delirium 15y agoIt's not just an issue of polysemy (that "file" means two different things in English), but that the structure itself may need to be different in different languages, because languages have different grammars, and different ways of dealing with objects/numbers/etc. In the example I linked above, there's a whole mess of rules to capture if you want to handle singular/plural correctly in different languages, including those that distinguish more cases than singular and plural. It boils down to the fact that word-for-word translation doesn't work in all but the simplest cases: you can't translate "[a] [b] [c] [d]" by having 4 lookup tables for [a], [b], [c], and [d] and then plugging them into a template independently.
- lelf 15y agoGettext now offers quite the same solution http://www.gnu.org/software/gettext/manual/gettext.html#Contexts http://www.gnu.org/software/gettext/manual/gettext.html#Cont...