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.
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).
I don't know what I have to create in that plugin based translation (no admin interface, only some string to translate with gettext_pl().
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.
That would be like I had in mind. translated_strings() would better be named getTranslatedString() (we generally use camel case in Zenphoto in case you want to follow that writing). and get a parameter to access a specific strings since you want to use this on your theme.
Comments
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.
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).
I don't know what I have to create in that plugin based translation (no admin interface, only some string to translate with gettext_pl().
can you point me i the right direction?
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/)
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.
I read the documentation before asking my question :-)
what do mean by
can you give me a dummy example?
basically, my plugin have this structure:
<?php /** * Plugin pour gérer les traductions personnelles de mon site, indépendament des thèmes utilisés. * * @package plugins * @subpackage seo */ $plugin_is_filter = 9|THEME_PLUGIN; $plugin_description = gettext_pl('Plugin to manage personnal translations of my site.', 'translations'); $plugin_author = "Vincent Bourganel (vincent3569)"; $plugin_version = '1.0'; function translated_strings() { $strings = array( gettext_pl('Hello World!', 'translations'), gettext_pl('Hello World, again!', 'translations') ); } ?>
it's ok for you?
with that, I can access to translated string in my pages/news where needed?
That would be like I had in mind.
translated_strings()
would better be namedgetTranslatedString()
(we generally use camel case in Zenphoto in case you want to follow that writing). and get a parameter to access a specific strings since you want to use this on your theme.So like this:
And for more flexibility maybe add:
I also would recommend to use a class with static methods as a wrapper so your plugin will avoid possibly naming conflicts.