Help, I created a Polish locale for my theme but I cannot get ZP to read it.
I use Zenphoto 1.2 and the Dynamic Locale plugin (I choose "Polish" but not everything is translated).
My theme is called pp
The translation files are called pp.po and pp.mo
www.panopixel.org/zenphoto/themes/pp - my theme
www.panopixel.org/zenphoto/themes/pp/locale/pl_PL/LC_MESSAGES - pp.po and pp.mo files here
www.panopixel.org/zenphoto/zp-core/locale/pl_PL/LC_MESSAGES - zenphoto.po and .mo files here, they do not contain everything I need so I created my own theme translation file.
When I select the Polish language then ZP uses my Polish descriptions and other Polish image data I entered in the admin panel, and it uses some of the gettext() things found in the zp-core/blabla/zenphoto.mo file, but things that are not in that file are left as English in my gallery! I read the translation guide several times and checked my dir names and it all looks fine.
Example of a string that does get translated:
It gets it from the main polish translation zenphoto.mo
Example of a string that doesn't:
This one isnt in zenphoto.mo but it doesn't read my pp.mo
What did I do wrong?
Do I need to add some string to my theme image.php file to make it look for things that are missing from zp-core/blabla/zenphoto.mo in themes/pp/locale/pl_PL/LC_MESSAGES/pp.mo ?
If I get it right you want a separate translation for your theme. This feature has been added after 1.2 so you need a current nightly or svn version for that.
Please read this section of our translating tutorial: http://www.zenphoto.org/2008/05/translating-tutorial/#theme-translation
Currently undocumented you need then to add setThemeDomain("pp") (always the theme folder name) on top of each of your theme files to use the separate translation. Otherwise zp will use the main locale in zp-core and since gettext is depended on line numbers where it finds the strings it will not work then.
Btw, the same is possible with plugins (setPluginDomain()).
I did read that whole tutorial several times before doing my site, as I wrote.
"you need then to add setThemeDomain("pp") on top of each of your theme files"
You mean in index.php album.php and image.php?
I didn't know that I needed a nightly build, I will try this tomorrow, thank you very much!
[i]you need then to add setThemeDomain("pp") on top of each of your theme files"
You mean in index.php album.php and image.php?[/i]
All of them that should use it. So also search.php, archive.php and 404.php, slideshow.php if you modified it. And also don't forget any other custom page you may additionally use. Place that function before anything else (even the webpath define).
Works great!
I do have one problem though. I use zenPaypal and I cannot get the following words to use my translated versions:
Size, Stock, Matte, Gloss, Canvas, Price List, size, media, price
I created a zenPaypal.po and mo file in:
/zenphoto/zp-core/plugins/zenPaypal/locale/pl_PL/LC_MESSAGES
I also added
to the beginning of zenPaypal.php in /zp-core/plugins/zenPaypal.php
Note that those words are translated in two places:
/zenphoto/zp-core/plugins/zenPaypal/locale/pl_PL/LC_MESSAGES
and
/zenphoto/zp-core/locale/pl_PL/LC_MESSAGES
So even if the plugin didn't read its specific translation file, it should find them in the main zenphoto.po
I also tried adding
to my theme's image.php but that didnt help.
What do I need to do to fix this?
When my friend from the UK tries to view an image in my gallery, he gets this error:
Fatal error: Cannot break/continue 1 level in /home/drslony/public_html/zenphoto/zp-core/functions-i18n.php on line 286
Nobody else whom I tried my gallery with gets it.
His locale is en-GB, perhaps thats important.
This is the url I sent him:
http://www.panopixel.org/zenphoto/index.php?album=alpha&image=00000436.jpg
ps. I use the nightly build from 2008-09-17 and my zp-core/locale/ dir has only these two:
en_US
pl_PL
I deleted the other ones because I will never use them and they cluttered my "edit image" page in the admin panel. I doubt this has an influence on the error, but I'm mentioning it because you know better.
First, actually the zenpaypal translation is included within the Zenphoto's main translation files since it's an official plugin.
The items you mentioned are gettexted in around line 38 and should work.
Regarding en_GB. First I discovered that we have the none existing en_UK in our list. but that should actually not do any harm since no separate language files are for that. I am not sure but that the error you reported should actually been fixed.
You did actually everything correctly. I have no real idea now. I visited your site, could you please install the German language, so that I can check if I get any German translations for that? (I assume the dynamic locale plugin is enabled).
PS: I visited your site, you should check the size of the div in the middle, I get an ugly scrollbar in Safari 3.
Re en_GB - I expect you're seeing the same issue I reported in ticket #763 which was speedily rectified by sbillard for last night's nightly. (My personal issue is now why I was using en_GB at all, given that my server is in the US. Patriotism and curiosity now dictate that I find out how to get on to en_IE!)
I just updated zenPhoto to the latest nightly build, 2008-09-17
Acrylian: "PS: I visited your site, you should check the size of the div in the middle, I get an ugly scrollbar in Safari 3."
Yes I found this too even in Firefox, no idea why since before the update of Zenphoto I didn't have this, and I just copied my theme to the new ZP nightly build... perhaps I edited some css file not in my theme dir as well. I will fix this when the translations work properly.
"First, actually the zenpaypal translation is included within the Zenphoto's main translation files since it's an official plugin. The items you mentioned are gettexted in around line 38 and should work."
Hmm, so those translations are in two places:
zenphoto.po
zenPaypal.po
I deleted "" from zenPhoto.php (reason below).
If I add "" to my image.php then the following get translated:
My custom info text at the bottom of the page and my strings about comments, so all things found in image.php. zenPaypal things do not.
If I delete "" from image.php then the following get translated:
Media, size, material, price.
I obviously need my theme to use several translation files at the same time - pp.po with my own theme polish text translations, the main zenphoto.po with general polish translations, and zenPaypal.po with zenPaypal's "media canvas gloss etc" translations. How do I get my theme to use them at the same time?
Note that I deleted "" because it didn't add any new translations, and in fact without it the word "Media" got translated, with it it didn't.
Also when I ran zenPaypal.php through Poedit I didnt find the word "Gloss", only "Glossy", but on my page the word "Gloss" is used... where does zenPaypal get its strings form then?
Screenshots:
1- setThemeDomain("pp"); OFF (ie. not there) http://bayimg.com/image/oakocaabi.jpg
2- setThemeDomain("pp"); ON http://bayimg.com/image/oakodaabi.jpg
in both cases setPluginDomain("zenPhoto"); in zenPhoto.php was 'off'
"could you please install the German language, so that I can check if I get any German translations for that?"
done
jlang: how do I find ticket 763? I tried adding 763 to ?id= but that didnt point me to the right ticket.
I don't think there's any information of value for you on this particular ticket, but the ticket is an entry on the Trac issue tracker for Zenphoto:
http://www.zenphoto.org/trac/ticket/763
This is seperate from the support forum software.
[i] deleted "" from zenPhoto.php (reason below).[/i]
I actually don't understand what that is. There is no plugin "zenphoto". This can't work. If you were trying to get the main translation, that is done automatically. Nothings needs to be added manually.
May I ask how you generated the po file for your theme. Just to be sure, you need to set up Poedit to only parse the folder of your theme.
Sorry, I never used this plugin myself, but maybe I have an idea: You probably added you custom price list in the text field in the options, right? These will not be gettexted because they have already been printed. Gettext translations happens before printing. This way they are printed directly as they are stored in the db. To be gettexted you need to change the array directly in the zenPayPal.php plugin file. We probably need to turn the field into a multilanguage field.
Argh! it was supposed to be setPluginDomain("zenPaypal");... all those zen's mixed me up, typo.
You are right, this is my zenPaypal pricelist:
40x30cm:Matte=40 40x30cm:Gloss=40 40x30cm:Canvas=90 60x40cm:Matte=90 60x40cm:Gloss=90 60x40cm:Canvas=160 90x60cm:Matte=180 90x60cm:Gloss=180 90x60cm:Canvas=300
The pp.po file for my theme was made using only my theme files:
/home/drslony/.poedit/pp/album.php
/home/drslony/.poedit/pp/image.php
/home/drslony/.poedit/pp/index.php
/home/drslony/.poedit/pp/theme-functions.php
/home/drslony/.poedit/pp/theme_description.php
I don't have any problems with that pp.po file.
The zenphoto.po file I made using the latest nightly build, I downloaded the outdated incomplete polish translation, i set it to use the zp-core dir and I ran 'update from sources'. Then I made sure that words like "size", "Size", "Stock", "Price List" etc. are all translated.
But the problem with my translation still exists:
Several of the words EXIST in http://www.panopixel.org/zenphoto/zp-core/locale/pl_PL/LC_MESSAGES/zenphoto.po
Zenphoto DOESNT translate them... Why?
So again: The question is did you modify your pricelist in the plugin file zenpaypal.php itself or within the options? Because whatever you enter in those admin fields will not be translated. It does currently only work if the list is gettext in the plugin itself before being printed in the field. I hope that does help for now.
acrylian the price list is not the point, the "canvas" "matte" "gloss" issue is resolved, I understand that it shows whatever I entered in the admin panel. If you look again at my gallery (image.php) I changed it a bit so its displayed in both languages at once.
I wrote that still things like "size" "stock" "price list" etc are not translated. See this screenshot: http://bayimg.com/image/lakpfaabi.jpg
They ARE gettext if you look at the zenPaypal.php file (e.g. lines 185, 196, 197, 198), and as I wrote, I DID translate them in zenphoto.po.
Because that didn't work, I ALSO made a zenPaypal.po file where I again translated those things and I tried adding so zenPaypal.php but that didn't help.
Thank you.
How do I get that image.php to use two po files?
I need to use zenphoto.po for the translation of things like "Price List" "media" "stock" etc (all the things marked by lines in the screenshot).
I need to use pp.po for things like that long text at the bottom, and "no comments", "write a comment".