You can clone with
HTTPS or Subversion.
There is still work to make piwik fully translatable.
We have to all strings
(In 390) – fix #5563
- refs #5482: started work, prepared Piwik_Translate, the smarty modifier, translated the Login plugin in french & english as a use case
- fixed redirection bug in safari
Theres are problems with:
Submitted patch introduces translation strings in templates.
Some things to discusss:
Attachment: Merged changes with current (409) revision
Attachment: i18n.patch + some example approach for JS translation (see more in comment)
If you use text strings in your plugin:
1) put in Controller:
2) whenever you use string make it translate-friendly:
you can also use some popular translations from ‘General’ module:
3) in php translation files define your variable keys as:
‘yourPluginName_stringIdentificator_js’ => ‘string/message translation’
so the translation team will know which strings should be translated
Example of working code is in SitesManager plugin.
NB: When there are more than one value to be sprintf (should be very rare) we should number the %s, ie
$format = ‘The %2$s contains %1$d monkeys’;
Because in different languages numbers orders can be swapped in the sentence.
if( !$moduleList )
if( !$moduleList )
anyway this is good work in progress :) i hope this review is useful.
I made several modifications,
ps. I couldn’t find any translation that was done without format strings, but maybe I missed sth?
Attachment: current i18n patch (compatible with rev 424)
Attachment: compatible with rev 432
PS. somehow you managed to break trac html filter (everything in bold now) ;>
it seems you haven’t added the right patch (the patch is still the same).
whats needs to be done in order to have a working i18n version of piwik?
we have to think of the Plugin that we have to write to make it easy to translate piwik, through a simple web interface that would
NB: we have to make sure that all exceptions thrown before the language files are loaded are ONLY thrown in ENGLISH and that the text is hardcoded in the source files.
—> how to make sure all these exceptions are hardcoded?
Attachment: right patch
PS. I attached the right patch :)
‘’’ * agree, please create a new ticket with your specification
Just several quick comments and issues to discuss.
Message translation cannot be done in Piwik_Exception class, because getMessage() method is not overridable. I will check for translations in Piwik_ExceptionHandler.
We certainly need definitions in translation files, so the only way is not to put default string in js code, and by default load english strings.
3. Column labels.
Attachment: TranslateException, translation strings for exceptions in plugins/
Attachment: solves also #65 and #116
Some quick remarks on last patch:
Idea for columns translations interface:
in Controller.php add
$view = Piwik_ViewDataTable::factory();
$view→setColumnsToDisplay( array(‘label’,‘nb_visits’) );
or maybe even better assigning translated string:
Then change modules/ViewDataTable so they pass translated strings values to templates (if translation does exist, in other case translated string = column name).
And change templates so instead of column names display translated labels.
I tried to find a place where it can break widgets (e.g. sorting, paging) but didn’t find anything… maybe I haven’t noticed sth?
(In [[mauser](447]))- refs #5482 commited huge work by Maciej Zawadzi?\197?\132ski: thanks! still some work to do + QA but looks really good :)
[mauser]- refs #5536 commited partial fix
[mauser]- refs #5485 commited partial fix
- fixed broken tests
feedback on the submitted patch
And if the dev doesn’t care about translations he would simply use hardcoded strings in his JS files…
Status of german translation is nearly 80%. (i would note it here, so that nobody else started to translate) :)
Attachment: _pk_translation without default strings, fix in Visitors→Overview view
German languages files for avaiable plugins attached – pls integrate into svn.
Attachment: german language files
Attachment: fixes #62, #65, #116 and adds german translations
(In [[mauser](454])) – fixes #5536, font consistent, escape key now works
[mauser] – fixes #5485, now catching error, printing friendly message, refactoring template code
[mauser] – fixes #5482, fixing JS translations api, Piwik is now ready to be translated!!! :)
We must add the information of the translators in the main translation files.
Support for right-to-left languages:
Please, let’s leave this ticket, the first part of the plan has been implemented.
We are now working on part 2, see #5671