Changeset 5232


Ignore:
Timestamp:
Mar 21, 2010, 10:16:56 PM (11 years ago)
Author:
grum
Message:

fix bug : character encoding was wrong if there was no key to translate

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AMetaData/JpegMetaData/Common/L10n.class.php

    r4705 r5232  
    103103   *
    104104   * @param String $language : the language
     105   * @param String $charset  : charset encoding (UTF-8)
    105106   * @return String : the defined language
    106107   */
    107   static function setLanguage($language="en_UK")
     108  static function setLanguage($language="en_UK", $charset="UTF-8")
    108109  {
    109110    global $supported_locales;
     
    146147    T_bindtextdomain(self::JMD_TAGDESC, dirname(dirname(__FILE__))."/Locale");
    147148
     149    /*
     150     * set the charsets
     151     */
     152    if($charset!="")
     153    {
     154      T_bind_textdomain_codeset(self::JMD_TAG, $charset);
     155      T_bind_textdomain_codeset(self::JMD_TAGDESC, $charset);
     156    }
     157
    148158    return(self::$language);
    149159  }
     
    166176  static function get($key)
    167177  {
     178    T_textdomain(self::JMD_TAG);
    168179    return(@T_dgettext(self::JMD_TAG, $key));
    169180  }
     
    176187  static function getDesc($tagName)
    177188  {
     189    T_textdomain(self::JMD_TAGDESC);
    178190    return(@T_dgettext(self::JMD_TAGDESC, $tagName));
    179191  }
Note: See TracChangeset for help on using the changeset viewer.