Keyword
Please note that official support for commercial extensions & templates is provided in the Subscriber Help Desk.
Support requests should ONLY be directed there and require an active subscription plan.
This forum board is to be used for archive purposes and knowledge exchange ONLY.

Multilanguage captions Hack

  • gtherm
  • gtherm's Avatar Topic Author
  • Offline
  • New Member
More
16 years 9 months ago - 15 years 8 months ago #12447 by gtherm
Multilanguage captions Hack was created by gtherm
Warning this is experimental as I'm absolutly not a coder, so use it with caution    and don't expect from me any kind of support.

To display multi-language captions do this :

-Open plugin_jw_sigpro.php, backup it up.
-Locate //read labels.txt
-Replace
        if (file_exists($mosConfig_absolute_path.$rootfolder.$_images_dir_."/labels.txt") && is_readable ($mosConfig_absolute_path.$rootfolder.$_images_dir_."/labels.txt")) {        
          
          $file_handle = fopen($mosConfig_absolute_path.$rootfolder.$_images_dir_."/labels.txt", "r");
With :
        if (file_exists($mosConfig_absolute_path.$rootfolder.$_images_dir_."/".strtolower($mosConfig_lang)."_labels.txt") && is_readable ($mosConfig_absolute_path.$rootfolder.$_images_dir_."/".strtolower($mosConfig_lang)."_labels.txt")) {        
          
          $file_handle = fopen($mosConfig_absolute_path.$rootfolder.$_images_dir_."/".strtolower($mosConfig_lang)."_labels.txt", "r");
-Create labels textfiles named yourlanguage_labels.txt
ie: french_labels.txt, russian_labels.txt, chinese_labels.txt etc ...
-Put your captions as usual in the text files
The topic has been locked.
More
16 years 4 months ago #12448 by Raven_3_
Replied by Raven_3_ on topic Re: Multilanguage captions Hack
To get this hack work in J! 1.5 also do this:

insert the following lines in the onPrepareContent-function (in the same file):
$params   = JComponentHelper::getParams('com_languages');
$frontend_lang = $params->get('site', 'en-GB');
$language = JLanguage::getInstance($frontend_lang);
$mosConfig_lang = $language->getBackwardLang();

works good for me so far.

regards
The topic has been locked.
More
16 years 3 months ago #12449 by Raven_3_
Replied by Raven_3_ on topic Re: Multilanguage captions Hack
the posted code-lines from me aren't work with JoomFish (in Joomla! 1.5.x only).
so there's the hack to get this work. Just this line instead the lines posted from me:
$mosConfig_lang = $mainframe->getCfg('language');

this will produce "language-codes" like de-DE (for german), en-GB (for english), etc.
consider this when naming the lable textfiles.

e.g. name the textfile like this: en-gb_labels.txt when using the strtolower()-function as posted by gtherm.

regards
The topic has been locked.
More
16 years 2 months ago #12450 by brunoazevedo
Replied by brunoazevedo on topic Re: Multilanguage captions Hack
Hi, gtherm and Raven_3_,

Thanks for yours topic.

Working perfect, but, in the end of the text it appears a slash "\" and in last image appears a "}".

Can i fix this?

Yhanks!

Bruno Azevedo
The topic has been locked.
More
16 years 2 months ago #12451 by brunoazevedo
Replied by brunoazevedo on topic Re: Multilanguage captions Hack
Hi All,

RESOLVED! :)

Whem you create the TEXT file, save only .TXT.

My error was saved in .RTF Format and them .TXT format because this file creat some meta tags.

Thanks!
Bruno Azevedo
The topic has been locked.

Powered by Kunena Forum