ZenphotoCMS Forum
how to : use a specific translation in codeblock - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: how to : use a specific translation in codeblock (/thread-13191.html)



how to : use a specific translation in codeblock - vincent3569 - 2018-12-19

hi
in the codeblock 2 of a page, I have this code



this blockcode is called by a macro `[CODEBLOCK 2]` in the page ExtraContent.

I add this specific translation in a extra file of my theme, and so, the string is translated in my po and mo files.

but it doesn't work and my string remains in english as my locale is french.
what's is the matter?



how to : use a specific translation in codeblock - acrylian - 2018-12-19

Technically the codeblock is not within the theme as it is a core funciton. I have never tried this use case. Perhaps the theme based translation is not yet loaded when the codeblock is executed. It should use the current theme but try to set it specifially as the 2nd parameter.




how to : use a specific translation in codeblock - vincent3569 - 2018-12-28

hi, in fact it works well.
my mistake was about having multiple website and forgot one update.

next step for me : having a plugin for specific translations to avoid have it in my theme translations.




how to : use a specific translation in codeblock - acrylian - 2018-12-28

Thanks for the feedback. Know the problem with several sites Sure, you should be able to create a simple basically functionless plugin which just consists of strings to translate. However if these strings are still site/theme related they should be in the theme IMHO.