gambitph / Titan-Framework

The easiest to use WordPress option framework.
http://www.titanframework.net
377 stars 137 forks source link

Options Multilanguage support (WPML) #355

Closed ArchimidisM closed 8 years ago

ArchimidisM commented 8 years ago

Thanks a lot for this great plugin. However I have a question. I have 2 text fields in my options page, which I would like to translate their outputs using the WPML plugin.

For example the WPML provides some documentation to translate extra options here https://wpml.org/documentation/support/language-configuration-files/ But I am not sure whether that is applicable to the TitanFramework.

Are the option values multilanguage support or not? Thanks again for this great plugin.

ReggieDuran commented 8 years ago

Good day @ArchimidisM. Titan option values doesn't support multi-language.

ArchimidisM commented 8 years ago

Thanks a lot for your answer.

Lugat commented 6 years ago

I'm simply extending Titan and overwriting the getInstance method to make it work with WMPL

  abstract class Titan extends \TitanFramework
  {

    public static function getInstance($optionNamespace)
    {

      if (defined('ICL_LANGUAGE_CODE')) {
        $optionNamespace .= '_'.ICL_LANGUAGE_CODE;
      }

      return parent::getInstance($optionNamespace);

    }

  }