2 edb Feb 14, 2008 05:18

3 easy steps
- rename de_DE or fr_FR directory in /locale to the one you need (ru_RU)
- replace an existing .po file with yours
- run built-in script from Global settings -> Regional to extract it
Okay cool. I saw that on the localization page in the manual but didn't know it would work for plugins. Kinda thought it was only for the program itself.
Thanks!
As far as I know the backend localization page does not work for plugins.
Please refer to http://manual.b2evolution.net/Localization#Plugins for instructions.
All translations I sent to you guys were generated this way. ;) And they all work
sam2kb, but then you probalby haven't translated 3rd party plugins, I guess.. :)
I think he did because he sent me a ru_RU folder (with _global.php and the other folder with messages.po) for my creative commons plugin. In truth I simply suspect it works because I have no idea how to test it.
Maybe it's an undocumented feature :)
Here is a post with 3 translated plugins
If you wanna test it on your system just change the lang in your browser to RU
sam2kb, sorry. Of course it was you that send me to this thread even.. so I should have known that it works and looked closer at the method.. :)
It's quite hackish though.. maybe there should be some upload script to generate the file in the locales tools tab.. :)
I finally found a solution.
If you want to create a POT file in Windows, download the following archives and unzip them in one folder, name it gettext.
http://ftp.gnu.org/gnu/gettext/gettext-runtime-0.13.1.bin.woe32.zip
http://ftp.gnu.org/gnu/gettext/gettext-tools-0.13.1.bin.woe32.zip
Open a command prompt and navigate to the bin folder
cd c:\gettext\bin
Run this command to extract translatable strings from c:\file.php
xgettext.exe --no-wrap --add-comments=TRANS --copyright-holder="Francois PLANQUE" --msgid-bugs-address=http://fplanque.net/ --output=c:\messages.pot --keyword=T_ --keyword=NT_ --keyword=TS_ c:\file.php
You should now see a messages.pot in c:\
sam2kb, another way to get the "good tools" on windows is installing cygwin (http://www.cygwin.com/), which provides a lot of useful GNU tools.
This is a must-have on windows IMHO.
btw: you should be able to use the /gettext/xg.php script from b2evo with the "extract" option (then).
sam2kb wrote:
I finally found a solution.
If you want to create a POT file in Windows, download the following archives and unzip them in one folder, name it gettext.http://ftp.gnu.org/gnu/gettext/gettext-runtime-0.13.1.bin.woe32.zip
http://ftp.gnu.org/gnu/gettext/gettext-tools-0.13.1.bin.woe32.zipOpen a command prompt and navigate to the bin folder
cd c:\gettext\binRun this command to extract translatable strings from c:\file.php
xgettext.exe --no-wrap --add-comments=TRANS --copyright-holder="Francois PLANQUE" --msgid-bugs-address=http://fplanque.net/ --output=c:\messages.pot --keyword=T_ --keyword=NT_ --keyword=TS_ c:\file.php
You should now see a messages.pot in c:\
I followed your very simply instructions but i get an error saying:
This application has failed to start because iconv.dll was not found.
Re-installing the application may fix this problem.
I thought maybe adding the c:\gettext\bin folder to system variables might help but it didn't. :roll:
Try this one: http://gnuwin32.sourceforge.net/downlinks/gettext.php
If you have Poedit installed, try this.
Create a *.bat file with the following content.
Run the file in plugin/skin folder, it creates a list of all *.php files and extracts strings from them, then it creates locale directories with initial content.
@echo off
echo Generate file list.
dir /b /s *.php > %TMP%/files.txt
echo Create locales folder.
mkdir locales locales\ru_RU locales\ru_RU\LC_MESSAGES
echo Extract strings.
"C:\Program Files\Poedit\bin\xgettext.exe" -f %TMP%/files.txt --no-wrap --add-comments=TRANS --copyright-holder="Francois PLANQUE" --msgid-bugs-address=http://fplanque.net/ --output=locales\messages.pot --keyword=T_ --keyword=NT_ --keyword=TS_
echo Copy initial messages.po file
copy locales\messages.pot locales\ru_RU\LC_MESSAGES\messages.po
echo Create blank _global.php
echo qwerty> locales\ru_RU\_global.php
If locale directories already created you should run this *.bat instead
@echo off
echo Generate file list.
dir /b /s *.php > %TMP%/files.txt
echo Extract strings.
"C:\Program Files\Poedit\bin\xgettext.exe" -f %TMP%/files.txt --no-wrap --add-comments=TRANS --copyright-holder="Francois PLANQUE" --msgid-bugs-address=http://fplanque.net/ --output=locales\messages.pot --keyword=T_ --keyword=NT_ --keyword=TS_
--copyright-holder="Francois PLANQUE" --msgid-bugs-address=http://fplanque.net/
That part is only good if you happen to be Francois and your web site is fplanque.net ;) Other than that, this .bat is how I make message.pot files for my plugins.
:>>
Hey Blueyed.
This is Jenny Newbie here, the plug-in files can not be easily modified from php to other format, as they ae inbuilt specified. The information about B2evolution is very important for this issue. Thank you for giving me information.
Jenny, I do not understand your problem neither your question. Please elaborate.
That is very good the know. Thanks for sharing
Jess
Good!It is very useful,thank you for sharing the post.
In addition it'd be cool to know how to turn a messages.po into a matching _global.php without doing it by hand.