![]() |
|
plugin for personnal translation - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: Translating (https://forum.zenphoto.org/forum-8.html) +--- Thread: plugin for personnal translation (/thread-13059.html) |
plugin for personnal translation - vincent3569 - 22-09-2017 hi can you explain what the general structure of this plugin have to be ? plugin for personnal translation - acrylian - 22-09-2017 I am sorry, I don't fully understand what this plugin is meant to do. If you are talking about extra translation/strong for your theme that are not part of the theme by default, you need to use an extended theme base translation. That's just the theme translation just with your custom additions. You get those easily by parsing it using Poedit again. Or do you want to put these extra strings into a separate plugin? That would be possible of course although I think that overcomplicates things. In that case you would have just to create a plugin based translation. plugin for personnal translation - vincent3569 - 22-09-2017 yes I have extra translations for my themes and I know how it works. In my case, I want extra translations for my content (i.e for using in blockcode). can you point me i the right direction? plugin for personnal translation - vincent3569 - 22-09-2017 fyi, this news have a wrong link : http://www.zenphoto.org/news/zenphoto-plugin-architecture-documented/ http://www.zenphoto.org/2008/04/zenphoto-plugin-architecture/ doesn't exist (but there is this link : http://www.zenphoto.org/news/zenphoto-plugin-architecture/) plugin for personnal translation - acrylian - 22-09-2017 That post is from 2008 when we used WordPress. Of course the link is broken now, we don't go through all … But you found it anyway… A plugn does not need to have a admin interface. Just put a function with strings or just an array within it that contains the gettexted strings to translated. Then create a plugin based translation and use calls of the function or array in your theme. Instead of using codeblocks extensively I would recommend maybe to use the multiplelayout plugins or theme based custom functions. Codeblocks are nice for quick things but you easily forget what you used where..… Use codeblock only when really necessary. plugin for personnal translation - vincent3569 - 22-09-2017 I read the documentation before asking my question :-) what do mean by
can you give me a dummy example? plugin for personnal translation - vincent3569 - 22-09-2017 basically, my plugin have this structure: ` ` it's ok for you? plugin for personnal translation - acrylian - 22-09-2017 That would be like I had in mind. So like this: function getTranslatedString($index) { $firststring = getTranslatedString(1); And for more flexibility maybe add: function printTranslatedString($index) { I also would recommend to use a class with static methods as a wrapper so your plugin will avoid possibly naming conflicts. class vincentsStrings { //best match the plugin name somehow static getString($index) { } $firststring = vincentsStrings::getString(1); |