Loading...
 
Skip to main content

History: How to manage string localization in JS files

Source of version: 4 (current)

Copy to clipboard
{REMARKSBOX(type="warning" title="Warning")}All information for end users to be able to translate should be in a workspace on tiki.org{REMARKSBOX}

Tiki has a very simple system to localize strings in Javascript files.

A string in a JS file should be encapsulated with -+tr()+- function to be translatable. Then someone has to manually add this string to -+lang/xx/language.js+- to be able to translate it.

This page is to discuss how to improve the current system so that we can:
* Automatically collect translatable strings from JS files (presumably using -+get_strings.php+-)
* Integrate JS strings with PHP and Smarty strings to avoid translation duplication and use available tools like i18n.tiki.org and i18n.tiki.org/stats

!! Related links
* https://github.com/airbnb/polyglot.js

!! Aliases
* (alias(Translate Javascript))
Show PHP error messages