Translation
(16 posts) (5 voices)-
How do you translate the plugin? Noticed that the plugin is preped for this? Anyway to get a mo/pofile?Posted 3 years ago #
-
If you have any experience in translating the plugin, could you tell me how? I have written quite a few plugins - but as of yet no one has offered to translate any of them. I have used the __() and _e() in all the printed english text - now how do I create the po file?Posted 3 years ago #
-
First; Great plugin.

Second: Pardon my english, I'm from sweden
I'm no expert in this subject but I think I somehow managed it.
There is some info here: http://codex.wordpress.org/Translating_WordPress
In eventr.php right after require_once('wpframe.php'); I put
load_plugin_textdomain('eventr', 'wp-content/plugins/eventr');
(or load_plugin_textdomain('eventr', 'wp-content/plugins/eventr/lang');
if you want the lang-files in separate folder )
then to the mo po pot -creation, and I don't think this is the best way to do it but it worked for me.
"Borrowed" a pot-file from another plugin and opened it up in a text-editor, and del the content. Then I'll started add some of the translation strings. This is eventr.pot (some original translation file)
You can then open it up in poedit and start translate it.
When you save the file it produces a mo-file that should be marked the same as your settings in wp-config.php in my case, as I'm swedish, eventr-sv_SE.mo. You put this file in the same dir as plugin.
Then it should work. The big part is to create a pot-file with all the translations. I can provide a swedish translation.
Hope I made some sense and perhaps the just started pot-file (attached) can clearify something.
Posted 3 years ago # -
In eventr.php right after require_once('wpframe.php'); I put
load_plugin_textdomain('eventr', 'wp-content/plugins/eventr');
(or load_plugin_textdomain('eventr', 'wp-content/plugins/eventr/lang');
if you want the lang-files in separate folder )
Actually, this is already done - line 28...
/// Initialize this plugin. Called by 'init' hook.
add_action('init', 'eventr_init');
function eventr_init() {
load_plugin_textdomain($GLOBALS['wpframe_plugin_name'], 'wp-content/plugins' );
}
I'll change 'wp-content/plugins' to 'wp-content/plugins/eventr/lang'. Make that change in your code to.
And I found a tool to automatically generate the POT file - its an application called poedit. You can use it to edit PO files as well. I know its available in Linux - I am not sure about windows platform. Anyway, I have created a complete PO file using it. I have attached it. Let me know if you need anything else.Posted 3 years ago # -
D**n ...

That's nice, tnx a lot..
Posted 3 years ago # -
hi,
I cant get this to work... I've tried all suggestions in the thread and still no luck.
I've placed the files in the lang folder and changed the 28th line in the eventr.php file. -Suggestions?
Is this something that uses MySQL5?
If you want it, I've done a complete translation to Swedish, just let me know.
Thanks, // EmilPosted 2 years ago # -
**Use the updated Swedish translation down below**
Here is the Swedish translation if someone else needs it.
If you get it to work, pls reply to me and explain how you did.
Cheers, //E.Posted 2 years ago # -
Got it to work (finally) the languagefiles should be named with the plugin name in front of the lang code.
IE: eventr-sv_SE.mo for swedish
Cheers, //E.Posted 2 years ago # -
Updated Swedish Translation.
Instruction:
1.) unzip to "wp-content/plugins/eventr/lang" (create 'lang' folder if not present)
2.) open eventr.php and change on line 28load_plugin_textdomain($GLOBALS['wpframe_plugin_name'], 'wp-content/plugins' );
toload_plugin_textdomain($GLOBALS['wpframe_plugin_name'], 'wp-content/plugins/eventr/lang' );
3.) make sure that the language code in your wp-config.php file matched the language code in the eventr language files.
(except for the initial 'eventr-' part)Posted 2 years ago # -
Thanks! I'll add this to the next release of Eventr. I want to give credit to you for doing this in the Eventr page - do you have a site I can link to?Posted 2 years ago #
-
Posted 2 years ago #
-
Hi,
I found a string that isn't in the pot/po/mo files..
When someone registers theres a message saying:
'Emil' has been added to the attendee list for event XXX.
Thank you.
Can you add support for it?
ThanksPosted 2 years ago # -
Done. This fix will be added in the next release. I have attached the changed files - if you need them.Posted 2 years ago #
-
Hi,
I used Wordpress 2.9 Fr and Eventr 1.02.1 (+survey 1.01.5 to be completed).
I follow everything described above to have the eventr-fr_FR.po working (even using the translation of Emilie Caudoux) but it is not working, always the English version is loaded.With the previous version of eventr (1.02.0), it is working, the text is in French when the form is displayed in a post but in this case, I got an error message with survey :
Fatal error: Cannot redeclare t() (previously declared in /homez.64/obj/www/blog/wp-content/plugins/eventr/wpframe.php:42) in /homez.64/obj/www/blog/wp-content/plugins/surveys/wpframe.php on line 46
For more detail, I also report this problem in the survey forum : " pb using surveys and eventr in th same blog(3 posts) (1 voice)".Could you help me. Thanks in advance and my best wishes for 2010
Pierre Foulart (from Belgium)
Posted 2 years ago # -
***This is an update of my previous post after a few debugging tests and changes***
My current Wordpress version is the latest one ie version 2.9.1 FRIf I use eventr 1.02.0 with a french translation, it is working fine for this plugin except that I got a problem with the survey plugin (described in survey blog).
If I upgrade to eventr 1.02.01 (with the Fr translation made By Emilie Cadoux), the translation is not loaded : form, etc are still in EN. I also verified the enventr-fr_FR.po with poedit and made some changes, Same thing.
Path for lang are ok ie translation files in wp-content/plugins/eventr/lang and also lines in eventr.php correctly set.
Do you think the new wordpress version can be the cause of the problem ?.
some additional information : I also use the latest survey plugin and made a FR tanslation ... but same behaviour, the translation is not 'laoded'
Thanks again for your help, I very much appreciate this two very useful plugins but my reader are mainly French mother tongue
Pierre
Posted 2 years ago # -
I've solved my problem by adding this line to the eventr.php:
require_once('wpframe.php');After adding it the translation started to work.
Thanks to Chodorowicz, see his post : Two bugs/problems and polish translation
Pierre
Posted 2 years ago #
Reply
You must log in to post.