diff options
author | sgiehl <stefan@piwik.org> | 2015-06-12 23:16:11 +0300 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2015-06-20 12:21:12 +0300 |
commit | c0905e36b971aa4eb4321ed302441ba17eecdebb (patch) | |
tree | 9ccdc172f3d4f4d2982036ddcbeb485aabf960f9 /plugins | |
parent | 1eb82eab48c744bb050ae205f72d338cf3dd7c34 (diff) |
fetch layout direction from cldr
Diffstat (limited to 'plugins')
58 files changed, 80 insertions, 28 deletions
diff --git a/plugins/Intl/Commands/GenerateIntl.php b/plugins/Intl/Commands/GenerateIntl.php index d65f82c577..c98b3d7c23 100644 --- a/plugins/Intl/Commands/GenerateIntl.php +++ b/plugins/Intl/Commands/GenerateIntl.php @@ -96,6 +96,7 @@ class GenerateIntl extends ConsoleCommand $this->fetchLanguageData($output, $transformedLangCode, $requestLangCode, $translations); $this->fetchTerritoryData($output, $transformedLangCode, $requestLangCode, $translations); $this->fetchCalendarData($output, $transformedLangCode, $requestLangCode, $translations); + $this->fetchLayoutDirection($output, $transformedLangCode, $requestLangCode, $translations); ksort($translations['Intl']); @@ -157,6 +158,30 @@ class GenerateIntl extends ConsoleCommand } } + protected function fetchLayoutDirection(OutputInterface $output, $langCode, $requestLangCode, &$translations) + { + $layoutDirectionUrl = 'https://raw.githubusercontent.com/unicode-cldr/cldr-misc-full/master/main/%s/layout.json'; + + try { + $layoutData = Http::fetchRemoteFile(sprintf($layoutDirectionUrl, $requestLangCode)); + $layoutData = json_decode($layoutData, true); + $layoutData = $layoutData['main'][$requestLangCode]['layout']['orientation']; + + if (empty($layoutData)) { + throw new \Exception(); + } + + $translations['Intl']['LayoutDirection'] = 'ltr'; + if ($layoutData['characterOrder'] == 'right-to-left') { + $translations['Intl']['LayoutDirection'] = 'rtl'; + } + + $output->writeln('Saved language data for ' . $langCode); + } catch (\Exception $e) { + $output->writeln('Unable to import language data for ' . $langCode); + } + } + protected function fetchTerritoryData(OutputInterface $output, $langCode, $requestLangCode, &$translations) { $territoryDataUrl = 'https://raw.githubusercontent.com/unicode-cldr/cldr-localenames-full/master/main/%s/territories.json'; diff --git a/plugins/Intl/lang/am.json b/plugins/Intl/lang/am.json index ff25a61c4a..81f279d4c5 100644 --- a/plugins/Intl/lang/am.json +++ b/plugins/Intl/lang/am.json @@ -424,6 +424,7 @@ "Language_za": "ዡዋንግኛ", "Language_zh": "ቻይንኛ", "Language_zu": "ዙሉኛ", + "LayoutDirection": "ltr", "LongDay_1": "ሰኞ", "LongDay_2": "ማክሰኞ", "LongDay_3": "ረቡዕ", diff --git a/plugins/Intl/lang/ar.json b/plugins/Intl/lang/ar.json index 8f6299dd46..22bc350ee7 100644 --- a/plugins/Intl/lang/ar.json +++ b/plugins/Intl/lang/ar.json @@ -448,6 +448,7 @@ "Language_za": "الزهيونج", "Language_zh": "الصينية", "Language_zu": "الزولو", + "LayoutDirection": "rtl", "LongDay_1": "الاثنين", "LongDay_2": "الثلاثاء", "LongDay_3": "الأربعاء", diff --git a/plugins/Intl/lang/be.json b/plugins/Intl/lang/be.json index 0127665e57..9684fdc91b 100644 --- a/plugins/Intl/lang/be.json +++ b/plugins/Intl/lang/be.json @@ -365,6 +365,7 @@ "Language_yi": "Ідыш", "Language_zh": "Кітайская", "Language_zu": "Зулу", + "LayoutDirection": "ltr", "LongDay_1": "Панядзелак", "LongDay_2": "Аўторак", "LongDay_3": "Серада", diff --git a/plugins/Intl/lang/bg.json b/plugins/Intl/lang/bg.json index d3f4741de8..c7081a2910 100644 --- a/plugins/Intl/lang/bg.json +++ b/plugins/Intl/lang/bg.json @@ -448,6 +448,7 @@ "Language_za": "Зуанг", "Language_zh": "Китайски", "Language_zu": "Зулуски", + "LayoutDirection": "ltr", "LongDay_1": "Понеделник", "LongDay_2": "Вторник", "LongDay_3": "Сряда", diff --git a/plugins/Intl/lang/bn.json b/plugins/Intl/lang/bn.json index 80f218f22d..7f8cf4a256 100644 --- a/plugins/Intl/lang/bn.json +++ b/plugins/Intl/lang/bn.json @@ -448,6 +448,7 @@ "Language_za": "ঝু্য়াঙ", "Language_zh": "চীনা", "Language_zu": "জুলু", + "LayoutDirection": "ltr", "LongDay_1": "সোমবার", "LongDay_2": "মঙ্গলবার", "LongDay_3": "বুধবার", diff --git a/plugins/Intl/lang/bs.json b/plugins/Intl/lang/bs.json index db202a8e6e..2dd4973756 100644 --- a/plugins/Intl/lang/bs.json +++ b/plugins/Intl/lang/bs.json @@ -447,6 +447,7 @@ "Language_za": "Zuang", "Language_zh": "Kineski", "Language_zu": "Zulu", + "LayoutDirection": "ltr", "LongDay_1": "Ponedjeljak", "LongDay_2": "Utorak", "LongDay_3": "Srijeda", diff --git a/plugins/Intl/lang/ca.json b/plugins/Intl/lang/ca.json index 1c31da760e..9c70f64783 100644 --- a/plugins/Intl/lang/ca.json +++ b/plugins/Intl/lang/ca.json @@ -448,6 +448,7 @@ "Language_za": "Zhuang", "Language_zh": "Xinès", "Language_zu": "Zulu", + "LayoutDirection": "ltr", "LongDay_1": "Dilluns", "LongDay_2": "Dimarts", "LongDay_3": "Dimecres", diff --git a/plugins/Intl/lang/cs.json b/plugins/Intl/lang/cs.json index 20274eb71a..bb834d5290 100644 --- a/plugins/Intl/lang/cs.json +++ b/plugins/Intl/lang/cs.json @@ -448,6 +448,7 @@ "Language_za": "Čuangština", "Language_zh": "Čínština", "Language_zu": "Zuluština", + "LayoutDirection": "ltr", "LongDay_1": "Pondělí", "LongDay_2": "Úterý", "LongDay_3": "Středa", diff --git a/plugins/Intl/lang/cy.json b/plugins/Intl/lang/cy.json index a17e713735..a9e650a1e1 100644 --- a/plugins/Intl/lang/cy.json +++ b/plugins/Intl/lang/cy.json @@ -433,6 +433,7 @@ "Language_yo": "Iorwba", "Language_zh": "Tsieineeg", "Language_zu": "Swlw", + "LayoutDirection": "ltr", "LongDay_1": "Dydd Llun", "LongDay_2": "Dydd Mawrth", "LongDay_3": "Dydd Mercher", diff --git a/plugins/Intl/lang/da.json b/plugins/Intl/lang/da.json index a2f15fcc32..c0f7e3fe70 100644 --- a/plugins/Intl/lang/da.json +++ b/plugins/Intl/lang/da.json @@ -448,6 +448,7 @@ "Language_za": "Zhuang", "Language_zh": "Kinesisk", "Language_zu": "Zulu", + "LayoutDirection": "ltr", "LongDay_1": "Mandag", "LongDay_2": "Tirsdag", "LongDay_3": "Onsdag", diff --git a/plugins/Intl/lang/de.json b/plugins/Intl/lang/de.json index 46b9ae5418..7fdd387d9f 100644 --- a/plugins/Intl/lang/de.json +++ b/plugins/Intl/lang/de.json @@ -448,6 +448,7 @@ "Language_za": "Zhuang", "Language_zh": "Chinesisch", "Language_zu": "Zulu", + "LayoutDirection": "ltr", "LongDay_1": "Montag", "LongDay_2": "Dienstag", "LongDay_3": "Mittwoch", diff --git a/plugins/Intl/lang/el.json b/plugins/Intl/lang/el.json index 3f9f7a604d..b3bb1cd7ac 100644 --- a/plugins/Intl/lang/el.json +++ b/plugins/Intl/lang/el.json @@ -448,6 +448,7 @@ "Language_za": "Ζουάνγκ", "Language_zh": "Κινεζικά", "Language_zu": "Ζουλού", + "LayoutDirection": "ltr", "LongDay_1": "Δευτέρα", "LongDay_2": "Τρίτη", "LongDay_3": "Τετάρτη", diff --git a/plugins/Intl/lang/en.json b/plugins/Intl/lang/en.json index 23a259b571..71ae2fdb53 100644 --- a/plugins/Intl/lang/en.json +++ b/plugins/Intl/lang/en.json @@ -448,6 +448,7 @@ "Language_za": "Zhuang", "Language_zh": "Chinese", "Language_zu": "Zulu", + "LayoutDirection": "ltr", "LongDay_1": "Monday", "LongDay_2": "Tuesday", "LongDay_3": "Wednesday", diff --git a/plugins/Intl/lang/es.json b/plugins/Intl/lang/es.json index f8f7cf7173..e506ac4bf7 100644 --- a/plugins/Intl/lang/es.json +++ b/plugins/Intl/lang/es.json @@ -448,6 +448,7 @@ "Language_za": "Zhuang", "Language_zh": "Chino", "Language_zu": "Zulú", + "LayoutDirection": "ltr", "LongDay_1": "Lunes", "LongDay_2": "Martes", "LongDay_3": "Miércoles", diff --git a/plugins/Intl/lang/et.json b/plugins/Intl/lang/et.json index 5e297cb9f8..6b649477a1 100644 --- a/plugins/Intl/lang/et.json +++ b/plugins/Intl/lang/et.json @@ -448,6 +448,7 @@ "Language_za": "Tšuangi", "Language_zh": "Hiina", "Language_zu": "Suulu", + "LayoutDirection": "ltr", "LongDay_1": "Esmaspäev", "LongDay_2": "Teisipäev", "LongDay_3": "Kolmapäev", diff --git a/plugins/Intl/lang/eu.json b/plugins/Intl/lang/eu.json index 0fd1cce644..4cb8f51741 100644 --- a/plugins/Intl/lang/eu.json +++ b/plugins/Intl/lang/eu.json @@ -418,6 +418,7 @@ "Language_yo": "Yorubera", "Language_zh": "Txinera", "Language_zu": "Zuluera", + "LayoutDirection": "ltr", "LongDay_1": "Astelehena", "LongDay_2": "Asteartea", "LongDay_3": "Asteazkena", diff --git a/plugins/Intl/lang/fa.json b/plugins/Intl/lang/fa.json index d3d2a77712..c50b9f8917 100644 --- a/plugins/Intl/lang/fa.json +++ b/plugins/Intl/lang/fa.json @@ -448,6 +448,7 @@ "Language_za": "چوانگی", "Language_zh": "چینی", "Language_zu": "زولویی", + "LayoutDirection": "rtl", "LongDay_1": "دوشنبه", "LongDay_2": "سهشنبه", "LongDay_3": "چهارشنبه", diff --git a/plugins/Intl/lang/fi.json b/plugins/Intl/lang/fi.json index 07137cb77c..32bad6ae37 100644 --- a/plugins/Intl/lang/fi.json +++ b/plugins/Intl/lang/fi.json @@ -448,6 +448,7 @@ "Language_za": "Zhuang", "Language_zh": "Kiina", "Language_zu": "Zulu", + "LayoutDirection": "ltr", "LongDay_1": "Maanantaina", "LongDay_2": "Tiistaina", "LongDay_3": "Keskiviikkona", diff --git a/plugins/Intl/lang/fr.json b/plugins/Intl/lang/fr.json index 1db56cd5db..b8f82500dd 100644 --- a/plugins/Intl/lang/fr.json +++ b/plugins/Intl/lang/fr.json @@ -448,6 +448,7 @@ "Language_za": "Zhuang", "Language_zh": "Chinois", "Language_zu": "Zoulou", + "LayoutDirection": "ltr", "LongDay_1": "Lundi", "LongDay_2": "Mardi", "LongDay_3": "Mercredi", diff --git a/plugins/Intl/lang/gl.json b/plugins/Intl/lang/gl.json index f3a75a01d6..3ddacf2536 100644 --- a/plugins/Intl/lang/gl.json +++ b/plugins/Intl/lang/gl.json @@ -418,6 +418,7 @@ "Language_yo": "Ioruba", "Language_zh": "Chinés", "Language_zu": "Zulú", + "LayoutDirection": "ltr", "LongDay_1": "Luns", "LongDay_2": "Martes", "LongDay_3": "Mércores", diff --git a/plugins/Intl/lang/he.json b/plugins/Intl/lang/he.json index 37414784d2..903cd3526b 100644 --- a/plugins/Intl/lang/he.json +++ b/plugins/Intl/lang/he.json @@ -448,6 +448,7 @@ "Language_za": "ז׳ואנג", "Language_zh": "סינית", "Language_zu": "זולו", + "LayoutDirection": "rtl", "LongDay_1": "יום שני", "LongDay_2": "יום שלישי", "LongDay_3": "יום רביעי", diff --git a/plugins/Intl/lang/hi.json b/plugins/Intl/lang/hi.json index 2b5cff05be..ab753e6267 100644 --- a/plugins/Intl/lang/hi.json +++ b/plugins/Intl/lang/hi.json @@ -448,6 +448,7 @@ "Language_za": "ज़ुआंग", "Language_zh": "चीनी", "Language_zu": "ज़ुलू", + "LayoutDirection": "ltr", "LongDay_1": "सोमवार", "LongDay_2": "मंगलवार", "LongDay_3": "बुधवार", diff --git a/plugins/Intl/lang/hr.json b/plugins/Intl/lang/hr.json index a23fe4723f..b0af3eabd8 100644 --- a/plugins/Intl/lang/hr.json +++ b/plugins/Intl/lang/hr.json @@ -448,6 +448,7 @@ "Language_za": "Zhuang", "Language_zh": "Kineski", "Language_zu": "Zulu", + "LayoutDirection": "ltr", "LongDay_1": "Ponedjeljak", "LongDay_2": "Utorak", "LongDay_3": "Srijeda", diff --git a/plugins/Intl/lang/hu.json b/plugins/Intl/lang/hu.json index f32dd8bc78..9e663fd16e 100644 --- a/plugins/Intl/lang/hu.json +++ b/plugins/Intl/lang/hu.json @@ -448,6 +448,7 @@ "Language_za": "Zsuang", "Language_zh": "Kínai", "Language_zu": "Zulu", + "LayoutDirection": "ltr", "LongDay_1": "Hétfő", "LongDay_2": "Kedd", "LongDay_3": "Szerda", diff --git a/plugins/Intl/lang/id.json b/plugins/Intl/lang/id.json index 6f14d1f4f5..5937948a0a 100644 --- a/plugins/Intl/lang/id.json +++ b/plugins/Intl/lang/id.json @@ -448,6 +448,7 @@ "Language_za": "Zhuang", "Language_zh": "China", "Language_zu": "Zulu", + "LayoutDirection": "ltr", "LongDay_1": "Senin", "LongDay_2": "Selasa", "LongDay_3": "Rabu", diff --git a/plugins/Intl/lang/is.json b/plugins/Intl/lang/is.json index e84cd65f8a..6b2642d643 100644 --- a/plugins/Intl/lang/is.json +++ b/plugins/Intl/lang/is.json @@ -446,6 +446,7 @@ "Language_za": "Súang", "Language_zh": "Kínverska", "Language_zu": "Súlú", + "LayoutDirection": "ltr", "LongDay_1": "Mánudagur", "LongDay_2": "Þriðjudagur", "LongDay_3": "Miðvikudagur", diff --git a/plugins/Intl/lang/it.json b/plugins/Intl/lang/it.json index eb93fd35bc..c0d09f1257 100644 --- a/plugins/Intl/lang/it.json +++ b/plugins/Intl/lang/it.json @@ -448,6 +448,7 @@ "Language_za": "Zhuang", "Language_zh": "Cinese", "Language_zu": "Zulu", + "LayoutDirection": "ltr", "LongDay_1": "Lunedì", "LongDay_2": "Martedì", "LongDay_3": "Mercoledì", diff --git a/plugins/Intl/lang/ja.json b/plugins/Intl/lang/ja.json index 87949d7df3..80b92612f4 100644 --- a/plugins/Intl/lang/ja.json +++ b/plugins/Intl/lang/ja.json @@ -448,6 +448,7 @@ "Language_za": "チワン語", "Language_zh": "中国語", "Language_zu": "ズールー語", + "LayoutDirection": "ltr", "LongDay_1": "月曜日", "LongDay_2": "火曜日", "LongDay_3": "水曜日", diff --git a/plugins/Intl/lang/ka.json b/plugins/Intl/lang/ka.json index a7adf48ed4..8b85143be6 100644 --- a/plugins/Intl/lang/ka.json +++ b/plugins/Intl/lang/ka.json @@ -429,6 +429,7 @@ "Language_yo": "იორუბა", "Language_zh": "ჩინური", "Language_zu": "ზულუ", + "LayoutDirection": "ltr", "LongDay_1": "ორშაბათი", "LongDay_2": "სამშაბათი", "LongDay_3": "ოთხშაბათი", diff --git a/plugins/Intl/lang/ko.json b/plugins/Intl/lang/ko.json index e5950ce069..8b386097ee 100644 --- a/plugins/Intl/lang/ko.json +++ b/plugins/Intl/lang/ko.json @@ -448,6 +448,7 @@ "Language_za": "주앙어", "Language_zh": "중국어", "Language_zu": "줄루어", + "LayoutDirection": "ltr", "LongDay_1": "월요일", "LongDay_2": "화요일", "LongDay_3": "수요일", diff --git a/plugins/Intl/lang/lt.json b/plugins/Intl/lang/lt.json index ff1aae374d..d1bbba3aff 100644 --- a/plugins/Intl/lang/lt.json +++ b/plugins/Intl/lang/lt.json @@ -448,6 +448,7 @@ "Language_za": "Chuang", "Language_zh": "Kinų", "Language_zu": "Zulų", + "LayoutDirection": "ltr", "LongDay_1": "Pirmadienis", "LongDay_2": "Antradienis", "LongDay_3": "Trečiadienis", diff --git a/plugins/Intl/lang/lv.json b/plugins/Intl/lang/lv.json index 2144dd58c1..1ea19136ec 100644 --- a/plugins/Intl/lang/lv.json +++ b/plugins/Intl/lang/lv.json @@ -448,6 +448,7 @@ "Language_za": "Džuanu", "Language_zh": "Ķīniešu", "Language_zu": "Zulu", + "LayoutDirection": "ltr", "LongDay_1": "Pirmdiena", "LongDay_2": "Otrdiena", "LongDay_3": "Trešdiena", diff --git a/plugins/Intl/lang/nb.json b/plugins/Intl/lang/nb.json index c113295450..22ebc2e825 100644 --- a/plugins/Intl/lang/nb.json +++ b/plugins/Intl/lang/nb.json @@ -448,6 +448,7 @@ "Language_za": "Zhuang", "Language_zh": "Kinesisk", "Language_zu": "Zulu", + "LayoutDirection": "ltr", "LongDay_1": "Mandag", "LongDay_2": "Tirsdag", "LongDay_3": "Onsdag", diff --git a/plugins/Intl/lang/nl.json b/plugins/Intl/lang/nl.json index e0a3eac523..9f28221ba9 100644 --- a/plugins/Intl/lang/nl.json +++ b/plugins/Intl/lang/nl.json @@ -448,6 +448,7 @@ "Language_za": "Zhuang", "Language_zh": "Chinees", "Language_zu": "Zoeloe", + "LayoutDirection": "ltr", "LongDay_1": "Maandag", "LongDay_2": "Dinsdag", "LongDay_3": "Woensdag", diff --git a/plugins/Intl/lang/nn.json b/plugins/Intl/lang/nn.json index ad923b272b..027f48f677 100644 --- a/plugins/Intl/lang/nn.json +++ b/plugins/Intl/lang/nn.json @@ -444,6 +444,7 @@ "Language_za": "Zhuang", "Language_zh": "Kinesisk", "Language_zu": "Zulu", + "LayoutDirection": "ltr", "LongDay_1": "Måndag", "LongDay_2": "Tysdag", "LongDay_3": "Onsdag", diff --git a/plugins/Intl/lang/pl.json b/plugins/Intl/lang/pl.json index fcb58ad920..e782f54d94 100644 --- a/plugins/Intl/lang/pl.json +++ b/plugins/Intl/lang/pl.json @@ -448,6 +448,7 @@ "Language_za": "Czuang", "Language_zh": "Chiński", "Language_zu": "Zulu", + "LayoutDirection": "ltr", "LongDay_1": "Poniedziałek", "LongDay_2": "Wtorek", "LongDay_3": "Środa", diff --git a/plugins/Intl/lang/pt-br.json b/plugins/Intl/lang/pt-br.json index d091c192fd..1fd1be0055 100644 --- a/plugins/Intl/lang/pt-br.json +++ b/plugins/Intl/lang/pt-br.json @@ -448,6 +448,7 @@ "Language_za": "Zhuang", "Language_zh": "Chinês", "Language_zu": "Zulu", + "LayoutDirection": "ltr", "LongDay_1": "Segunda-feira", "LongDay_2": "Terça-feira", "LongDay_3": "Quarta-feira", diff --git a/plugins/Intl/lang/pt.json b/plugins/Intl/lang/pt.json index 7b700e4101..09cb1744e5 100644 --- a/plugins/Intl/lang/pt.json +++ b/plugins/Intl/lang/pt.json @@ -448,6 +448,7 @@ "Language_za": "Zhuang", "Language_zh": "Chinês", "Language_zu": "Zulu", + "LayoutDirection": "ltr", "LongDay_1": "Segunda-feira", "LongDay_2": "Terça-feira", "LongDay_3": "Quarta-feira", diff --git a/plugins/Intl/lang/ro.json b/plugins/Intl/lang/ro.json index 6222e7bab4..03d6d91215 100644 --- a/plugins/Intl/lang/ro.json +++ b/plugins/Intl/lang/ro.json @@ -448,6 +448,7 @@ "Language_za": "Zhuang", "Language_zh": "Chineză", "Language_zu": "Zulu", + "LayoutDirection": "ltr", "LongDay_1": "Luni", "LongDay_2": "Marți", "LongDay_3": "Miercuri", diff --git a/plugins/Intl/lang/ru.json b/plugins/Intl/lang/ru.json index c2ffc84b66..3b9a969845 100644 --- a/plugins/Intl/lang/ru.json +++ b/plugins/Intl/lang/ru.json @@ -448,6 +448,7 @@ "Language_za": "Чжуань", "Language_zh": "Китайский", "Language_zu": "Зулу", + "LayoutDirection": "ltr", "LongDay_1": "Понедельник", "LongDay_2": "Вторник", "LongDay_3": "Среда", diff --git a/plugins/Intl/lang/sk.json b/plugins/Intl/lang/sk.json index 95a3ef5670..d9143fc111 100644 --- a/plugins/Intl/lang/sk.json +++ b/plugins/Intl/lang/sk.json @@ -448,6 +448,7 @@ "Language_za": "Čuangčina", "Language_zh": "Čínština", "Language_zu": "Zuluština", + "LayoutDirection": "ltr", "LongDay_1": "Pondelok", "LongDay_2": "Utorok", "LongDay_3": "Streda", diff --git a/plugins/Intl/lang/sl.json b/plugins/Intl/lang/sl.json index ffd4768f97..831035a5c8 100644 --- a/plugins/Intl/lang/sl.json +++ b/plugins/Intl/lang/sl.json @@ -446,6 +446,7 @@ "Language_yo": "Jorubščina", "Language_zh": "Kitajščina", "Language_zu": "Zulujščina", + "LayoutDirection": "ltr", "LongDay_1": "Ponedeljek", "LongDay_2": "Torek", "LongDay_3": "Sreda", diff --git a/plugins/Intl/lang/sq.json b/plugins/Intl/lang/sq.json index 322648a158..6baa55d142 100644 --- a/plugins/Intl/lang/sq.json +++ b/plugins/Intl/lang/sq.json @@ -398,6 +398,7 @@ "Language_yo": "Jorubisht", "Language_zh": "Kinezisht", "Language_zu": "Zulu", + "LayoutDirection": "ltr", "LongDay_1": "E hënë", "LongDay_2": "E martë", "LongDay_3": "E mërkurë", diff --git a/plugins/Intl/lang/sr.json b/plugins/Intl/lang/sr.json index f2f532e5bc..11ca72d7cf 100644 --- a/plugins/Intl/lang/sr.json +++ b/plugins/Intl/lang/sr.json @@ -448,6 +448,7 @@ "Language_za": "Жуанг", "Language_zh": "Кинески", "Language_zu": "Зулу", + "LayoutDirection": "ltr", "LongDay_1": "Понедељак", "LongDay_2": "Уторак", "LongDay_3": "Среда", diff --git a/plugins/Intl/lang/sv.json b/plugins/Intl/lang/sv.json index d4ac2d52d1..ba175d0394 100644 --- a/plugins/Intl/lang/sv.json +++ b/plugins/Intl/lang/sv.json @@ -448,6 +448,7 @@ "Language_za": "Zhuang", "Language_zh": "Kinesiska", "Language_zu": "Zulu", + "LayoutDirection": "ltr", "LongDay_1": "Måndag", "LongDay_2": "Tisdag", "LongDay_3": "Onsdag", diff --git a/plugins/Intl/lang/ta.json b/plugins/Intl/lang/ta.json index 4a94442e48..8ccc55e71b 100644 --- a/plugins/Intl/lang/ta.json +++ b/plugins/Intl/lang/ta.json @@ -448,6 +448,7 @@ "Language_za": "ஜுவாங்", "Language_zh": "சீனம்", "Language_zu": "ஜுலு", + "LayoutDirection": "ltr", "LongDay_1": "திங்கள்", "LongDay_2": "செவ்வாய்", "LongDay_3": "புதன்", diff --git a/plugins/Intl/lang/te.json b/plugins/Intl/lang/te.json index 2164ab1938..0187d7410d 100644 --- a/plugins/Intl/lang/te.json +++ b/plugins/Intl/lang/te.json @@ -448,6 +448,7 @@ "Language_za": "జువాన్", "Language_zh": "చైనీస్", "Language_zu": "జూలూ", + "LayoutDirection": "ltr", "LongDay_1": "సోమవారం", "LongDay_2": "మంగళవారం", "LongDay_3": "బుధవారం", diff --git a/plugins/Intl/lang/th.json b/plugins/Intl/lang/th.json index 5dc4deabac..b65f4eb89a 100644 --- a/plugins/Intl/lang/th.json +++ b/plugins/Intl/lang/th.json @@ -448,6 +448,7 @@ "Language_za": "จ้วง", "Language_zh": "จีน", "Language_zu": "ซูลู", + "LayoutDirection": "ltr", "LongDay_1": "วันจันทร์", "LongDay_2": "วันอังคาร", "LongDay_3": "วันพุธ", diff --git a/plugins/Intl/lang/tl.json b/plugins/Intl/lang/tl.json index e2f6d48c9a..7dc917659d 100644 --- a/plugins/Intl/lang/tl.json +++ b/plugins/Intl/lang/tl.json @@ -416,6 +416,7 @@ "Language_yo": "Yoruba", "Language_zh": "Chinese", "Language_zu": "Zulu", + "LayoutDirection": "ltr", "LongDay_1": "Lunes", "LongDay_2": "Martes", "LongDay_3": "Miyerkules", diff --git a/plugins/Intl/lang/tr.json b/plugins/Intl/lang/tr.json index 526fcc48f4..157390a3b6 100644 --- a/plugins/Intl/lang/tr.json +++ b/plugins/Intl/lang/tr.json @@ -448,6 +448,7 @@ "Language_za": "Zhuang", "Language_zh": "Çince", "Language_zu": "Zuluca", + "LayoutDirection": "ltr", "LongDay_1": "Pazartesi", "LongDay_2": "Salı", "LongDay_3": "Çarşamba", diff --git a/plugins/Intl/lang/uk.json b/plugins/Intl/lang/uk.json index 1fa384b2b4..55a3930ad9 100644 --- a/plugins/Intl/lang/uk.json +++ b/plugins/Intl/lang/uk.json @@ -448,6 +448,7 @@ "Language_za": "Чжуан", "Language_zh": "Китайська", "Language_zu": "Зулуська", + "LayoutDirection": "ltr", "LongDay_1": "Понеділок", "LongDay_2": "Вівторок", "LongDay_3": "Середа", diff --git a/plugins/Intl/lang/vi.json b/plugins/Intl/lang/vi.json index abb8200b7c..0f1c0c4c8b 100644 --- a/plugins/Intl/lang/vi.json +++ b/plugins/Intl/lang/vi.json @@ -448,6 +448,7 @@ "Language_za": "Tiếng Zhuang", "Language_zh": "Tiếng Trung", "Language_zu": "Tiếng Zulu", + "LayoutDirection": "ltr", "LongDay_1": "Thứ Hai", "LongDay_2": "Thứ Ba", "LongDay_3": "Thứ Tư", diff --git a/plugins/Intl/lang/zh-cn.json b/plugins/Intl/lang/zh-cn.json index 0d0c7ace95..626db0be3b 100644 --- a/plugins/Intl/lang/zh-cn.json +++ b/plugins/Intl/lang/zh-cn.json @@ -448,6 +448,7 @@ "Language_za": "壮文", "Language_zh": "中文", "Language_zu": "祖鲁文", + "LayoutDirection": "ltr", "LongDay_1": "星期一", "LongDay_2": "星期二", "LongDay_3": "星期三", diff --git a/plugins/Intl/lang/zh-tw.json b/plugins/Intl/lang/zh-tw.json index 439c976d6b..dbcfef5968 100644 --- a/plugins/Intl/lang/zh-tw.json +++ b/plugins/Intl/lang/zh-tw.json @@ -448,6 +448,7 @@ "Language_za": "壯文", "Language_zh": "中文", "Language_zu": "祖魯文", + "LayoutDirection": "ltr", "LongDay_1": "星期一", "LongDay_2": "星期二", "LongDay_3": "星期三", diff --git a/plugins/LanguagesManager/Test/Unit/TranslationWriter/Validate/CoreTranslationsTest.php b/plugins/LanguagesManager/Test/Unit/TranslationWriter/Validate/CoreTranslationsTest.php index cd0ed02093..2b25f14f5b 100644 --- a/plugins/LanguagesManager/Test/Unit/TranslationWriter/Validate/CoreTranslationsTest.php +++ b/plugins/LanguagesManager/Test/Unit/TranslationWriter/Validate/CoreTranslationsTest.php @@ -73,21 +73,9 @@ class CoreTranslationsTest extends \PHPUnit_Framework_TestCase array( array( 'General' => array( - 'Locale' => 'de_DE.UTF-8', - 'TranslatorName' => 'name', - 'TranslatorEmail' => 'emails', - 'LayoutDirection' => 'afd' - ) - ), - CoreTranslations::ERRORSTATE_LAYOUTDIRECTIONINVALID - ), - array( - array( - 'General' => array( 'Locale' => 'invalid', 'TranslatorName' => 'name', 'TranslatorEmail' => 'emails', - 'LayoutDirection' => 'ltr' ) ), CoreTranslations::ERRORSTATE_LOCALEINVALID @@ -98,7 +86,6 @@ class CoreTranslationsTest extends \PHPUnit_Framework_TestCase 'Locale' => 'xx_DE.UTF-8', 'TranslatorName' => 'name', 'TranslatorEmail' => 'emails', - 'LayoutDirection' => 'ltr' ) ), CoreTranslations::ERRORSTATE_LOCALEINVALIDLANGUAGE @@ -109,7 +96,6 @@ class CoreTranslationsTest extends \PHPUnit_Framework_TestCase 'Locale' => 'de_XX.UTF-8', 'TranslatorName' => 'name', 'TranslatorEmail' => 'emails', - 'LayoutDirection' => 'ltr' ) ), CoreTranslations::ERRORSTATE_LOCALEINVALIDCOUNTRY diff --git a/plugins/LanguagesManager/Test/Unit/TranslationWriter/WriterTest.php b/plugins/LanguagesManager/Test/Unit/TranslationWriter/WriterTest.php index 00966cbe95..69f7f457e7 100644 --- a/plugins/LanguagesManager/Test/Unit/TranslationWriter/WriterTest.php +++ b/plugins/LanguagesManager/Test/Unit/TranslationWriter/WriterTest.php @@ -105,10 +105,6 @@ class WriterTest extends \PHPUnit_Framework_TestCase array(array('General' => array('Locale' => 'de_DE.UTF-8')) + $translations, CoreTranslations::ERRORSTATE_TRANSLATORINFOREQUIRED), array(array('General' => array('Locale' => 'de_DE.UTF-8', 'TranslatorName' => 'name')) + $translations, CoreTranslations::ERRORSTATE_TRANSLATOREMAILREQUIRED), - array(array('General' => array('Locale' => 'de_DE.UTF-8', - 'TranslatorName' => 'name', - 'TranslatorEmail' => 'name@domain.com', - 'LayoutDirection' => 'fail')) + $translations, CoreTranslations::ERRORSTATE_LAYOUTDIRECTIONINVALID), array(array('General' => array('Locale' => 'invalid', 'TranslatorName' => 'name', 'TranslatorEmail' => 'name@domain.com')) + $translations, CoreTranslations::ERRORSTATE_LOCALEINVALID), diff --git a/plugins/LanguagesManager/TranslationWriter/Validate/CoreTranslations.php b/plugins/LanguagesManager/TranslationWriter/Validate/CoreTranslations.php index 5da73db3f1..4c4fa065aa 100644 --- a/plugins/LanguagesManager/TranslationWriter/Validate/CoreTranslations.php +++ b/plugins/LanguagesManager/TranslationWriter/Validate/CoreTranslations.php @@ -21,7 +21,6 @@ class CoreTranslations extends ValidateAbstract const ERRORSTATE_LOCALEREQUIRED = 'Locale required'; const ERRORSTATE_TRANSLATORINFOREQUIRED = 'Translator info required'; const ERRORSTATE_TRANSLATOREMAILREQUIRED = 'Translator email required'; - const ERRORSTATE_LAYOUTDIRECTIONINVALID = 'Layout direction must be rtl or ltr'; const ERRORSTATE_LOCALEINVALID = 'Locale is invalid'; const ERRORSTATE_LOCALEINVALIDLANGUAGE = 'Locale is invalid - invalid language code'; const ERRORSTATE_LOCALEINVALIDCOUNTRY = 'Locale is invalid - invalid country code'; @@ -40,9 +39,8 @@ class CoreTranslations extends ValidateAbstract /** * Validates the given translations - * * There need to be more than 250 translations presen + * * There need to be more than 250 translations present * * Locale, TranslatorName and TranslatorEmail needs to be set in plugin General - * * LayoutDirection needs to be ltr or rtl if present * * Locale must be valid (format, language & country) * * @param array $translations @@ -68,13 +66,6 @@ class CoreTranslations extends ValidateAbstract return false; } - if (!empty($translations['General']['LayoutDirection']) && - !in_array($translations['General']['LayoutDirection'], array('ltr', 'rtl')) - ) { - $this->message = self::ERRORSTATE_LAYOUTDIRECTIONINVALID; - return false; - } - /** @var LanguageDataProvider $languageDataProvider */ $languageDataProvider = StaticContainer::get('Piwik\Intl\Data\Provider\LanguageDataProvider'); /** @var RegionDataProvider $regionDataProvider */ |