Changeset 28606
- Timestamp:
- 03/18/10 15:31:23 (3 years ago)
- Files:
-
- tools/i18n-icu2dat/icu-converter.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
tools/i18n-icu2dat/icu-converter.php
r28046 r28606 13 13 * How to use: 14 14 * - put this file and sfYaml classes in a directory 15 * - use spec version 1.2 for sfYaml to parse 'no' correctly as norwegian (not as false) (default for up2dte sfYaml)16 15 * - download ICU files in subdirectory called "data" 17 16 * - preprocess some ICU files. 17 * - run 18 18 */ 19 19 /** … … 21 21 * due to line wrappings in icu files: 22 22 * region/es.txt line 141 HK{"Región Administrativa Especial de Hong Kong de la República Popular China"} 23 * locales/he.txt line 1788fix date time patterns23 * locales/he.txt line 337 fix date time patterns 24 24 * region/it.txt line 140 HK{"Regione Amministrativa Speciale di Hong Kong della Repubblica Popolare Cinese"} 25 * region/it.txt line 19 3MO{"Regione Amministrativa Speciale di Macao della Repubblica Popolare Cinese"}25 * region/it.txt line 198 MO{"Regione Amministrativa Speciale di Macao della Repubblica Popolare Cinese"} 26 26 * 27 27 * Note: feel free to supply a patch that eliminates the need of preprocessing 28 28 */ 29 29 30 // Include the symfony YAML library (can be obtained from symfony 1.3 +) 30 // Include the symfony YAML library (can be obtained from symfony components) 31 // http://svn.symfony-project.com/components/yaml/branches/1.0/lib 31 32 include_once('sfYaml.php'); 32 33 … … 61 62 62 63 // dirty hack to avoid special handling of the metazone input data 63 copy('data/misc/meta zoneInfo.txt', 'data/locales/metazoneInfo.txt');64 copy('data/misc/metaZones.txt', 'data/locales/metaZones.txt'); 64 65 65 66 // since newer icu releases the data is split n multiple files … … 195 196 } 196 197 197 // postprocess the meta zoneInfo.dat into root.dat198 $metazoneInfo = unserialize(file_get_contents('data/meta zoneInfo.dat'));198 // postprocess the metaZones.dat into root.dat 199 $metazoneInfo = unserialize(file_get_contents('data/metaZones.dat')); 199 200 $zones = array(); 200 201 foreach ($metazoneInfo['metazoneMappings'] as $key => $value) … … 208 209 $rootData['TimeZones'] = $zones; 209 210 file_put_contents('data/root.dat',serialize($rootData)); 210 unlink('data/meta zoneInfo.dat');211 unlink('data/metaZones.dat');