Below are ideas to improve the Tiki interface (not content) translation system. Some were discussed at TikiFest Virtual 2021.
Aims
Add context to translatable strings
See summary: Contextual translations
As discussed on the dev list here
Status: DONE and approved during TikifestVirtual2021 on https://gitlab.com/jyhem/tiki-translations-revamp. Working solution in master: https://gitlab.com/tikiwiki/tiki/-/commit/67cbcb7ad2080c077bcd25771b7389b4243ba496. Please review/comment.
Current plan is to add an underscore with upper "C" (as in context) and parentheses wrapped string to indicate context, e.g.:
"edit_C(verb)" => "edit", "edit_C(noun)" => "edit", "D_C(abbrev-day)" => "D", "M_C(abbrev-month)" => "M", "Location_C(map)" => "Location", "Rent_C(verb)" => "Rent",
"edit_C(verb)" => "modifier", "edit_C(noun)" => "modification", "D_C(abbrev-day)" => "J", "M_C(abbrev-month)" => "M", "Location_C(map)" => "Lieu", "Rent_C(verb)" => "Location",
Make the Smarty {tr} block work for RTL Languages
Discussion during TikifestVirtual2021 led to the conclusion this is not a Translation Revamp issue.
Add JavaScript Translation Collecting to the Get Strings Command
Adapt php console.php translation:getstrings
to populate all the missing tr()
to the language.js
files.
Status: Is any volunteer working on this?
How are the language.js
files currently created and maintained?
Get rid of the special handling of punctuation
Status: Maybe @Jean-Marc Libs can have a look after the Add context to translatable strings part is working before the TikiFest (no promises).
As was discussed numerous times in TikiFests, the idea of automating the handling of punctuation has more drawbacks than benefits. Plus, it's one more confusing Tiki-specific thing to learn for translators.
/* Note for translators about translation of text ending with punctuation * * The current list of concerned punctuation can be found in 'lib/init/tra.php' * On 2009-03-02, it is: (':', '!', ';', '.', ',', '?') * For clarity, we explain here only for colons: ':' but it is the same for the rest * * Short version: it is not a problem that string "Login:" has no translation. Only "Login" needs to be translated. * * Technical justification: * If a string ending with colon needs translating (like "{tr}Login:{/tr}") * then Tiki tries to translate 'Login' and ':' separately. * This allows to have only one translation for "{tr}Login{/tr}" and "{tr}Login:{/tr}" * and it still allows to translate ":" as " :" for languages that * need it (like French) * Note: the difference is invisible but " :" has an UTF-8 non-breaking-space, not a regular space, but the UTF-8 equivalent of the HTML . * This allows correctly displaying emails and JavaScript messages, not only web pages as would happen with . */
Change our script to avoid messing up numbers
This happened more than once: https://gitlab.com/tikiwiki/tiki/-/merge_requests/2280
Storage of translations
Should we store in a DB instead of Source Control?
Backporting / forward porting
- We could encourage translators to improve translations directly on GitLab.
- And then, we periodically automatically backport translations to active branches (is strings match).