How to get gallery descriptions etc. in other languages?

The user and all related content has been deleted.

Comments

  • acrylian Administrator, Developer
    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.
  • The user and all related content has been deleted.
  • acrylian Administrator, Developer
    See my addition that I added while you answered..;-)
  • The user and all related content has been deleted.
  • acrylian Administrator, Developer
    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.
  • The user and all related content has been deleted.
  • 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 item column. This bypasses any method algorithms (like selecting the current language from the description element.)
Sign In or Register to comment.