jDiction Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

jDiction 2.2.0 released. http://jdiction.org/downloads

Author Topic: Problem with "ISOCODE for the language"  (Read 2666 times)

support3

  • Newbie
  • *
  • Posts: 1
    • View Profile
Problem with "ISOCODE for the language"
« on: September 06, 2012, 12:16:49 pm »

Hi all,

On the Doc. in the website, it says:
Quote
"URL Language Code" and the "Image Prefix" are the first 2 letters of the ISOCODE for the language.

Because some of the language has the same ISOCODE in the first 2 letters.
eg.
For Chinese, it has Traditional Chinese and Simplified Chinese
They are "zh-TW" and "zh-CN".
It will cause a URL problem when switching the language with the module jdlanguage.

I have simply modified the code to fix the URL problem.

In "mod_jdlanguage.php" line 22 found:
Code: [Select]
list($lang->link, $lang->menutitle) = modJdLanguageHelper::getLink($lang->lang_code);Replace to:
Code: [Select]
list($lang->link, $lang->menutitle) = modJdLanguageHelper::getLink($lang->lang_code,$lang->image);
In "helper.php" line 18 found:
Code: [Select]
public static function getLink($target) {Replace to:
Code: [Select]
public static function getLink($target,$image) {Then, in line 42 found
Code: [Select]
$link = substr($target, 0, 2).'/';Replace to
Code: [Select]
$link = $image.'/';
p.s. All of the above is talking about "jDiction 0.7"

Hope it will help someone and sorry for my poor English. :)
Logged

Harald Leithner

  • Administrator
  • Hero Member
  • *****
  • Posts: 1642
    • View Profile
Re: Problem with "ISOCODE for the language"
« Reply #1 on: September 06, 2012, 12:41:59 pm »

Thx,

and you are right using the first 2 characters of lang_code is a bad idea, I changed it to "URL Language Code" that should be the correct one.

Fix will be in 0.8
Logged

Harald Leithner

  • Administrator
  • Hero Member
  • *****
  • Posts: 1642
    • View Profile
Re: Problem with "ISOCODE for the language"
« Reply #2 on: September 06, 2012, 02:39:15 pm »

Fixed in 0.7.9.3, ready for testing at http://jdiction.org/de/downloads
Logged