9 replies [Last post]
m37all1ca's picture
Offline
Joined: 01/20/2008
Juice: 9
Was this information Helpful?

I created the attached CIF file for Taiwan.

The cities listed are in both English and Chinese to give customers the option of entering their address in either language.

I will work on a version for China and will post it as soon as it's completed.

-W

PreviewAttachmentSize
taiwan_158_1.cif3.21 KB
Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15453
Awesome. Will test and

Awesome. Smiling Will test and commit this morning if possible.

(I'm going to have to assume that the Chinese characters will display properly on the appropriate browser... for me they just show up as ???.)

m37all1ca's picture
Offline
Joined: 01/20/2008
Juice: 9
Ryan, I did not see any

Ryan,

I did not see any problems with the Chinese characters from my macbook via the Safari, Firefox 2, Camino and Opera browsers. If you're using Windows, I believe you have to install the Asian language pack to be able to display Chinese Characters. I will confirm this later at home as all the PCs I use at work have the Asian language pack installed.

-w

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15453
Re: Ryan, I did not see any

No sweat. I added it in and assumed it works fine if you posted it up as complete. Smiling

m37all1ca's picture
Offline
Joined: 01/20/2008
Juice: 9
Re: Re: Ryan, I did not see any

yes sir. It's complete and the question marks only shows up on XP machine that does not have the East-Asian language pack installed.

adigit's picture
Offline
Joined: 02/28/2008
Juice: 15
China.cif
LuckyBunny's picture
Offline
Joined: 03/25/2008
Juice: 4
???

Huh? I clicked the " tawan_158_1.cif file " then many words come out =.= .. i want to download it !! >.< i wanna play nostale tawain.. but i cannot understand .. hw?

LuckyBunny's picture
Offline
Joined: 03/25/2008
Juice: 4
It appears like this.
<?php
// $Id$

/**
* First implement hook_install() using the name of the country as the base of
* the function name.
*/

function taiwan_install() {
 
// Make the entry in the country table.
  // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
 
db_query("INSERT INTO {uc_countries} VALUES (158, 'Taiwan', 'TW', 'TWN', 1)");

 

// Make the entries in the zones table.  Use %d for the zone_id and the
  // function uc_get_zone_ids($num) as the second argument for db_query() where
  // $num is the number of zones in the INSERT query.
  // VALUES = %d for ID, Parent Country ID, Zone Abbreviation, Zone Name
 
db_query("INSERT INTO {uc_zones} VALUES "
         
."(%d, 158, '01', 'ChangHua County'),"
         
."(%d, 158, '02', 'ChiaYi City'),"
         
."(%d, 158, '03', 'ChiaYi County'),"
         
."(%d, 158, '04', 'HsinChu City'),"
         
."(%d, 158, '05', 'HsinChu County'),"
         
."(%d, 158, '06', 'HuaLien County'),"
         
."(%d, 158, '07', 'KaoHsiung City'),"
         
."(%d, 158, '08', 'KaoHsiung County'),"
         
."(%d, 158, '09', 'KeeLung City '),"
         
."(%d, 158, '10', 'KinMen County'),"
         
."(%d, 158, '11', 'LienChiang County'),"
         
."(%d, 158, '12', 'MiaoLi County'),"
         
."(%d, 158, '13', 'NanHai'),"
         
."(%d, 158, '14', 'NanTou County'),"
         
."(%d, 158, '15', 'PengHu County'),"
         
."(%d, 158, '16', 'PingTung County'),"
         
."(%d, 158, '17', 'TaiChung City'),"
         
."(%d, 158, '18', 'TaiChung County'),"
         
."(%d, 158, '19', 'TaiNan City'),"
         
."(%d, 158, '20', 'TaiNan County'),"
         
."(%d, 158, '21', 'Taipei City'),"
         
."(%d, 158, '22', 'Taipei County'),"
         
."(%d, 158, '23', 'TaiTung County'),"
         
."(%d, 158, '24', 'TaoYuan County'),"
         
."(%d, 158, '25', 'Yilan County'),"
         
."(%d, 158, '26', 'YunLin County'),"
         
."(%d, 158, '27', '南投縣'),"
         
."(%d, 158, '28', '南海諸島'),"
         
."(%d, 158, '29', '嘉義市'),"
         
."(%d, 158, '30', '嘉義縣'),"
         
."(%d, 158, '31', '基隆市'),"
         
."(%d, 158, '32', '宜蘭縣'),"
         
."(%d, 158, '33', '屏東縣'),"
         
."(%d, 158, '34', '彰化縣'),"
         
."(%d, 158, '35', '新竹市'),"
         
."(%d, 158, '36', '新竹縣'),"
         
."(%d, 158, '37', '桃園縣'),"
         
."(%d, 158, '38', '澎湖縣'),"
         
."(%d, 158, '39', '臺中市'),"
         
."(%d, 158, '40', '臺中縣'),"
         
."(%d, 158, '41', '臺北市'),"
         
."(%d, 158, '42', '臺北縣'),"
         
."(%d, 158, '43', '臺南市'),"
         
."(%d, 158, '44', '臺南縣'),"
         
."(%d, 158, '45', '臺東縣'),"
         
."(%d, 158, '46', '花蓮縣'),"
         
."(%d, 158, '47', '苗栗縣'),"
         
."(%d, 158, '48', '連江縣'),"
         
."(%d, 158, '49', '金門縣'),"
         
."(%d, 158, '50', '雲林縣'),"
         
."(%d, 158, '51', '高雄市'),"
         
."(%d, 158, '52', '高雄縣')", uc_get_zone_ids(52));

 

uc_set_address_format(158,
   
"!company\r\n!last_name !first_name\r\n!street1\r\n!street2\r\n"
   
."!city, !zone_name !postal_code\r\n!country_name_if");
}

function

taiwan_update($version) {
}

function

taiwan_uninstall() {
}
?>

IT APPEARS LIKE THIS KK??

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15453
Umm... chill out? This

Umm... chill out? Sticking out tongue This file is included in Ubercart. Make sure you have beta 7 installed and go to /admin/store/settings/countries/edit where you can enable Taiwan.

To download that file, btw, you would simply have to right click the link and choose to "Save as..." Eye-wink

mixmaxtw's picture
Offline
Joined: 08/16/2011
Juice: 4
I'd like to update the file

Hi,

since Taiwan had a reform on their counties recently, I'd like to update the file to the latest information.
A few questions before I start:

1. The index number in the second column: Since we have fewer counties now, do I need to delete the obsolete entries and append the new ones at the end and increase the index number? Is the index number used at all internally or just the name? Does it make sense to renumber the indices or will this wreck havoc existing installations?

2. IMO it would make more sense to use the English names only and add the Chinese names through the translation system. Is it still possible to change it this way? Or does Ubercart not support this method?

3. When using Chinese characters in the address, the address format looks different than when using the English format. Is it possible to define two address formats based on the language (Chinese and the rest)?

Cheers
Arne