ZenphotoCMS Forum
How to get gallery descriptions etc. in other languages? - 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: How to get gallery descriptions etc. in other languages? (/thread-8548.html)



How to get gallery descriptions etc. in other languages? - Guest - 2011-04-26

The user and all related content has been deleted.




How to get gallery descriptions etc. in other languages? - acrylian - 2011-04-26

Did you try the html meta tag plugin? That should do it automatically (I think...). If you need to do it manually use this:
http://www.zenphoto.org/documentation/core/_functions-i18n.php.html#functionget_language_string

But you need to use $_zp_gallery->get('desc') as all functions already get the language of the visitor or what the site is set to.




How to get gallery descriptions etc. in other languages? - Guest - 2011-04-26

The user and all related content has been deleted.




How to get gallery descriptions etc. in other languages? - acrylian - 2011-04-26

See my addition that I added while you answered..;-)




How to get gallery descriptions etc. in other languages? - Guest - 2011-04-26

The user and all related content has been deleted.




How to get gallery descriptions etc. in other languages? - acrylian - 2011-04-27

Sorry, that happens if you write from memory. It is of course:
echo get_language_string(getOption('Gallery_description'))

The gallery is outside thte other classe, but the way described will work for all others like images, albums, Zenpage items.




How to get gallery descriptions etc. in other languages? - Guest - 2011-04-27

The user and all related content has been deleted.




How to get gallery descriptions etc. in other languages? - sbillard - 2011-04-29

Well, the gallery is indeed a complete object, and has the description method. It is just that there is no database table associated with the gallery object.

All Zenphoto objects contain the method $obj->getDesc() which will return the description in the current language (assuming the site is multi-lingual). [Well, maybe not all, but all for which a description makes sense.]

The $obj->get(item) method should almost never be used. It directly fetches the database table element for the [i]item[/i] column. This bypasses any method algorithms (like selecting the current language from the description element.)