I’ve a question about the possibility to translate strings in any plugin. I’m not sure if:
there is a way to translate the strings witouth to edit the plugins files
in case the files should be edited, what method should i use? I mean i tried changing de string by l::get method but nothing is showing.
I appreciate any help.
Thank you so much!
December 21, 2016, 6:15pm
You mean when using an existing plugin?
I’m using the revisions plugin but my interface is set in french and spanish, so i would like to translate the plugin’s strings that appear in the panel.
Is this possible?
December 21, 2016, 8:01pm
It can be done, but it’s a bit of work and you would have to modify the plugin directly. I think there are two options: defining the translations in the config.php, or add the translations to the plugin via a translation function.
Is there any doc to learn how to do both things?
I tried to use l::get as in the rest of the templates strings, but didn’t work. Are you talking about another translation function?
December 21, 2016, 9:58pm
You may want to have a look at my logger plugin. I provides a helper function in helpers.php:
https://github.com/texnixe/kirby-logger/blob/master/lib/helpers.php and a translation file https://github.com/texnixe/kirby-logger/blob/master/lib/translations.php. Instead of using the translation file, you can also fall back to settings in your config.php, see the readme.
https://github.com/texnixe/kirby-logger/blob/master/views/index.php you can see how this function is used.
January 6, 2017, 4:07pm
@texnixe great plugin. did same thing once but way simple. what i found useful is to store a githash of the content file too so it can be used to track changes using autogit plugin.
$githash = sha1("blob ".