Closed (fixed)
Project:
Ubercart
Version:
7.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Dec 2012 at 13:48 UTC
Updated:
13 Jan 2013 at 20:10 UTC
Jump to comment: Most recent file
Comments
Comment #1
abx commentedHere is the patch
Comment #2
abx commentedd7 patch
Comment #3
tr commentedThanks for doing this. Is this a recent change to ISO 3166-2? The .cif files should have the same provinces as the ISO standard. The Thailand .cif file is very old and should be reviewed to make sure it agrees with the standard.
The .cif files are used for two purposes, 1) to install the country information, and 2) to update the country information for existing Ubercart sites. Your patch does 1) correctly for this new province, but doesn't do 2).
What needs to be done is to create a new version, thailand_764_3.cif with an update function that will add the new province for people who had the old thailand_764_2.cif installed. You can use bahrain_48_3.cif as an example of how to write an update function - that .cif has an update function that add new zones, renames zones, deletes zones, etc.
Comment #4
longwaveAccording to http://en.wikipedia.org/wiki/Bueng_Kan_Province this province was created in 2011, and it does not yet have an official ISO 3166-2 code - but the Thailand CIF does not use the correct codes anyway.
I also think "Bueng Kan" is the romanized name we should use if/when #1069950: Romanization of country zones is fixed.
Comment #5
abx commentedI do not know how to change the filename from thailand_764_2.cif - > thailand_764_3.cif. I also don't know how to test the script I modified. There is no update available there when I ran site.com/update.php.
What I did is to change everything to match this page -> http://en.wikipedia.org/wiki/ISO_3166-2:TH. Also, I'm pretty sure Bueng Kan has the code TH-38 since their postal code already available in Thailand. (Postal code based on ISO code)
I also wondering that with Romanization thing, I, then, need to translate those into Thai in the translate Interfae? I mean my store is mainly for Thai who may only be able to read only Thai. With English, they may not know what it is.
Please let me know if I need to change anything.
Comment #6
abx commentedComment #7
longwaveThanks for the patches. Committed to both branches, with coding standards fixes in 6.x and a simpler update query in 7.x.
Country files are updated from the "Countries and addresses" admin page; click "update" next to the country name. However, this does mean that Thai zones will be romanized if you update. This is the correct thing to do; all strings in Drupal should be coded in their English form, then translated as necessary.