8000 [Intl] Compile localized timezone offset name by ro0NL · Pull Request #31318 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Intl] Compile localized timezone offset name #31318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,25 @@ protected function generateDataForLocale(BundleReaderInterface $reader, $tempDir
if ('root' !== $displayLocale) {
$localeBundles[] = $reader->read($tempDir, 'root');
}
$metadata = [];
$data = [
'Version' => $localeBundle['Version'],
'Names' => $this->generateZones(
$displayLocale,
$reader->read($tempDir, 'timezoneTypes'),
$reader->read($tempDir, 'metaZones'),
$reader->read($tempDir, 'windowsZones'),
...$localeBundles
$localeBundles,
$metadata
),
];

if (!$data['Names']) {
if (!$data['Names'] && !$metadata) {
return;
}

$data['Meta'] = $metadata;

$this->zoneIds = array_merge($this->zoneIds, array_keys($data['Names']));

return $data;
Expand Down Expand Up @@ -136,7 +140,10 @@ protected function generateDataForMeta(BundleReaderInterface $reader, $tempDir)
return $data;
}

private function generateZones(string $locale, ArrayAccessibleResourceBundle $typeBundle, ArrayAccessibleResourceBundle $metaBundle, ArrayAccessibleResourceBundle $windowsZonesBundle, ArrayAccessibleResourceBundle ...$localeBundles): array
/**
* @param ArrayAccessibleResourceBundle[] $localeBundles
*/
private function generateZones(string $locale, ArrayAccessibleResourceBundle $typeBundle, ArrayAccessibleResourceBundle $metaBundle, ArrayAccessibleResourceBundle $windowsZonesBundle, array $localeBundles, array &$metadata = []): array
{
$accessor = static function (ArrayAccessibleResourceBundle $resourceBundle, array $indices) {
$result = $resourceBundle;
Expand Down Expand Up @@ -234,6 +241,16 @@ private function generateZones(string $locale, ArrayAccessibleResourceBundle $ty
$zones[$id] = $name;
}

$gmtFormat = $accessor(['zoneStrings', 'gmtFormat'], $gmtFormatInherited) ?? 'GMT{0}';
if (!$gmtFormatInherited || $isBase) {
$metadata['GmtFormat'] = str_replace('{0}', '%s', $gmtFormat);
}

$hourFormat = $accessor(['zoneStrings', 'hourFormat'], $hourFormatInherited) ?? '+HH:mm;-HH:mm';
if (!$hourFormatInherited || $isBase) {
$metadata['HourFormat'] = explode(';', str_replace(['HH', 'mm', 'H', 'm'], ['%02d', '%02d', '%d', '%d'], $hourFormat), 2);
}

return $zones;
}

Expand Down
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/af.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "Chuuk-tyd",
"Pacific\/Wake": "Wake-eiland-tyd",
"Pacific\/Wallis": "Wallis en Futuna-tyd (Mata-Utu)"
},
"Meta": {
"GmtFormat": "GMT%s",
"HourFormat": [
"+%02d:%02d",
"-%02d:%02d"
]
}
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/am.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "የቹክ ሰዓት",
"Pacific\/Wake": "የዌክ ደሴት ሰዓት (ዋኬ)",
"Pacific\/Wallis": "የዋሊስ እና ፉቱና ሰዓት"
},
"Meta": {
"GmtFormat": "ጂ ኤም ቲ%s",
"HourFormat": [
"+%02d%02d",
"-%02d%02d"
]
}
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "توقيت شوك (ترك)",
"Pacific\/Wake": "توقيت جزيرة ويك (واك)",
"Pacific\/Wallis": "توقيت واليس و فوتونا"
},
"Meta": {
"GmtFormat": "غرينتش%s",
"HourFormat": [
"+%02d:%02d",
"-%02d:%02d"
]
}
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/as.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "চ্চুকৰ সময়",
"Pacific\/Wake": "ৱেক দ্বীপৰ সময়",
"Pacific\/Wallis": "ৱালিছ আৰু ফুটুনাৰ সময়"
},
"Meta": {
"GmtFormat": "GMT%s",
"HourFormat": [
"+%02d:%02d",
"-%02d:%02d"
]
}
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/az.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "Çuuk Vaxtı",
"Pacific\/Wake": "Ueyk Vaxtı (Veyk)",
"Pacific\/Wallis": "Uollis və Futuna Vaxtı"
},
"Meta": {
"GmtFormat": "GMT%s",
"HourFormat": [
"+%02d:%02d",
"-%02d:%02d"
]
}
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/be.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "Час Чуук",
"Pacific\/Wake": "Час вострава Уэйк",
"Pacific\/Wallis": "Час астравоў Уоліс і Футуна"
},
"Meta": {
"GmtFormat": "GMT%s",
"HourFormat": [
"+%02d.%02d",
"-%02d.%02d"
]
}
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "Чуюк",
"Pacific\/Wake": "Остров Уейк",
"Pacific\/Wallis": "Уолис и Футуна"
},
"Meta": {
"GmtFormat": "Гринуич%s",
"HourFormat": [
"+%02d:%02d",
"-%02d:%02d"
]
}
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "চুক সময়",
"Pacific\/Wake": "ওয়েক দ্বীপ সময়",
"Pacific\/Wallis": "ওয়ালিস এবং ফুটুনা সময় (ওলিস)"
},
"Meta": {
"GmtFormat": "GMT %s",
"HourFormat": [
"+%02d:%02d",
"-%02d:%02d"
]
}
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/bo.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "Micronesia (Chuuk)",
"Pacific\/Wake": "U.S. Outlying Islands (Wake)",
"Pacific\/Wallis": "Wallis & Futuna (Wallis)"
},
"Meta": {
"GmtFormat": "GMT%s",
"HourFormat": [
"+%02d:%02d",
"-%02d:%02d"
]
}
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/br.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "Mikronezia (Chuuk)",
"Pacific\/Wake": "Inizi diabell ar Stadoù-Unanet (Wake)",
"Pacific\/Wallis": "eur Wallis ha Futuna"
},
"Meta": {
"GmtFormat": "GMT%s",
"HourFormat": [
"+%02d:%02d",
"-%02d:%02d"
]
}
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/bs.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "Čučko vrijeme (Chuuk)",
"Pacific\/Wake": "Vrijeme na Ostrvu Vejk (Wake)",
"Pacific\/Wallis": "Vrijeme na Ostrvima Valis i Futuna"
},
"Meta": {
"GmtFormat": "GMT %s",
"HourFormat": [
"+%02d:%02d",
" -%02d:%02d"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -429,5 +429,12 @@
"Pacific\/Truk": "Трук време",
"Pacific\/Wake": "Вејк острво време",
"Pacific\/Wallis": "Валис и Футуна Острва време"
},
"Meta": {
"GmtFormat": "GMT%s",
"HourFormat": [
"+%02d%02d",
"-%02d%02d"
]
}
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "Hora de Chuuk",
"Pacific\/Wake": "Hora de Wake",
"Pacific\/Wallis": "Hora de Wallis i Futuna"
},
"Meta": {
"GmtFormat": "GMT%s",
"HourFormat": [
"+%02d:%02d",
"-%02d:%02d"
]
}
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/ce.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "Чуук (Трук, гӀ-наш)",
"Pacific\ 10000 /Wake": "Уэйк, гӀ-е",
"Pacific\/Wallis": "Уоллис а, Футуна а"
},
"Meta": {
"GmtFormat": "GMT%s",
"HourFormat": [
"+%02d:%02d",
"-%02d:%02d"
]
}
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "Chuukský čas (Chuukské ostrovy)",
"Pacific\/Wake": "Čas ostrova Wake",
"Pacific\/Wallis": "Čas ostrovů Wallis a Futuna"
},
"Meta": {
"GmtFormat": "GMT%s",
"HourFormat": [
"+%d:%02d",
"-%d:%02d"
]
}
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/cy.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "Amser Chuuk",
"Pacific\/Wake": "Amser Ynys Wake",
"Pacific\/Wallis": "Amser Wallis a Futuna"
},
"Meta": {
"GmtFormat": "GMT%s",
"HourFormat": [
"+%02d:%02d",
"-%02d:%02d"
]
}
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "Chuuk-tid",
"Pacific\/Wake": "Wake Island-tid",
"Pacific\/Wallis": "Wallis og Futuna-tid"
},
"Meta": {
"GmtFormat": "GMT%s",
"HourFormat": [
"+%02d.%02d",
"-%02d.%02d"
]
}
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "Chuuk-Zeit",
"Pacific\/Wake": "Wake-Insel-Zeit",
"Pacific\/Wallis": "Wallis-und-Futuna-Zeit"
},
"Meta": {
"GmtFormat": "GMT%s",
"HourFormat": [
"+%02d:%02d",
"-%02d:%02d"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@
"Asia\/Macau": "Chinesische Zeit (Macao)",
"Europe\/Saratov": "Moskauer Zeit (Saratov)",
"Pacific\/Guadalcanal": "Salomoninseln-Zeit (Guadalcanal)"
}
},
"Meta": []
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/dz.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "མའི་ཀྲོ་ནི་ཤི་ཡ། (Chuuk་)",
"Pacific\/Wake": "ཡུ་ཨེས་གྱི་མཐའ་མཚམས་མཚོ་གླིང་། (Wake་)",
"Pacific\/Wallis": "ཝལ་ལིས྄་ ཨེནཌ་ ཕུ་ཏུ་ན་། (Wallis་)"
},
"Meta": {
"GmtFormat": "ཇི་ཨེམ་ཏི་%s",
"HourFormat": [
"+%02d:%02d",
"-%02d:%02d"
]
}
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/ee.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "Chuuk gaƒoƒo me",
"Pacific\/Wake": "Wake Island gaƒoƒo me",
"Pacific\/Wallis": "Wallis & Futuna gaƒoƒo me"
},
"Meta": {
"GmtFormat": "%s GMT",
"HourFormat": [
"+%02d:%02d",
"-%02d:%02d"
]
}
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/el.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "Ώρα Τσουκ",
"Pacific\/Wake": "Ώρα Νήσου Γουέικ",
"Pacific\/Wallis": "[Ώρα Ουάλις και Φουτούνα (Γουάλις)]"
},
"Meta": {
"GmtFormat": "GMT%s",
"HourFormat": [
"+%02d:%02d",
"-%02d:%02d"
]
}
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "Chuuk Time",
"Pacific\/Wake": "Wake Island Time",
"Pacific\/Wallis": "Wallis & Futuna Time"
},
"Meta": {
"GmtFormat": "GMT%s",
"HourFormat": [
"+%02d:%02d",
"-%02d:%02d"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
"Indian\/Comoro": "Eastern Africa Time (Comoro)",
"Indian\/Mayotte": "Eastern Africa Time (Mayotte)",
"Pacific\/Rarotonga": "Cook Island Time (Rarotonga)"
}
},
"Meta": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"Version": "2.1.47.86",
"Names": {
"Asia\/Rangoon": "Myanmar Time (Rangoon)"
}
},
"Meta": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"America\/St_Thomas": "Atlantic Time (St Thomas)",
"America\/St_Vincent": "Atlantic Time (St Vincent)",
"Atlantic\/St_Helena": "Greenwich Mean Time (St Helena)"
}
},
"Meta": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"Version": "2.1.49.14",
"Names": {
"Asia\/Rangoon": "Myanmar Time (Rangoon)"
}
},
"Meta": []
}
7 changes: 7 additions & 0 deletions src/Symfony/Component/Intl/Resources/data/timezones/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -435,5 +435,12 @@
"Pacific\/Truk": "hora de Chuuk",
"Pacific\/Wake": "hora de la isla Wake",
"Pacific\/Wallis": "hora de Wallis y Futuna"
},
"Meta": {
"GmtFormat": "GMT%s",
"HourFormat": [
"+%02d:%02d",
"-%02d:%02d"
]
}
}
Loading
0