Elxis CMS Forum

Extensions => Bots and plugins => Topic started by: chongbing on October 12, 2015, 02:18:26

Title: How to set a default value in the contact form of country field by languages ?
Post by: chongbing on October 12, 2015, 02:18:26
Hi datahell,

How to set a default value in the contact form of country field by languages ?  Such as,

Contact form
English:
Country -> United States

Simplified Chinese:
Country -> China

Traditional Chinese:
Country -> Taiwan

Many thanks,
Title: Re: How to set a default value in the contact form of country field by languages ?
Post by: datahell on October 12, 2015, 11:15:03
Contact form already works like that...

It uses the REGION information of Elxis language database file. English language is mapped to US. Chinese simplified/Hans (zh) is mapped to China (CN). Chinese traditional (zt) is also mapped to China (CN).

'zh' => array('LANGUAGE' => 'zh', 'REGION' => 'CN', 'DIR' => 'ltr', 'NAME' => '中文', 'NAME_ENG' => 'Chinese'),
'zt' => array('LANGUAGE' => 'zt', 'REGION' => 'CN', 'DIR' => 'ltr', 'NAME' => '普通话', 'NAME_ENG' => 'Chinese traditional'),

You can change these mappings (eg zt to TW) by modifying this file:
includes/libraries/elxis/language/langdb.php

Multilingual files for country names are located here:
includes/libraries/elxis/form/
countries.en.php, countries.el.php, countries.it.php, etc...
Title: Re: How to set a default value in the contact form of country field by languages ?
Post by: chongbing on October 13, 2015, 12:45:13
OK, Thanks  datahell,

I want to re-correct the "Chinese" as below, It's official ! Thanks !

'zh' => array('LANGUAGE' => 'zh', 'REGION' => 'CN', 'DIR' => 'ltr', 'NAME' => '简体中文', 'NAME_ENG' => 'Chinese'),
'zt' => array('LANGUAGE' => 'zt', 'REGION' => 'CN', 'DIR' => 'ltr', 'NAME' => '繁體中文', 'NAME_ENG' => 'Chinese traditional'),
Title: Re: How to set a default value in the contact form of country field by languages ?
Post by: chongbing on October 13, 2015, 13:08:03
Hi datahell,

But ...

Chinese simplified/Hans (zh) is mapped to China (CN). -> Correct ! Which means 'CN' => '中國',
Chinese traditional (zt) is also mapped to China (CN). -> It should be "Taiwan" Which means 'TW' => '台灣', How to set it as default country name in the contact form when user is access Chinese traditional webpage?

Many thanks,
Title: Re: How to set a default value in the contact form of country field by languages ?
Post by: datahell on October 13, 2015, 20:30:10
I told you what to change and fix it. I didn't knew that traditional Chinese are spoken only to Taiwan. I will change that to Elxis.  I also think that Taiwan is part of China now, isn't it???
My Chinese are as good as your Greek ;D
Title: Re: How to set a default value in the contact form of country field by languages ?
Post by: chongbing on October 14, 2015, 06:23:05
Traditional Chinese is used in Taiwan, Hong Kong and some others countries except China. Traditional Chinese and Simplified Chinese are almost the same when people speak, but different in writting. Even though, people can read it if they are Chinese.

BTW, Taiwan is not a part of China so far. As you know, it's a political issue, but i'm not a politician.  ;)

My Chinese are as good as your Greek -> You can say that again  ;D

Thanks datahell.

Title: Re: How to set a default value in the contact form of country field by languages ?
Post by: chongbing on October 14, 2015, 13:29:14
Hi datahell,

Sorry, I miss this you said that as below. It works now. Thank you again.

You can change these mappings (eg zt to TW) by modifying this file:
includes/libraries/elxis/language/langdb.php
Title: Re: How to set a default value in the contact form of country field by languages ?
Post by: datahell on October 14, 2015, 18:50:06
I did this change because I think it reflects better the language location, regardless if Taiwan is an independent country or not. So Chinese Traditional (zt) mapped to Taiwan (TW). Regarding Taiwan status I am not so sure but it is not a matter to discuss here. I am not a politician too. Except if it was a Greek related issue. In that case all Greeks are politicians ;D
Title: Re: How to set a default value in the contact form of country field by languages ?
Post by: chongbing on October 15, 2015, 02:28:29
Yea, understand. Sometimes we can see your country news on our TV here.

Hope you guys are doing very well.