From 43bdac67fcd61408a77ccbb8c2ac10ce26787958 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Wed, 22 Mar 2023 18:24:14 -0700 Subject: [PATCH 01/24] Update to tz2023a --- js/data/locale/zoneinfo/Africa/Cairo.json | 16 ++++++++++++++-- js/data/locale/zoneinfo/Africa/Casablanca.json | 4 ++-- js/data/locale/zoneinfo/Africa/El_Aaiun.json | 4 ++-- js/data/locale/zoneinfo/America/Nuuk.json | 16 ++++++++++++++-- js/data/locale/zoneinfo/America/Santiago.json | 2 +- js/data/locale/zoneinfo/Asia/Gaza.json | 6 +++--- js/data/locale/zoneinfo/Asia/Hebron.json | 6 +++--- js/data/locale/zoneinfo/Chile/Continental.json | 2 +- js/data/locale/zoneinfo/Europe/Kirov.json | 2 +- js/data/locale/zoneinfo/Europe/Volgograd.json | 2 +- js/data/locale/zoneinfo/Pacific/Apia.json | 5 ----- js/data/locale/zoneinfo/Pacific/Easter.json | 2 +- js/data/locale/zoneinfo/Pacific/Fiji.json | 5 ----- js/test/date/testdate.js | 13 +++++++------ js/test/date/testdatefmt_ar_EG.js | 2 +- 15 files changed, 51 insertions(+), 36 deletions(-) diff --git a/js/data/locale/zoneinfo/Africa/Cairo.json b/js/data/locale/zoneinfo/Africa/Cairo.json index 915f28b19c..5a358ba1a6 100644 --- a/js/data/locale/zoneinfo/Africa/Cairo.json +++ b/js/data/locale/zoneinfo/Africa/Cairo.json @@ -1,6 +1,18 @@ { "c": "EG", - "f": "EEST", + "e": { + "m": 10, + "r": "l5", + "t": "0:0" + }, + "f": "EE{c}T", "n": "Egypt {c} Time", - "o": "2:0" + "o": "2:0", + "s": { + "c": "S", + "m": 4, + "r": "l5", + "t": "0:0", + "v": "1:0" + } } \ No newline at end of file diff --git a/js/data/locale/zoneinfo/Africa/Casablanca.json b/js/data/locale/zoneinfo/Africa/Casablanca.json index 2e973e4463..d0b109df9c 100644 --- a/js/data/locale/zoneinfo/Africa/Casablanca.json +++ b/js/data/locale/zoneinfo/Africa/Casablanca.json @@ -1,8 +1,8 @@ { "c": "MA", "e": { - "m": 5, - "r": "8", + "m": 4, + "r": "23", "t": "2:0" }, "f": "+01/+00", diff --git a/js/data/locale/zoneinfo/Africa/El_Aaiun.json b/js/data/locale/zoneinfo/Africa/El_Aaiun.json index 1ce799d290..79791a6a5b 100644 --- a/js/data/locale/zoneinfo/Africa/El_Aaiun.json +++ b/js/data/locale/zoneinfo/Africa/El_Aaiun.json @@ -1,8 +1,8 @@ { "c": "EH", "e": { - "m": 5, - "r": "8", + "m": 4, + "r": "23", "t": "2:0" }, "f": "+01/+00", diff --git a/js/data/locale/zoneinfo/America/Nuuk.json b/js/data/locale/zoneinfo/America/Nuuk.json index 8926ebb2d4..14c1691fcd 100644 --- a/js/data/locale/zoneinfo/America/Nuuk.json +++ b/js/data/locale/zoneinfo/America/Nuuk.json @@ -1,6 +1,18 @@ { "c": "GL", - "f": "-02", + "e": { + "m": 10, + "r": "l0", + "t": "0:0" + }, + "f": "-02/-01", "n": "Greenland {c} Time", - "o": "-2:0" + "o": "-2:0", + "s": { + "c": "S", + "m": 3, + "r": "l6", + "t": "23:0", + "v": "1:0" + } } \ No newline at end of file diff --git a/js/data/locale/zoneinfo/America/Santiago.json b/js/data/locale/zoneinfo/America/Santiago.json index b489f0b298..54883cb715 100644 --- a/js/data/locale/zoneinfo/America/Santiago.json +++ b/js/data/locale/zoneinfo/America/Santiago.json @@ -10,7 +10,7 @@ "o": "-4:0", "s": { "m": 9, - "r": "0>9", + "r": "0>2", "t": "0:0", "v": "1:0" } diff --git a/js/data/locale/zoneinfo/Asia/Gaza.json b/js/data/locale/zoneinfo/Asia/Gaza.json index 682c3d4fda..100f54d042 100644 --- a/js/data/locale/zoneinfo/Asia/Gaza.json +++ b/js/data/locale/zoneinfo/Asia/Gaza.json @@ -10,9 +10,9 @@ "o": "2:0", "s": { "c": "S", - "m": 3, - "r": "27", - "t": "0:0", + "m": 4, + "r": "29", + "t": "2:0", "v": "1:0" } } \ No newline at end of file diff --git a/js/data/locale/zoneinfo/Asia/Hebron.json b/js/data/locale/zoneinfo/Asia/Hebron.json index 682c3d4fda..100f54d042 100644 --- a/js/data/locale/zoneinfo/Asia/Hebron.json +++ b/js/data/locale/zoneinfo/Asia/Hebron.json @@ -10,9 +10,9 @@ "o": "2:0", "s": { "c": "S", - "m": 3, - "r": "27", - "t": "0:0", + "m": 4, + "r": "29", + "t": "2:0", "v": "1:0" } } \ No newline at end of file diff --git a/js/data/locale/zoneinfo/Chile/Continental.json b/js/data/locale/zoneinfo/Chile/Continental.json index 09a2ad733c..0184e110e1 100644 --- a/js/data/locale/zoneinfo/Chile/Continental.json +++ b/js/data/locale/zoneinfo/Chile/Continental.json @@ -9,7 +9,7 @@ "o": "-4:0", "s": { "m": 9, - "r": "0>9", + "r": "0>2", "t": "0:0", "v": "1:0" } diff --git a/js/data/locale/zoneinfo/Europe/Kirov.json b/js/data/locale/zoneinfo/Europe/Kirov.json index d9a66ca03f..61b24cee81 100644 --- a/js/data/locale/zoneinfo/Europe/Kirov.json +++ b/js/data/locale/zoneinfo/Europe/Kirov.json @@ -1,6 +1,6 @@ { "c": "RU", - "f": "+03", + "f": "MSK", "n": "Russian {c} Time", "o": "3:0" } \ No newline at end of file diff --git a/js/data/locale/zoneinfo/Europe/Volgograd.json b/js/data/locale/zoneinfo/Europe/Volgograd.json index d0a0de9058..bed650bc81 100644 --- a/js/data/locale/zoneinfo/Europe/Volgograd.json +++ b/js/data/locale/zoneinfo/Europe/Volgograd.json @@ -1,6 +1,6 @@ { "c": "RU", - "f": "+03", + "f": "MSK", "n": "Volgograd {c} Time", "o": "3:0" } \ No newline at end of file diff --git a/js/data/locale/zoneinfo/Pacific/Apia.json b/js/data/locale/zoneinfo/Pacific/Apia.json index deab05c468..4e6c159601 100644 --- a/js/data/locale/zoneinfo/Pacific/Apia.json +++ b/js/data/locale/zoneinfo/Pacific/Apia.json @@ -1,10 +1,5 @@ { "c": "WS", - "e": { - "m": 4, - "r": "0>1", - "t": "4:0" - }, "f": "+13/+14", "n": "Samoa {c} Time", "o": "13:0" diff --git a/js/data/locale/zoneinfo/Pacific/Easter.json b/js/data/locale/zoneinfo/Pacific/Easter.json index 61a17d5473..8961dab39c 100644 --- a/js/data/locale/zoneinfo/Pacific/Easter.json +++ b/js/data/locale/zoneinfo/Pacific/Easter.json @@ -10,7 +10,7 @@ "o": "-6:0", "s": { "m": 9, - "r": "0>8", + "r": "0>1", "t": "22:0", "v": "1:0" } diff --git a/js/data/locale/zoneinfo/Pacific/Fiji.json b/js/data/locale/zoneinfo/Pacific/Fiji.json index 16dc5752b2..fd9f239344 100644 --- a/js/data/locale/zoneinfo/Pacific/Fiji.json +++ b/js/data/locale/zoneinfo/Pacific/Fiji.json @@ -1,10 +1,5 @@ { "c": "FJ", - "e": { - "m": 1, - "r": "0>12", - "t": "3:0" - }, "f": "+12/+13", "n": "Fiji {c} Time", "o": "12:0" diff --git a/js/test/date/testdate.js b/js/test/date/testdate.js index 1ab284c4dc..e7575aea39 100644 --- a/js/test/date/testdate.js +++ b/js/test/date/testdate.js @@ -1,7 +1,7 @@ /* * testdate.js - test the date object * - * Copyright © 2012-2015,2017,2021-2022 JEDLSoft + * Copyright © 2012-2015,2017,2021-2023 JEDLSoft * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -412,13 +412,14 @@ module.exports.testdate = { }, testDstStartBoundary_Santiago: function(test) { test.expect(2); - var boundaryiLib = DateFactory({year: 2020,month: 9,day: 13,hour: 0,minute: 0,second: 0,timezone: "America/Santiago"}); + var boundaryiLib = DateFactory({year: 2023, month: 9, day: 3, hour: 0, minute: 0, second: 0, timezone: "America/Santiago"}); // we can't set time zone to Date object, so compare with constant value - // 1599969600000: new Date(2020, 8, 6, 0, 0, 0).getTime() with Santiago local time - test.equal(boundaryiLib.getTimeExtended(), 1599969600000); - var ildMyBday = DateFactory({unixtime: 1599969600000}); + // was 1694318400000: new Date(2023, 9, 11, 0, 0, 0).getTime() with Santiago local time + // now 1693713600000: new Date(2023, 9, 3, 0, 0, 0).getTime() with Santiago local time + test.equal(boundaryiLib.getTimeExtended(), 1693713600000); + var ildMyBday = DateFactory({unixtime: 1693713600000}); var fmt = new DateFmt({length: "short", type:"datetime",locale:"es-CL", timezone:"America/Santiago"}); - test.equal(fmt.format(ildMyBday), "13-09-20, 01:00"); + test.equal(fmt.format(ildMyBday), "03-09-23, 01:00"); test.done(); }, diff --git a/js/test/date/testdatefmt_ar_EG.js b/js/test/date/testdatefmt_ar_EG.js index 0994be14cc..fcc3b15481 100644 --- a/js/test/date/testdatefmt_ar_EG.js +++ b/js/test/date/testdatefmt_ar_EG.js @@ -1394,7 +1394,7 @@ module.exports.testdatefmt_ar_EG = { second:37, millisecond: 0 }); - test.equal(fmt.format(date), "‏١:٤٥:٣٧ EEST"); + test.equal(fmt.format(date), "‏١:٤٥:٣٧ EET"); test.done(); }, testDateFmtFormatRelativeWithinMinuteAfter_ar_EG: function(test) { From 4adb053520b809c231c21dcdd966bfd6543306de Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Wed, 22 Mar 2023 18:27:35 -0700 Subject: [PATCH 02/24] Update version number and rel notes --- build.properties | 2 +- docs/ReleaseNotes.md | 7 +++++++ package.json | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/build.properties b/build.properties index ef345fbe09..6ac74ac52e 100644 --- a/build.properties +++ b/build.properties @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -version=14.17.0 +version=14.17.1 diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index 9c7d6f1c42..4f47d06780 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -1,6 +1,13 @@ Release Notes for Version 14 ============================ +Build 027 +------- +Published as version 14.17.1 + +Bug Fixes: +* Updated to IANA time zone data version 2023a + Build 026 ------- Published as version 14.17.0 diff --git a/package.json b/package.json index da97e74a74..76d8c622a8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ilib", - "version": "14.17.0", + "version": "14.17.1", "main": "js/index.js", "description": "iLib is a cross-engine library of internationalization (i18n) classes written in pure JS", "keywords": [ From 960ae939fa870fd8dfaf730da1ffa97a64fe4861 Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Thu, 23 Mar 2023 21:31:01 -0700 Subject: [PATCH 03/24] Update to tz 2023b --- docs/ReleaseNotes.md | 2 +- js/data/locale/zoneinfo/Asia/Beirut.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index 4f47d06780..44e6ffe4f5 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -6,7 +6,7 @@ Build 027 Published as version 14.17.1 Bug Fixes: -* Updated to IANA time zone data version 2023a +* Updated to IANA time zone data version 2023b Build 026 ------- diff --git a/js/data/locale/zoneinfo/Asia/Beirut.json b/js/data/locale/zoneinfo/Asia/Beirut.json index 65e5292877..9fc34e2f97 100644 --- a/js/data/locale/zoneinfo/Asia/Beirut.json +++ b/js/data/locale/zoneinfo/Asia/Beirut.json @@ -10,8 +10,8 @@ "o": "2:0", "s": { "c": "S", - "m": 3, - "r": "l0", + "m": 4, + "r": "21", "t": "0:0", "v": "1:0" } From 1b0074fbee83ef4ae601b9ee2099a1f704443024 Mon Sep 17 00:00:00 2001 From: Goun Lee Date: Thu, 29 Jun 2023 14:11:04 +0900 Subject: [PATCH 04/24] Add more pseudomap.json files to test more pseuo localization --- docs/ReleaseNotes.md | 6 ++- js/data/locale/as/pseudomap.json | 43 ++++++++++++++++++ js/data/locale/bn/pseudomap.json | 43 ++++++++++++++++++ js/data/locale/gu/pseudomap.json | 45 ++++++++++++++++++ js/data/locale/hi/pseudomap.json | 51 +++++++++++++++++++++ js/data/locale/ka/pseudomap.json | 55 ++++++++++++++++++++++ js/data/locale/km/pseudomap.json | 55 ++++++++++++++++++++++ js/data/locale/kn/pseudomap.json | 55 ++++++++++++++++++++++ js/data/locale/ml/pseudomap.json | 45 ++++++++++++++++++ js/data/locale/mr/pseudomap.json | 51 +++++++++++++++++++++ js/data/locale/or/pseudomap.json | 55 ++++++++++++++++++++++ js/data/locale/pa/pseudomap.json | 49 ++++++++++++++++++++ js/data/locale/si/pseudomap.json | 55 ++++++++++++++++++++++ js/data/locale/ta/pseudomap.json | 45 ++++++++++++++++++ js/data/locale/te/pseudomap.json | 45 ++++++++++++++++++ js/lib/ResBundle.js | 4 ++ js/test/root/testresources.js | 78 +++++++++++++++++++++++++++++++- package.json | 2 +- 18 files changed, 779 insertions(+), 3 deletions(-) create mode 100644 js/data/locale/as/pseudomap.json create mode 100644 js/data/locale/bn/pseudomap.json create mode 100644 js/data/locale/gu/pseudomap.json create mode 100644 js/data/locale/hi/pseudomap.json create mode 100644 js/data/locale/ka/pseudomap.json create mode 100644 js/data/locale/km/pseudomap.json create mode 100644 js/data/locale/kn/pseudomap.json create mode 100644 js/data/locale/ml/pseudomap.json create mode 100644 js/data/locale/mr/pseudomap.json create mode 100644 js/data/locale/or/pseudomap.json create mode 100644 js/data/locale/pa/pseudomap.json create mode 100644 js/data/locale/si/pseudomap.json create mode 100644 js/data/locale/ta/pseudomap.json create mode 100644 js/data/locale/te/pseudomap.json diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index 44e6ffe4f5..08f69a99f9 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -3,7 +3,11 @@ Release Notes for Version 14 Build 027 ------- -Published as version 14.17.1 +Published as version 14.18.0 +New Features: +* Added more pseudomap data to test by adding pseudoLocale. + * Added tall properly in some pseudo map data which is the tallest glyphs in the script + and it is going to be included first in a pseudo string. Bug Fixes: * Updated to IANA time zone data version 2023b diff --git a/js/data/locale/as/pseudomap.json b/js/data/locale/as/pseudomap.json new file mode 100644 index 0000000000..3500248bd6 --- /dev/null +++ b/js/data/locale/as/pseudomap.json @@ -0,0 +1,43 @@ +{ + "a": "আ", + "b": "ব", + "c": "চ", + "d": "ড", + "e": "এ", + "g": "গ", + "h": "হ", + "i": "ই", + "j": "য", + "k": "ক", + "l": "ল", + "m": "ম", + "n": "ন", + "o": "ও", + "p": "প", + "r": "র", + "s": "শ", + "t": "ত", + "u": "উ", + "y": "য়", + "A": "আ", + "B": "ব", + "C": "চ", + "D": "ড", + "E": "এ", + "G": "গ", + "H": "হ", + "I": "ই", + "J": "য", + "K": "ক", + "L": "ল", + "M": "ম", + "N": "ন", + "O": "ও", + "P": "প", + "R": "র", + "S": "শ", + "T": "ত", + "U": "উ", + "Y": "য়", + "tall": "ঠ্ড়ি" +} diff --git a/js/data/locale/bn/pseudomap.json b/js/data/locale/bn/pseudomap.json new file mode 100644 index 0000000000..3500248bd6 --- /dev/null +++ b/js/data/locale/bn/pseudomap.json @@ -0,0 +1,43 @@ +{ + "a": "আ", + "b": "ব", + "c": "চ", + "d": "ড", + "e": "এ", + "g": "গ", + "h": "হ", + "i": "ই", + "j": "য", + "k": "ক", + "l": "ল", + "m": "ম", + "n": "ন", + "o": "ও", + "p": "প", + "r": "র", + "s": "শ", + "t": "ত", + "u": "উ", + "y": "য়", + "A": "আ", + "B": "ব", + "C": "চ", + "D": "ড", + "E": "এ", + "G": "গ", + "H": "হ", + "I": "ই", + "J": "য", + "K": "ক", + "L": "ল", + "M": "ম", + "N": "ন", + "O": "ও", + "P": "প", + "R": "র", + "S": "শ", + "T": "ত", + "U": "উ", + "Y": "য়", + "tall": "ঠ্ড়ি" +} diff --git a/js/data/locale/gu/pseudomap.json b/js/data/locale/gu/pseudomap.json new file mode 100644 index 0000000000..2539baaa6f --- /dev/null +++ b/js/data/locale/gu/pseudomap.json @@ -0,0 +1,45 @@ +{ + "a": "અ", + "b": "બ", + "c": "ચ", + "d": "દ", + "e": "એ", + "g": "ગ", + "h": "હ", + "i": "ઇ", + "j": "જ", + "k": "ક", + "l": "લ", + "m": "ં", + "n": "ઙ", + "o": "ઓ", + "p": "પ", + "r": "ૃ", + "s": "ષ", + "t": "ત", + "u": "ઉ", + "v": "વ", + "y": "ય", + "A": "અ", + "B": "બ", + "C": "ચ", + "D": "દ", + "E": "એ", + "G": "ગ", + "H": "હ", + "I": "ઇ", + "J": "જ", + "K": "ક", + "L": "લ", + "M": "ં", + "N": "ણ", + "O": "ઓ", + "P": "પ", + "R": "ૃ", + "S": "સ", + "T": "ત", + "U": "ઉ", + "V": "વ", + "Y": "ય", + "tall": "ઈૄ" +} diff --git a/js/data/locale/hi/pseudomap.json b/js/data/locale/hi/pseudomap.json new file mode 100644 index 0000000000..dc5c2223ee --- /dev/null +++ b/js/data/locale/hi/pseudomap.json @@ -0,0 +1,51 @@ +{ + "a": "अ", + "b": "ब", + "c": "च", + "d": "ड", + "e": "ए", + "f": "फ़", + "g": "ग", + "h": "ह", + "i": "इ", + "j": "ज", + "k": "क", + "l": "ल", + "m": "म", + "n": "न", + "o": "ओ", + "p": "प", + "q": "क़", + "r": "ऱ", + "s": "स", + "t": "ट", + "u": "उ", + "v": "य", + "y": "य़", + "z": "ज़", + "A": "आ", + "B": "ब", + "C": "च", + "D": "ड", + "E": "ऎ", + "F": "फ", + "g": "ग़", + "H": "ह", + "I": "इ", + "J": "झ", + "K": "ख", + "L": "ऌ", + "M": "म", + "N": "ञ", + "O": "ऑ", + "P": "प", + "Q": "क़", + "R": "ॠ", + "S": "श", + "T": "ठ", + "U": "उ", + "V": "य", + "Y": "य़", + "Z": "ज़", + "tall": "ई़ॄ" +} diff --git a/js/data/locale/ka/pseudomap.json b/js/data/locale/ka/pseudomap.json new file mode 100644 index 0000000000..afd8a3381f --- /dev/null +++ b/js/data/locale/ka/pseudomap.json @@ -0,0 +1,55 @@ +{ + "a": "ა", + "A": "ა", + "b": "ბ", + "B": "ბ", + "c": "ც", + "C": "ჩ", + "d": "დ", + "D": "ძ", + "e": "ე", + "E": "ჱ", + "f": "ჶ", + "F": "ჶ", + "g": "გ", + "G": "ღ", + "h": "ჰ", + "H": "ჰ", + "i": "ი", + "I": "ი", + "j": "ჯ", + "J": "ჭ ", + "k": "ქ", + "K": "კ", + "l": "ლ", + "L": "ლ", + "m": "მ", + "m": "მ", + "n": "ნ", + "n": "ნ", + "o": "ო", + "O": "ჵ", + "p": "ფ", + "P": "პ", + "q": "ჴ", + "Q": "ყ ", + "r": "რ", + "R": "რ", + "s": "ს", + "S": "შ", + "t": "თ", + "T": "ტ", + "u": "უ", + "U": "უ", + "v": "ვ", + "V": "ვ", + "w": "ჳ ", + "W": "ჳ ", + "x": "ხ", + "X": "წ ", + "y": "ჲ", + "Y": "ჲ", + "z": "ზ", + "Z": "ჟ", + "tall": "Ა̄̈ⴁ" +} diff --git a/js/data/locale/km/pseudomap.json b/js/data/locale/km/pseudomap.json new file mode 100644 index 0000000000..4764e1e452 --- /dev/null +++ b/js/data/locale/km/pseudomap.json @@ -0,0 +1,55 @@ +{ + "a": "អ", + "b": "ព", + "c": "ច", + "d": "ទ", + "é": "ឯ", + "f": "ឆ", + "g": "គ", + "h": "ហ", + "i": "ឥ", + "j": "ជ", + "k": "ក", + "l": "ល", + "m": "ម", + "n": "ណ", + "o": "ឱ", + "p": "ប", + "q": "ឆ", + "r": "រ", + "s": "ស", + "t": "ត", + "u": "ឧ", + "v": "វ", + "w": "ឪ", + "x": "ឞ", + "y": "យ", + "z": "ឈ", + "A": "អ", + "B": "ព", + "C": "ច", + "D": "ទ", + "E": "ឯ", + "F": "ឆ", + "G": "គ", + "H": "ហ", + "I": "ឥ", + "J": "ជ", + "K": "ក", + "L": "ល", + "M": "ម", + "N": "ណ", + "O": "ឱ", + "P": "ប", + "Q": "ឆ", + "R": "រ", + "S": "ស", + "T": "ត", + "U": "ឧ", + "V": "វ", + "W": "ឪ", + "X": "ឞ", + "Y": "យ", + "Z": "ឈ", + "tall": "᧥ញុ" +} diff --git a/js/data/locale/kn/pseudomap.json b/js/data/locale/kn/pseudomap.json new file mode 100644 index 0000000000..2c04249983 --- /dev/null +++ b/js/data/locale/kn/pseudomap.json @@ -0,0 +1,55 @@ +{ + "a": "ಅ ", + "A": "ಆ ", + "b": "ಬ ", + "B": "ಭ ", + "c": "ಚ ", + "C": "ಛ ", + "d": "ದ ", + "D": "ಡ ", + "e": "ಎ ", + "E": "ಏ ", + "f": "ಫ ", + "F": "ಫ ", + "g": "ಗ ", + "G": "ಘ ", + "h": "ಹ ", + "H": "ಹ ", + "i": "ಇ ", + "I": "ಈ ", + "j": "ಜ ", + "J": "ಜ ", + "k": "ಕ ", + "K": "ಕ ", + "l": "ಲ ", + "L": "ೡ ", + "m": "ಮ ", + "M": "ಮ ", + "n": "ನ ", + "N": "ಙ ", + "o": "ಒ ", + "O": "ಓ ", + "p": "ಪ ", + "P": "ಪ ", + "q": "ಖ ", + "Q": "ಖ ", + "r": "ರ ", + "R": "ಱ ", + "s": "ಸ ", + "S": "ಶ ", + "t": "ತ ", + "T": "ಥ ", + "u": "ಉ ", + "U": "ಊ ", + "v": "ವ ", + "V": "ವ ", + "w": "ಐ ", + "W": "ಔ ", + "x": "ಷ ", + "X": "ಷ ", + "y": "ಯ ", + "Y": "ಯ ", + "z": "ಝ ", + "Z": "ಝ ", + "tall": "ಞೌ" +} diff --git a/js/data/locale/ml/pseudomap.json b/js/data/locale/ml/pseudomap.json new file mode 100644 index 0000000000..c0e20b864f --- /dev/null +++ b/js/data/locale/ml/pseudomap.json @@ -0,0 +1,45 @@ +{ + "a": "അ", + "b": "ബ", + "c": "ച", + "d": "ധ", + "e": "എ", + "g": "ഗ", + "h": "ഹ", + "i": "ഇ", + "j": "ജ", + "k": "ക", + "l": "ല", + "m": "മ", + "n": "ങ", + "o": "എ", + "p": "പ", + "r": "ൃ", + "s": "സ", + "t": "ട", + "u": "ഉ", + "v": "വ", + "y": "യ", + "A": "അ", + "B": "ബ", + "C": "ഛ", + "D": "ധ", + "E": "എ", + "G": "ഗ", + "H": "ഹ", + "I": "ഇ", + "J": "ജ", + "K": "ക", + "L": "ല", + "M": "മ", + "N": "ങ", + "O": "എ", + "P": "പ", + "R": "ൃ", + "S": "സ", + "T": "ട", + "U": "ഉ", + "V": "വ", + "Y": "യ", + "tall": "അ്അൣ" +} diff --git a/js/data/locale/mr/pseudomap.json b/js/data/locale/mr/pseudomap.json new file mode 100644 index 0000000000..dc5c2223ee --- /dev/null +++ b/js/data/locale/mr/pseudomap.json @@ -0,0 +1,51 @@ +{ + "a": "अ", + "b": "ब", + "c": "च", + "d": "ड", + "e": "ए", + "f": "फ़", + "g": "ग", + "h": "ह", + "i": "इ", + "j": "ज", + "k": "क", + "l": "ल", + "m": "म", + "n": "न", + "o": "ओ", + "p": "प", + "q": "क़", + "r": "ऱ", + "s": "स", + "t": "ट", + "u": "उ", + "v": "य", + "y": "य़", + "z": "ज़", + "A": "आ", + "B": "ब", + "C": "च", + "D": "ड", + "E": "ऎ", + "F": "फ", + "g": "ग़", + "H": "ह", + "I": "इ", + "J": "झ", + "K": "ख", + "L": "ऌ", + "M": "म", + "N": "ञ", + "O": "ऑ", + "P": "प", + "Q": "क़", + "R": "ॠ", + "S": "श", + "T": "ठ", + "U": "उ", + "V": "य", + "Y": "य़", + "Z": "ज़", + "tall": "ई़ॄ" +} diff --git a/js/data/locale/or/pseudomap.json b/js/data/locale/or/pseudomap.json new file mode 100644 index 0000000000..d130bc01b9 --- /dev/null +++ b/js/data/locale/or/pseudomap.json @@ -0,0 +1,55 @@ +{ + "a": "ଏ", + "b": "ବି", + "c": "ସି", + "d": "ଡ଼", + "e": "ଏ", + "f": "ଫଁ", + "g": "ଗ", + "h": "ହଁ", + "i": "ଇ", + "j": "ଜେ", + "k": "କ", + "l": "ଲ", + "m": "ମ", + "n": "ନ", + "o": "ଓ", + "p": "ପି", + "q": "କ୍ଯୁ", + "r": "ର", + "s": "ସଁ", + "t": "ତ", + "u": "ଓ", + "v": "ଭି", + "w": "ୱ", + "x": "ସ", + "y": "ୟା", + "z": "ଜ଼", + "A": "ଏ", + "B": "ବି", + "C": "ସି", + "D": "ଡ଼", + "E": "ଏ", + "F": "ଫଁ", + "G": "ଗ", + "H": "ହଁ", + "I": "ଇ", + "J": "ଜେ", + "K": "କ", + "L": "ଲ", + "M": "ମ", + "N": "ନ", + "O": "ଓ", + "P": "ପି", + "Q": "କ୍ଯୁ", + "R": "ର", + "S": "ସଁ", + "T": "ତ", + "U": "ଓ", + "V": "ଭି", + "W": "ୱ", + "X": "ସ", + "Y": "ୟା", + "Z": "ଜ଼", + "tall": "ବିୣଁ" +} diff --git a/js/data/locale/pa/pseudomap.json b/js/data/locale/pa/pseudomap.json new file mode 100644 index 0000000000..7847c972cd --- /dev/null +++ b/js/data/locale/pa/pseudomap.json @@ -0,0 +1,49 @@ +{ + "a": "ਅ", + "b": "ਬ", + "c": "ਚ", + "d": "ਦ", + "e": "ਐ", + "f": "ਫ਼", + "g": "ਗ", + "h": "ਹ", + "i": "ਇ", + "j": "ਜ", + "k": "ਕ", + "l": "ਲ", + "m": "ਮ", + "n": "ਨ", + "o": "ਔ", + "p": "ਪ", + "r": "ਰ", + "s": "ਸ", + "t": "ਤ", + "u": "ਉ", + "v": "ਵ", + "y": "ਯ", + "z": "ਜ਼", + "A": "ਅ", + "B": "ਬ", + "C": "ਚ", + "D": "ਦ", + "E": "ਐ", + "F": "ਫ਼", + "G": "ਗ", + "H": "ਹ", + "I": "ਇ", + "J": "ਜ", + "K": "ਕ", + "L": "ਲ", + "M": "ਮ", + "N": "ਨ", + "O": "ਔ", + "P": "ਪ", + "R": "ਰ", + "S": "ਸ", + "T": "ਤ", + "U": "ਉ", + "V": "ਵ", + "Y": "ਯ", + "Z": "ਜ਼", + "tall": "ਊਂਹ੍" +} diff --git a/js/data/locale/si/pseudomap.json b/js/data/locale/si/pseudomap.json new file mode 100644 index 0000000000..1a8dc1a37c --- /dev/null +++ b/js/data/locale/si/pseudomap.json @@ -0,0 +1,55 @@ +{ + "a": "අ", + "b": "ආ", + "c": "ඇ", + "d": "ඈ", + "e": "ඉ", + "f": "ඊ", + "g": "උ", + "h": "ඌ", + "i": "ඍ", + "j": "ඎ", + "k": "ඏ", + "l": "ඐ", + "m": "එ", + "n": "ඒ", + "o": "ඓ", + "p": "ඔ", + "q": "ඕ", + "r": "ඖ", + "s": "ක", + "t": "ඛ", + "u": "ග", + "v": "ඝ", + "w": "ඞ", + "x": "ඟ", + "y": "ච", + "z": "ඡ", + "A": "ජ", + "B": "ඣ", + "C": "ඤ", + "D": "ඥ", + "E": "ඦ", + "F": "ට", + "G": "ඨ", + "H": "ඩ", + "I": "ඪ", + "J": "ණ", + "K": "ඬ", + "L": "ත", + "M": "ථ", + "N": "ද", + "O": "ධ", + "P": "න", + "Q": "ඳ", + "R": "ප", + "S": "ඵ", + "T": "බ", + "U": "භ", + "V": "ම", + "W": "ඹ", + "X": "ය", + "Y": "ර", + "Z": "ල", + "tall": "ඳ්" +} diff --git a/js/data/locale/ta/pseudomap.json b/js/data/locale/ta/pseudomap.json new file mode 100644 index 0000000000..2f5ad5560f --- /dev/null +++ b/js/data/locale/ta/pseudomap.json @@ -0,0 +1,45 @@ +{ + "a": "அ", + "e": "எ", + "g": "ஞ்", + "h": "ஹ்", + "i": "இ", + "j": "ஜ்", + "k": "க்", + "l": "ள்", + "m": "ம்", + "n": "ந்", + "o": "ஒ", + "p": "ப்", + "q": "ஃ", + "r": "ர்", + "s": "ச்", + "t": "ட்", + "u": "உ", + "v": "வ்", + "x": "க்ஷ்", + "y": "ய்", + "z": "ழ்", + "A": "அ", + "E": "எ", + "G": "ஞ்", + "H": "ஹ்", + "I": "இ", + "J": "ஜ்", + "K": "க்", + "L": "ள்", + "M": "ம்", + "N": "ண்", + "O": "ஒ", + "P": "ப்", + "Q": "ஃ", + "R": "ற்", + "S": "ஸ்", + "T": "ட்", + "U": "உ", + "V": "வ்", + "X": "க்ஷ்", + "Y": "ய்", + "Z": "ழ்", + "tall": "தீ" +} diff --git a/js/data/locale/te/pseudomap.json b/js/data/locale/te/pseudomap.json new file mode 100644 index 0000000000..b6e369c737 --- /dev/null +++ b/js/data/locale/te/pseudomap.json @@ -0,0 +1,45 @@ +{ + "a": "అ", + "b": "బ", + "c": "చ", + "d": "ద", + "e": "ఎ", + "g": "గ", + "h": "హ", + "i": "ఇ", + "j": "జ", + "k": "క", + "l": "ల", + "m": "మ", + "n": "న", + "o": "ఓ", + "p": "ప", + "r": "ర", + "s": "స", + "t": "త", + "u": "ఉ", + "v": "వ", + "y": "య", + "A": "ఆ", + "B": "బ", + "C": "చ", + "D": "ద", + "E": "ఏ", + "G": "గ", + "H": "హ", + "I": "ఇ", + "J": "జ", + "K": "క", + "L": "ల", + "M": "మ", + "N": "న", + "O": "ఓ", + "P": "ప", + "R": "ర", + "S": "స", + "T": "త", + "U": "ఊ", + "V": "వ", + "Y": "య", + "tall": "ౘై" +} diff --git a/js/lib/ResBundle.js b/js/lib/ResBundle.js index 5ab3df7d13..07a9c9b999 100644 --- a/js/lib/ResBundle.js +++ b/js/lib/ResBundle.js @@ -471,6 +471,10 @@ ResBundle.prototype = { // simulate Asian languages by getting rid of all the spaces ret = ret.replace(/ /g, ""); } + + if (this.pseudomap["tall"] !== undefined) { + ret = this.pseudomap["tall"] + ret; + } return ret; }, diff --git a/js/test/root/testresources.js b/js/test/root/testresources.js index 514368a079..d0898b545f 100644 --- a/js/test/root/testresources.js +++ b/js/test/root/testresources.js @@ -1,7 +1,7 @@ /* * testresources.js - test the Resources object * - * Copyright © 2012-2015, 2017-2019, 2021-2022 JEDLSoft + * Copyright © 2012-2015, 2017-2019, 2021-2023 JEDLSoft * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -612,6 +612,82 @@ module.exports.testresources = { test.done(); }, + testResBundleGetStringOtherBundlePseudoBengali: function(test) { + test.expect(4); + ilib.setAsPseudoLocale("as-XX"); + var rb = new ResBundle({ + name: "tester", + locale: "as-XX" + }); + + test.ok(rb !== null); + + // should be equivalent to "text" and not pseudo-ize the replacement parameter names + test.equal(rb.getString("Hello from {country}").toString(), 'ঠ্ড়িহএললও fরওম {country}'); + test.equal(rb.getString("Hello from {city}").toString(), 'ঠ্ড়িহএললও fরওম {city}'); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), 'ঠ্ড়িগরএএতইনগশ fরওম {city} ইন {country}'); + + ilib.clearPseudoLocales(); + test.done(); + }, + + testResBundleGetStringOtherBundlePseudoGujarati: function(test) { + test.expect(4); + ilib.setAsPseudoLocale("gu-XX"); + var rb = new ResBundle({ + name: "tester", + locale: "gu-XX" + }); + + test.ok(rb !== null); + + // should be equivalent to "text" and not pseudo-ize the replacement parameter names + test.equal(rb.getString("Hello from {country}").toString(), 'ઈૄહએલલઓ fૃઓં {country}'); + test.equal(rb.getString("Hello from {city}").toString(), 'ઈૄહએલલઓ fૃઓં {city}'); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), 'ઈૄગૃએએતઇઙગષ fૃઓં {city} ઇઙ {country}'); + + ilib.clearPseudoLocales(); + test.done(); + }, + + testResBundleGetStringOtherBundlePseudoOriya: function(test) { + test.expect(4); + ilib.setAsPseudoLocale("or-XX"); + var rb = new ResBundle({ + name: "tester", + locale: "or-XX" + }); + + test.ok(rb !== null); + + // should be equivalent to "text" and not pseudo-ize the replacement parameter names + test.equal(rb.getString("Hello from {country}").toString(), 'ବିୣଁହଁଏଲଲଓ ଫଁରଓମ {country}'); + test.equal(rb.getString("Hello from {city}").toString(), 'ବିୣଁହଁଏଲଲଓ ଫଁରଓମ {city}'); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), 'ବିୣଁଗରଏଏତଇନଗସଁ ଫଁରଓମ {city} ଇନ {country}'); + + ilib.clearPseudoLocales(); + test.done(); + }, + + testResBundleGetStringOtherBundlePseudoPunjabi: function(test) { + test.expect(4); + ilib.setAsPseudoLocale("pa-XX"); + var rb = new ResBundle({ + name: "tester", + locale: "pa-XX" + }); + + test.ok(rb !== null); + + // should be equivalent to "text" and not pseudo-ize the replacement parameter names + test.equal(rb.getString("Hello from {country}").toString(), 'ਊਂਹ੍ਹਐਲਲਔ ਫ਼ਰਔਮ {country}'); + test.equal(rb.getString("Hello from {city}").toString(), 'ਊਂਹ੍ਹਐਲਲਔ ਫ਼ਰਔਮ {city}'); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), 'ਊਂਹ੍ਗਰਐਐਤਇਨਗਸ ਫ਼ਰਔਮ {city} ਇਨ {country}'); + + ilib.clearPseudoLocales(); + test.done(); + }, + testResBundleGetStringMissingBundlePseudoHtml: function(test) { test.expect(4); var rb = new ResBundle({ diff --git a/package.json b/package.json index 76d8c622a8..e8a640eea6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ilib", - "version": "14.17.1", + "version": "14.18.0", "main": "js/index.js", "description": "iLib is a cross-engine library of internationalization (i18n) classes written in pure JS", "keywords": [ From 60efb2f8d2e1b07ae7f1bc16d03e095116ec8d6c Mon Sep 17 00:00:00 2001 From: Goun Lee Date: Thu, 29 Jun 2023 15:12:28 +0900 Subject: [PATCH 05/24] Update circle config --- .circleci/config.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7977cba659..15685a57de 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -69,11 +69,11 @@ workflows: test-all-node-versions: jobs: - test: - docker_image: circleci/node:8-browsers + docker_image: circleci/node:8.10.0 - test: - docker_image: circleci/node:10-browsers + docker_image: cimg/node:10.24.0-browsers - test: - docker_image: circleci/node:12-browsers + docker_image: cimg/node:12.22.5-browsers - test: docker_image: cimg/node:14.21.2-browsers - test: From 8ddc9257344fa591d491a37f100a2fbde8757a47 Mon Sep 17 00:00:00 2001 From: Goun Lee Date: Thu, 29 Jun 2023 15:22:11 +0900 Subject: [PATCH 06/24] Update circle config --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 15685a57de..70596d2f01 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -69,7 +69,7 @@ workflows: test-all-node-versions: jobs: - test: - docker_image: circleci/node:8.10.0 + docker_image: circleci/node:8.17.0 - test: docker_image: cimg/node:10.24.0-browsers - test: From 830c13d5209ffa904c9651ac083963c735e4efc6 Mon Sep 17 00:00:00 2001 From: Goun Lee Date: Thu, 29 Jun 2023 15:24:21 +0900 Subject: [PATCH 07/24] Update circle config for node v8wq --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 70596d2f01..a80c608117 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -69,7 +69,7 @@ workflows: test-all-node-versions: jobs: - test: - docker_image: circleci/node:8.17.0 + docker_image: cimg/node:8.17.0 - test: docker_image: cimg/node:10.24.0-browsers - test: From 7ec12ac29b9a2eaa023f52718311944dba07d8c8 Mon Sep 17 00:00:00 2001 From: Goun Lee Date: Thu, 29 Jun 2023 15:42:08 +0900 Subject: [PATCH 08/24] test circleci --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index a80c608117..40336f4b5c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,7 +32,7 @@ jobs: - run: name: Set up OpenJDK command: | - sudo apt-get install openjdk-11-jdk + sudo apt-get install -y openjdk-11-jdk sudo update-alternatives --set java /usr/lib/jvm/java-11-openjdk-amd64/bin/java sudo update-alternatives --set javac /usr/lib/jvm/java-11-openjdk-amd64/bin/javac sudo update-alternatives --set javadoc /usr/lib/jvm/java-11-openjdk-amd64/bin/javadoc From dfd45d5ef1509bdaf500a8d7fff88f314539ba52 Mon Sep 17 00:00:00 2001 From: Goun Lee Date: Thu, 29 Jun 2023 16:15:41 +0900 Subject: [PATCH 09/24] update config version for v12 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 40336f4b5c..fa83b3aa36 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -73,7 +73,7 @@ workflows: - test: docker_image: cimg/node:10.24.0-browsers - test: - docker_image: cimg/node:12.22.5-browsers + docker_image: cimg/node:12.22.12-browsers - test: docker_image: cimg/node:14.21.2-browsers - test: From 040fe5a172b5e9dfe52618a2f6bb8b5562c2bc59 Mon Sep 17 00:00:00 2001 From: Goun Lee Date: Thu, 29 Jun 2023 16:25:34 +0900 Subject: [PATCH 10/24] update --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fa83b3aa36..5c77c7b978 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -71,7 +71,7 @@ workflows: - test: docker_image: cimg/node:8.17.0 - test: - docker_image: cimg/node:10.24.0-browsers + docker_image: cimg/node:10.24.1-browsers - test: docker_image: cimg/node:12.22.12-browsers - test: From 823f3d2c395698bb770eb2c6c2c06bd8c95ad3aa Mon Sep 17 00:00:00 2001 From: Goun Lee Date: Thu, 29 Jun 2023 16:35:02 +0900 Subject: [PATCH 11/24] update --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5c77c7b978..258c7b2edf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ jobs: parameters: docker_image: type: string - default: cimg/openjdk:11.0.13-node + default: cimg/openjdk:11.0.19-node docker: - image: << parameters.docker_image >> From a79a88d2af7d198cbf7b7f255525ffc94bae4bb9 Mon Sep 17 00:00:00 2001 From: Goun Lee Date: Thu, 29 Jun 2023 16:44:44 +0900 Subject: [PATCH 12/24] update circle config --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7977cba659..5c77c7b978 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -32,7 +32,7 @@ jobs: - run: name: Set up OpenJDK command: | - sudo apt-get install openjdk-11-jdk + sudo apt-get install -y openjdk-11-jdk sudo update-alternatives --set java /usr/lib/jvm/java-11-openjdk-amd64/bin/java sudo update-alternatives --set javac /usr/lib/jvm/java-11-openjdk-amd64/bin/javac sudo update-alternatives --set javadoc /usr/lib/jvm/java-11-openjdk-amd64/bin/javadoc @@ -69,11 +69,11 @@ workflows: test-all-node-versions: jobs: - test: - docker_image: circleci/node:8-browsers + docker_image: cimg/node:8.17.0 - test: - docker_image: circleci/node:10-browsers + docker_image: cimg/node:10.24.1-browsers - test: - docker_image: circleci/node:12-browsers + docker_image: cimg/node:12.22.12-browsers - test: docker_image: cimg/node:14.21.2-browsers - test: From e5b6b2c867db569e3aaddbaae5f86832a2a99ed6 Mon Sep 17 00:00:00 2001 From: Goun Lee Date: Thu, 29 Jun 2023 17:02:17 +0900 Subject: [PATCH 13/24] update --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 258c7b2edf..5c77c7b978 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -4,7 +4,7 @@ jobs: parameters: docker_image: type: string - default: cimg/openjdk:11.0.19-node + default: cimg/openjdk:11.0.13-node docker: - image: << parameters.docker_image >> From 810837dc3c5eaa0e9a8f7fa6e17a6a1e09e1e55e Mon Sep 17 00:00:00 2001 From: Goun Lee Date: Fri, 30 Jun 2023 15:02:39 +0900 Subject: [PATCH 14/24] Add pseulocale to localematch.json --- js/data/locale/localematch.json | 15 ++++ js/test/root/testlocalematch.js | 123 +++++++++----------------------- 2 files changed, 48 insertions(+), 90 deletions(-) diff --git a/js/data/locale/localematch.json b/js/data/locale/localematch.json index f6044bc0bb..0ac0095d54 100644 --- a/js/data/locale/localematch.json +++ b/js/data/locale/localematch.json @@ -909,6 +909,7 @@ "alt-RU": "alt-Cyrl-RU", "am": "am-Ethi-ET", "am-ET": "am-Ethi-ET", + "am-XX": "am-Ethi-XX", "am-Ethi": "am-Ethi-ET", "amm": "amm-Latn-ZZ", "amm-Latn": "amm-Latn-ZZ", @@ -1017,6 +1018,7 @@ "arz-Arab": "arz-Arab-EG", "arz-EG": "arz-Arab-EG", "as": "as-Beng-IN", + "as-XX": "as-Beng-XX", "as-Beng": "as-Beng-IN", "as-IN": "as-Beng-IN", "asa": "asa-Latn-TZ", @@ -1321,6 +1323,7 @@ "bn-BD": "bn-Beng-BD", "bn-Beng": "bn-Beng-BD", "bn-IN": "bn-Beng-IN", + "bn-XX": "bn-Beng-XX", "bng": "bng-Latn-ZZ", "bng-Latn": "bng-Latn-ZZ", "bng-ZZ": "bng-Latn-ZZ", @@ -2282,6 +2285,7 @@ "gu": "gu-Gujr-IN", "gu-Gujr": "gu-Gujr-IN", "gu-IN": "gu-Gujr-IN", + "gu-XX": "gu-Gujr-XX", "gub": "gub-Latn-BR", "gub-BR": "gub-Latn-BR", "gub-Latn": "gub-Latn-BR", @@ -2363,6 +2367,7 @@ "hi": "hi-Deva-IN", "hi-Deva": "hi-Deva-IN", "hi-IN": "hi-Deva-IN", + "hi-XX": "hi-Deva-XX", "hi-Latn": "hi-Latn-IN", "hia": "hia-Latn-ZZ", "hia-Latn": "hia-Latn-ZZ", @@ -2617,6 +2622,7 @@ "jw-Latn": "jw-Latn-ID", "ka": "ka-Geor-GE", "ka-GE": "ka-Geor-GE", + "ka-XX": "ka-Geor-XX", "ka-Geok": "ka-Geok-GE", "ka-Geor": "ka-Geor-GE", "ka-Gong": "ka-Gong-GE", @@ -2802,6 +2808,7 @@ "klx-ZZ": "klx-Latn-ZZ", "km": "km-Khmr-KH", "km-KH": "km-Khmr-KH", + "km-XX": "km-Khmr-XX", "km-Khmr": "km-Khmr-KH", "kmb": "kmb-Latn-AO", "kmb-AO": "kmb-Latn-AO", @@ -2823,6 +2830,7 @@ "kmw-ZZ": "kmw-Latn-ZZ", "kn": "kn-Knda-IN", "kn-IN": "kn-Knda-IN", + "kn-XX": "kn-Knda-XX", "kn-Knda": "kn-Knda-IN", "knf": "knf-Latn-GW", "knf-GW": "knf-Latn-GW", @@ -3400,6 +3408,7 @@ "mkw-ZZ": "mkw-Latn-ZZ", "ml": "ml-Mlym-IN", "ml-IN": "ml-Mlym-IN", + "ml-XX": "ml-Mlym-XX", "ml-Mlym": "ml-Mlym-IN", "mle": "mle-Latn-ZZ", "mle-Latn": "mle-Latn-ZZ", @@ -3472,6 +3481,7 @@ "mr": "mr-Deva-IN", "mr-Deva": "mr-Deva-IN", "mr-IN": "mr-Deva-IN", + "mr-XX": "mr-Deva-XX", "mrd": "mrd-Deva-NP", "mrd-Deva": "mrd-Deva-NP", "mrd-NP": "mrd-Deva-NP", @@ -3859,6 +3869,7 @@ "opm-ZZ": "opm-Latn-ZZ", "or": "or-Orya-IN", "or-IN": "or-Orya-IN", + "or-XX": "or-Orya-XX", "or-Orya": "or-Orya-IN", "oro": "oro-Latn-ZZ", "oro-Latn": "oro-Latn-ZZ", @@ -3888,6 +3899,7 @@ "pa-Arab": "pa-Arab-PK", "pa-Guru": "pa-Guru-IN", "pa-IN": "pa-Guru-IN", + "pa-XX": "pa-Guru-XX", "pa-PK": "pa-Arab-PK", "pag": "pag-Latn-PH", "pag-Latn": "pag-Latn-PH", @@ -4247,6 +4259,7 @@ "shu-ZZ": "shu-Arab-ZZ", "si": "si-Sinh-LK", "si-LK": "si-Sinh-LK", + "si-XX": "si-Sinh-XX", "si-Sinh": "si-Sinh-LK", "sid": "sid-Latn-ET", "sid-ET": "sid-Latn-ET", @@ -4473,6 +4486,7 @@ "szl-PL": "szl-Latn-PL", "ta": "ta-Taml-IN", "ta-IN": "ta-Taml-IN", + "ta-XX": "ta-Taml-XX", "ta-Taml": "ta-Taml-IN", "taj": "taj-Deva-NP", "taj-Deva": "taj-Deva-NP", @@ -4527,6 +4541,7 @@ "tdu-MY": "tdu-Latn-MY", "te": "te-Telu-IN", "te-IN": "te-Telu-IN", + "te-XX": "te-Telu-XX", "te-Telu": "te-Telu-IN", "ted": "ted-Latn-ZZ", "ted-Latn": "ted-Latn-ZZ", diff --git a/js/test/root/testlocalematch.js b/js/test/root/testlocalematch.js index 4bdd353fee..de5525964b 100644 --- a/js/test/root/testlocalematch.js +++ b/js/test/root/testlocalematch.js @@ -30,7 +30,6 @@ module.exports.testlocalematch = { ilib.clearCache(); callback(); }, - testLocaleMatcherConstructor: function(test) { test.expect(1); var loc = new LocaleMatcher(); @@ -38,7 +37,6 @@ module.exports.testlocalematch = { test.ok(loc !== null); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLanguage1: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -50,7 +48,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "uz-Latn-UZ"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLanguage2: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -62,7 +59,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "alt-Cyrl-RU"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLanguage3: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -74,7 +70,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "gv-Latn-IM"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLanguage4: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -208,7 +203,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "ar-Arab-EG"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByScript2: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -231,7 +225,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "arc-Elym-IR"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLanguageAndScript1: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -243,7 +236,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "pa-Arab-PK"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLanguageAndScript2: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -255,7 +247,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "be-Cyrl-BY"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLanguageAndScript3: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -267,7 +258,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "ar-Hebr-IL"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLanguageAndScriptUnknownCombo: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -279,7 +269,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "pl-Latn-PL"); // default to country's locale test.done(); }, - testLocaleMatcherGetLikelyLocaleByLanguageAndScriptOriya: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -291,7 +280,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "or-Orya-IN"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLanguageOriya: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -303,7 +291,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "or-Orya-IN"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByScriptOriya: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -315,7 +302,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "or-Orya-IN"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLanguageAndRegion: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -327,7 +313,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "uz-Arab-AF"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByRegionAndScript: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -339,7 +324,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "fr-Latn-MA"); test.done(); }, - testLocaleMatcherGetLikelyLocaleAlreadySpecified: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -351,7 +335,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "en-Latn-CA"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLanguageMissing: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -363,7 +346,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "zxx-Latn-XX"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLanguageAndRegionMissing: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -375,7 +357,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "en-Latn-GB"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLocaleRegionCodeAF: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -387,7 +368,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "af-Latn-ZA"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLocaleCodeAF: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -399,7 +379,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "af-Latn-ZA"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLocaleRegionCodeAF: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -411,7 +390,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "af-Latn-NA"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLocaleRegionCodeET: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -423,7 +401,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "am-Ethi-ET"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLocaleCodeET: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -447,7 +424,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "ha-Latn-NG"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLocaleCodeHANG: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -459,7 +435,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "ha-Latn-NG"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLocaleCodeHANE: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -471,7 +446,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "ha-Latn-NE"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLocaleCodeGH: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -494,7 +468,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "fr-Latn-CA"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLocaleCode2: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -506,7 +479,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "ar-Arab-DJ"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLocaleCode3: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -1112,7 +1084,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "ur-Arab-PK"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLocaleCode58: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -1124,7 +1095,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "hr-Latn-ME"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLocaleCode59: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -1136,7 +1106,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "hr-Latn-ME"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLocaleCode60: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -1159,7 +1128,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "ka-Geor-GE"); test.done(); }, - testLocaleMatcherGetLikelyLocaleByLocaleCode62: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -1402,6 +1370,39 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "pt-Latn-MO"); test.done(); }, + testLocaleMatcherGetLikelyLocaleByLocaleCode_as_XX: function(test) { + test.expect(3); + var lm = new LocaleMatcher({ + locale: "as-XX" + }); + test.ok(typeof(lm) !== "undefined"); + var locale = lm.getLikelyLocale(); + test.ok(typeof(locale) !== "undefined"); + test.equal(locale.getSpec(), "as-Beng-XX"); + test.done(); + }, + testLocaleMatcherGetLikelyLocaleByLocaleCode_ml_XX: function(test) { + test.expect(3); + var lm = new LocaleMatcher({ + locale: "ml-XX" + }); + test.ok(typeof(lm) !== "undefined"); + var locale = lm.getLikelyLocale(); + test.ok(typeof(locale) !== "undefined"); + test.equal(locale.getSpec(), "ml-Mlym-XX"); + test.done(); + }, + testLocaleMatcherGetLikelyLocaleByLocaleCode_te_XX: function(test) { + test.expect(3); + var lm = new LocaleMatcher({ + locale: "te-XX" + }); + test.ok(typeof(lm) !== "undefined"); + var locale = lm.getLikelyLocale(); + test.ok(typeof(locale) !== "undefined"); + test.equal(locale.getSpec(), "te-Telu-XX"); + test.done(); + }, testLocaleMatcherGetLikelyLocaleByLocaleCodehy: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -1655,7 +1656,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherMatchExactLangRegion: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1667,7 +1667,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherMatchExactLang: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1679,7 +1678,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherMatchExactLangScript: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1691,7 +1689,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherMatchExactRegion: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1703,7 +1700,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherMatchExactDefaultScript: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1715,7 +1711,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherMatchExactDefaultScript: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1727,7 +1722,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherMatchExactDefaultRegion: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1739,7 +1733,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherMatchExactDefaultRegionReverse: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1751,7 +1744,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherMatchFullLocaleDifferentRegion: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1763,7 +1755,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherMatchFullLocaleDifferentScript: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1775,7 +1766,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherMatchFullLocaleDifferentLanguage: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1787,7 +1777,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherMatchFullLocaleDifferentVariant: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1799,7 +1788,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherMatchMutuallyIntelligibleLanguages: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1811,7 +1799,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherMatchMutuallyIntelligibleLanguagesAsymetric: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1823,8 +1810,6 @@ module.exports.testlocalematch = { test.done(); }, - - testLocaleMatcherGetMacroLanguageZH: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1836,7 +1821,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherGetMacroLanguageCMN: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1848,7 +1832,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherGetMacroLanguageNO: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1860,7 +1843,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherGetMacroLanguageNoChange: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1872,7 +1854,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherMatchMacroLanguagesNO: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1884,7 +1865,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherMatchMacroLanguagesZH: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1896,7 +1876,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherMatchMacroLanguagesZH2: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1908,7 +1887,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherGetMacroLanguageNO: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1920,7 +1898,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherGetRegionContainmentNO: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1933,7 +1910,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherGetRegionContainmentDA: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1946,7 +1922,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherGetRegionContainmentUS: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1959,7 +1934,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherGetRegionContainmentUsingMostLikelyRegion: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1972,7 +1946,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherSmallestCommonRegionUSCA: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1985,7 +1958,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherSmallestCommonRegionUSJM: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -1998,7 +1970,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherSmallestCommonRegionUSGB: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -2011,7 +1982,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherSmallestCommonRegionNLDK: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -2024,7 +1994,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherSmallestCommonRegionUndefined: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -2037,7 +2006,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherSmallestCommonRegionWithMostLikelyRegions: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -2050,7 +2018,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherSmallestCommonRegionWithMostLikelyRegions2: function(test) { test.expect(2); var lm = new LocaleMatcher({ @@ -2063,7 +2030,6 @@ module.exports.testlocalematch = { test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalByLanguage1: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2075,7 +2041,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "en-US"); test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalByLanguage2: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2087,7 +2052,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "fr-FR"); test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalByLanguage3: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2154,7 +2118,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "eu-ES"); test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalUzbek: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2166,7 +2129,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "uz-Latn-UZ"); // Uzbek always uses the script test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalChinese: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2178,7 +2140,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "zh-Hans-CN"); // Chinese always uses the script test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalKazakh: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2190,7 +2151,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "kk-Cyrl-KZ"); // Kazakh always uses the script test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalDefaultScriptForLanguage: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2202,7 +2162,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "sv-SE"); // default is Latin test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalDefaultScriptForLanguage_ne: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2291,7 +2250,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "mt-MT"); test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalDefaultScriptForCountry_LA: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2314,7 +2272,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "sr-Latn-ME"); // default is Cyrillic, so we have to put "Latn" explicitly test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalNonDefaultScriptForLanguage2: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2326,7 +2283,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "sr-Latn-RS"); // default is Cyrillic, so we have to put "Latn" explicitly test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalNonDefaultScriptForLanguage3: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2338,7 +2294,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "zh-Hant-TW"); // Chinese always uses the script test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalDefaultScriptForCountry1: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2350,7 +2305,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "en-US"); test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalDefaultScriptForCountry2: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2362,7 +2316,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "zh-Hant-HK"); // Chinese always uses the script test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalDefaultScriptForCountry3: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2473,7 +2426,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "en-US"); test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalDefaultLocaleForScript2: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2485,7 +2437,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "ja-JP"); test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalDefaultLocaleForScript3: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2497,7 +2448,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "zh-Hans-CN"); test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalDefaultLocaleForScript4: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2509,7 +2459,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "ka-GE"); test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalNonDefaultLocaleForScript1: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2521,7 +2470,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "ja-Hira-JP"); test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalNonDefaultLocaleForScript_Laoo: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2533,7 +2481,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "lo-LA"); test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalDefaultLocaleForLangScript1: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2545,7 +2492,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "uz-Latn-UZ"); // Uzbek always uses the script test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalDefaultLocaleForLangScript2: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2557,7 +2503,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "ru-RU"); test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalDefaultLocaleForLangScript3: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2569,7 +2514,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "no-NO"); test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalNonDefaultLocaleForLangScript1: function(test) { test.expect(3); var lm = new LocaleMatcher({ @@ -2581,7 +2525,6 @@ module.exports.testlocalematch = { test.equal(locale.getSpec(), "en-Dsrt-US"); test.done(); }, - testLocaleMatcherGetLikelyLocaleMinimalNonDefaultLocaleForLangScript2: function(test) { test.expect(3); var lm = new LocaleMatcher({ From 876b52e9d983807966e4177e8e18bd9cea2e0974 Mon Sep 17 00:00:00 2001 From: Goun Lee Date: Mon, 3 Jul 2023 11:02:41 +0900 Subject: [PATCH 15/24] ADd new ethiopic pseudomap file --- js/data/locale/am/pseudomap.json | 55 ++++++++++++++++++++++++++++++++ js/test/root/testresources.js | 18 +++++++++++ 2 files changed, 73 insertions(+) create mode 100644 js/data/locale/am/pseudomap.json diff --git a/js/data/locale/am/pseudomap.json b/js/data/locale/am/pseudomap.json new file mode 100644 index 0000000000..4a14000ad9 --- /dev/null +++ b/js/data/locale/am/pseudomap.json @@ -0,0 +1,55 @@ +{ + "a": "አ", + "b": "በ", + "c": "ቸ", + "d": "ደ", + "e": "ኤ", + "f": "ፈ", + "g": "ገ", + "h": "ሀ", + "i": "ኢ", + "j": "ጀ", + "k": "ከ", + "l": "ለ", + "m": "መ", + "n": "ነ", + "o": "ኦ", + "p": "ፐ", + "q": "ቀ", + "r": "ረ", + "s": "ሰ", + "t": "ተ", + "u": "ኡ", + "v": "ቨ", + "w": "ወ", + "x": "ኸ", + "y": "የ", + "z": "ዘ", + "A": "አ", + "B": "ቡ", + "C": "ቹ", + "D": "ዱ", + "E": "ኤ", + "F": "ፉ", + "G": "ጉ", + "H": "ሁ", + "I": "ኢ", + "J": "ጁ", + "K": "ኩ", + "L": "ሉ", + "M": "ሙ", + "N": "ኑ", + "O": "ኦ", + "P": "ፑ", + "Q": "ቁ", + "R": "ሩ", + "S": "ሱ", + "T": "ቱ", + "U": "ኡ", + "V": "ቩ", + "W": "ዉ", + "X": "ኹ", + "Y": "ዩ", + "Z": "ዙ", + "tall": "ሿ፝" +} diff --git a/js/test/root/testresources.js b/js/test/root/testresources.js index d0898b545f..ad2fefdddc 100644 --- a/js/test/root/testresources.js +++ b/js/test/root/testresources.js @@ -668,6 +668,24 @@ module.exports.testresources = { ilib.clearPseudoLocales(); test.done(); }, + testResBundleGetStringOtherBundlePseudoEthi: function(test) { + test.expect(4); + ilib.setAsPseudoLocale("am-XX"); + var rb = new ResBundle({ + name: "tester", + locale: "am-XX" + }); + + test.ok(rb !== null); + + // should be equivalent to "text" and not pseudo-ize the replacement parameter names + test.equal(rb.getString("Hello from {country}").toString(), 'ሿ፝ሁኤለለኦ ፈረኦመ {country}'); + test.equal(rb.getString("Hello from {city}").toString(), 'ሿ፝ሁኤለለኦ ፈረኦመ {city}'); + test.equal(rb.getString("Greetings from {city} in {country}").toString(),'ሿ፝ጉረኤኤተኢነገሰ ፈረኦመ {city} ኢነ {country}'); + + ilib.clearPseudoLocales(); + test.done(); + }, testResBundleGetStringOtherBundlePseudoPunjabi: function(test) { test.expect(4); From 532080d00a4a693dd39cbc754a3cfc79a5ee59f6 Mon Sep 17 00:00:00 2001 From: Goun Lee Date: Tue, 4 Jul 2023 16:02:08 +0900 Subject: [PATCH 16/24] pseudo string encapsulation --- js/lib/ResBundle.js | 3 + js/test/root/testresources.js | 284 ++++++++++++++--------------- js/test/root/testresourcesasync.js | 28 +-- 3 files changed, 159 insertions(+), 156 deletions(-) diff --git a/js/lib/ResBundle.js b/js/lib/ResBundle.js index 5ab3df7d13..30173431de 100644 --- a/js/lib/ResBundle.js +++ b/js/lib/ResBundle.js @@ -471,6 +471,9 @@ ResBundle.prototype = { // simulate Asian languages by getting rid of all the spaces ret = ret.replace(/ /g, ""); } + // All strings are encapsulated in []. + ret = "[" + ret + "]"; + return ret; }, diff --git a/js/test/root/testresources.js b/js/test/root/testresources.js index 514368a079..5fd369f3c4 100644 --- a/js/test/root/testresources.js +++ b/js/test/root/testresources.js @@ -413,9 +413,9 @@ module.exports.testresources = { test.ok(rb !== null); // should not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), "Ħëľľõ fŕõm {çõüñţŕÿ}"); - test.equal(rb.getString("Hello from {city}").toString(), "Ħëľľõ fŕõm {çíţÿ}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "Ĝŕëëţíñğš fŕõm {çíţÿ} íñ {çõüñţŕÿ}"); + test.equal(rb.getString("Hello from {country}").toString(), "[Ħëľľõ fŕõm {çõüñţŕÿ}]"); + test.equal(rb.getString("Hello from {city}").toString(), "[Ħëľľõ fŕõm {çíţÿ}]"); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), "[Ĝŕëëţíñğš fŕõm {çíţÿ} íñ {çõüñţŕÿ}]"); test.done(); }, @@ -430,9 +430,9 @@ module.exports.testresources = { test.ok(rb !== null); // should not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), "Ħëľľõ fŕõm {country}"); - test.equal(rb.getString("Hello from {city}").toString(), "Ħëľľõ fŕõm {city}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "Ĝŕëëţíñğš fŕõm {city} íñ {country}"); + test.equal(rb.getString("Hello from {country}").toString(), "[Ħëľľõ fŕõm {country}]"); + test.equal(rb.getString("Hello from {city}").toString(), "[Ħëľľõ fŕõm {city}]"); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), "[Ĝŕëëţíñğš fŕõm {city} íñ {country}]"); test.done(); }, @@ -447,9 +447,9 @@ module.exports.testresources = { test.ok(rb !== null); // should not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), "Ħëľľõ fŕõm {country}"); - test.equal(rb.getString("Hello from {city}").toString(), "Ħëľľõ fŕõm {city}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "Ĝŕëëţíñğš fŕõm {city} íñ {country}"); + test.equal(rb.getString("Hello from {country}").toString(), "[Ħëľľõ fŕõm {country}]"); + test.equal(rb.getString("Hello from {city}").toString(), "[Ħëľľõ fŕõm {city}]"); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), "[Ĝŕëëţíñğš fŕõm {city} íñ {country}]"); test.done(); }, @@ -464,9 +464,9 @@ module.exports.testresources = { test.ok(rb !== null); // should not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), "Ħëľľõ fŕõm {country}"); - test.equal(rb.getString("Hello from {city}").toString(), "Ħëľľõ fŕõm {city}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "Ĝŕëëţíñğš fŕõm {city} íñ {country}"); + test.equal(rb.getString("Hello from {country}").toString(), "[Ħëľľõ fŕõm {country}]"); + test.equal(rb.getString("Hello from {city}").toString(), "[Ħëľľõ fŕõm {city}]"); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), "[Ĝŕëëţíñğš fŕõm {city} íñ {country}]"); test.done(); }, @@ -481,9 +481,9 @@ module.exports.testresources = { test.ok(rb !== null); // should not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from
{country}
").toString(), "Ħëľľõ fŕõm
{country}
"); - test.equal(rb.getString("Hello from
{city}
").toString(), "Ħëľľõ fŕõm
{city}
"); - test.equal(rb.getString("Greetings from
{city}
in
{country}
").toString(), "Ĝŕëëţíñğš fŕõm
{city}
íñ
{country}
"); + test.equal(rb.getString("Hello from
{country}
").toString(), "[Ħëľľõ fŕõm
{country}
]"); + test.equal(rb.getString("Hello from
{city}
").toString(), "[Ħëľľõ fŕõm
{city}
]"); + test.equal(rb.getString("Greetings from
{city}
in
{country}
").toString(), "[Ĝŕëëţíñğš fŕõm
{city}
íñ
{country}
]"); test.done(); }, @@ -498,9 +498,9 @@ module.exports.testresources = { test.ok(rb !== null); // should not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from &{country}—").toString(), "Ħëľľõ fŕõm &{country}—"); - test.equal(rb.getString("Hello from &{city}—").toString(), "Ħëľľõ fŕõm &{city}—"); - test.equal(rb.getString("Greetings from &{city}— in &{country}—").toString(), "Ĝŕëëţíñğš fŕõm &{city}— íñ &{country}—"); + test.equal(rb.getString("Hello from &{country}—").toString(), "[Ħëľľõ fŕõm &{country}—]"); + test.equal(rb.getString("Hello from &{city}—").toString(), "[Ħëľľõ fŕõm &{city}—]"); + test.equal(rb.getString("Greetings from &{city}— in &{country}—").toString(), "[Ĝŕëëţíñğš fŕõm &{city}— íñ &{country}—]"); test.done(); }, @@ -515,9 +515,9 @@ module.exports.testresources = { test.ok(rb !== null); // should not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), "Ħëľľõ fŕõm {country}"); - test.equal(rb.getString("Hello from {city}").toString(), "Ħëľľõ fŕõm {city}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "Ĝŕëëţíñğš fŕõm {city} íñ {country}"); + test.equal(rb.getString("Hello from {country}").toString(), "[Ħëľľõ fŕõm {country}]"); + test.equal(rb.getString("Hello from {city}").toString(), "[Ħëľľõ fŕõm {city}]"); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), "[Ĝŕëëţíñğš fŕõm {city} íñ {country}]"); test.done(); }, @@ -535,63 +535,63 @@ module.exports.testresources = { // should not pseudo-ize the C style replacement parameters // now follows the IEEE printf specification: // https://pubs.opengroup.org/onlinepubs/009695399/functions/printf.html - test.equal(rb.getStringJS("actual %s "), "àçţüàľ %s 43210"); - test.equal(rb.getStringJS("actual %b "), "àçţüàľ %b 43210"); - test.equal(rb.getStringJS("actual %c "), "àçţüàľ %c 43210"); - test.equal(rb.getStringJS("actual %d "), "àçţüàľ %d 43210"); - test.equal(rb.getStringJS("actual %o "), "àçţüàľ %o 43210"); - test.equal(rb.getStringJS("actual %x "), "àçţüàľ %x 43210"); - test.equal(rb.getStringJS("actual %e "), "àçţüàľ %e 43210"); - test.equal(rb.getStringJS("actual %f "), "àçţüàľ %f 43210"); - test.equal(rb.getStringJS("actual %g "), "àçţüàľ %g 43210"); - test.equal(rb.getStringJS("actual %a "), "àçţüàľ %a 43210"); - test.equal(rb.getStringJS("actual %% "), "àçţüàľ %% 43210"); - test.equal(rb.getStringJS("actual %n "), "àçţüàľ %n 43210"); - test.equal(rb.getStringJS("actual %p "), "àçţüàľ %p 43210"); - - test.equal(rb.getStringJS("actual %S "), "àçţüàľ %S 43210"); - test.equal(rb.getStringJS("actual %C "), "àçţüàľ %C 43210"); - test.equal(rb.getStringJS("actual %X "), "àçţüàľ %X 43210"); - test.equal(rb.getStringJS("actual %E "), "àçţüàľ %E 43210"); - test.equal(rb.getStringJS("actual %G "), "àçţüàľ %G 43210"); - test.equal(rb.getStringJS("actual %A "), "àçţüàľ %A 43210"); - test.equal(rb.getStringJS("actual %% "), "àçţüàľ %% 43210"); - - test.equal(rb.getStringJS("actual %2$s "), "àçţüàľ %2$s 543210"); - test.equal(rb.getStringJS("actual %-d "), "àçţüàľ %-d 543210"); - test.equal(rb.getStringJS("actual %#d "), "àçţüàľ %#d 543210"); - test.equal(rb.getStringJS("actual %+d "), "àçţüàľ %+d 543210"); - test.equal(rb.getStringJS("actual % d "), "àçţüàľ % d 543210"); - test.equal(rb.getStringJS("actual %02d "), "àçţüàľ %02d 543210"); - test.equal(rb.getStringJS("actual %.2d "), "àçţüàľ %.2d 543210"); - test.equal(rb.getStringJS("actual %(2d "), "àçţüàľ %(2d 543210"); - test.equal(rb.getStringJS("actual %4$-2.2d "), "àçţüàľ %4$-2.2d 76543210"); - - test.equal(rb.getStringJS("actual %N "), "àçţüàľ %Ň 43210"); - test.equal(rb.getStringJS("actual %F "), "àçţüàľ %F 43210"); - test.equal(rb.getStringJS("actual %D "), "àçţüàľ %Ð 43210"); - test.equal(rb.getStringJS("actual %O "), "àçţüàľ %Ø 43210"); - - test.equal(rb.getStringJS("actual %hd "), "àçţüàľ %hd 543210"); - test.equal(rb.getStringJS("actual %hhd "), "àçţüàľ %hhd 543210"); - test.equal(rb.getStringJS("actual %ld "), "àçţüàľ %ld 543210"); - test.equal(rb.getStringJS("actual %lld "), "àçţüàľ %lld 543210"); - test.equal(rb.getStringJS("actual %Af "), "àçţüàľ %Af 543210"); - test.equal(rb.getStringJS("actual %zd "), "àçţüàľ %zd 543210"); - test.equal(rb.getStringJS("actual %td "), "àçţüàľ %td 543210"); - test.equal(rb.getStringJS("actual %jd "), "àçţüàľ %jd 543210"); - test.equal(rb.getStringJS("actual %% "), "àçţüàľ %% 43210"); + test.equal(rb.getStringJS("actual %s "), "[àçţüàľ %s 43210]"); + test.equal(rb.getStringJS("actual %b "), "[àçţüàľ %b 43210]"); + test.equal(rb.getStringJS("actual %c "), "[àçţüàľ %c 43210]"); + test.equal(rb.getStringJS("actual %d "), "[àçţüàľ %d 43210]"); + test.equal(rb.getStringJS("actual %o "), "[àçţüàľ %o 43210]"); + test.equal(rb.getStringJS("actual %x "), "[àçţüàľ %x 43210]"); + test.equal(rb.getStringJS("actual %e "), "[àçţüàľ %e 43210]"); + test.equal(rb.getStringJS("actual %f "), "[àçţüàľ %f 43210]"); + test.equal(rb.getStringJS("actual %g "), "[àçţüàľ %g 43210]"); + test.equal(rb.getStringJS("actual %a "), "[àçţüàľ %a 43210]"); + test.equal(rb.getStringJS("actual %% "), "[àçţüàľ %% 43210]"); + test.equal(rb.getStringJS("actual %n "), "[àçţüàľ %n 43210]"); + test.equal(rb.getStringJS("actual %p "), "[àçţüàľ %p 43210]"); + + test.equal(rb.getStringJS("actual %S "), "[àçţüàľ %S 43210]"); + test.equal(rb.getStringJS("actual %C "), "[àçţüàľ %C 43210]"); + test.equal(rb.getStringJS("actual %X "), "[àçţüàľ %X 43210]"); + test.equal(rb.getStringJS("actual %E "), "[àçţüàľ %E 43210]"); + test.equal(rb.getStringJS("actual %G "), "[àçţüàľ %G 43210]"); + test.equal(rb.getStringJS("actual %A "), "[àçţüàľ %A 43210]"); + test.equal(rb.getStringJS("actual %% "), "[àçţüàľ %% 43210]"); + + test.equal(rb.getStringJS("actual %2$s "), "[àçţüàľ %2$s 543210]"); + test.equal(rb.getStringJS("actual %-d "), "[àçţüàľ %-d 543210]"); + test.equal(rb.getStringJS("actual %#d "), "[àçţüàľ %#d 543210]"); + test.equal(rb.getStringJS("actual %+d "), "[àçţüàľ %+d 543210]"); + test.equal(rb.getStringJS("actual % d "), "[àçţüàľ % d 543210]"); + test.equal(rb.getStringJS("actual %02d "), "[àçţüàľ %02d 543210]"); + test.equal(rb.getStringJS("actual %.2d "), "[àçţüàľ %.2d 543210]"); + test.equal(rb.getStringJS("actual %(2d "), "[àçţüàľ %(2d 543210]"); + test.equal(rb.getStringJS("actual %4$-2.2d "), "[àçţüàľ %4$-2.2d 76543210]"); + + test.equal(rb.getStringJS("actual %N "), "[àçţüàľ %Ň 43210]"); + test.equal(rb.getStringJS("actual %F "), "[àçţüàľ %F 43210]"); + test.equal(rb.getStringJS("actual %D "), "[àçţüàľ %Ð 43210]"); + test.equal(rb.getStringJS("actual %O "), "[àçţüàľ %Ø 43210]"); + + test.equal(rb.getStringJS("actual %hd "), "[àçţüàľ %hd 543210]"); + test.equal(rb.getStringJS("actual %hhd "), "[àçţüàľ %hhd 543210]"); + test.equal(rb.getStringJS("actual %ld "), "[àçţüàľ %ld 543210]"); + test.equal(rb.getStringJS("actual %lld "), "[àçţüàľ %lld 543210]"); + test.equal(rb.getStringJS("actual %Af "), "[àçţüàľ %Af 543210]"); + test.equal(rb.getStringJS("actual %zd "), "[àçţüàľ %zd 543210]"); + test.equal(rb.getStringJS("actual %td "), "[àçţüàľ %td 543210]"); + test.equal(rb.getStringJS("actual %jd "), "[àçţüàľ %jd 543210]"); + test.equal(rb.getStringJS("actual %% "), "[àçţüàľ %% 43210]"); // now everything at once! - test.equal(rb.getStringJS("actual %2$+0.4lld "), "àçţüàľ %2$+0.4lld 876543210"); + test.equal(rb.getStringJS("actual %2$+0.4lld "), "[àçţüàľ %2$+0.4lld 876543210]"); // now some extended format specifiers to support Swift/Objective-C // from https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Strings/Articles/formatSpecifiers.html#//apple_ref/doc/uid/TP40004265-SW1 // %@ means format an objective-C or swift object - test.equal(rb.getStringJS("actual %@ "), "àçţüàľ %@ 43210"); - test.equal(rb.getStringJS("actual %2$@ "), "àçţüàľ %2$@ 543210"); - test.equal(rb.getStringJS("actual %2$0ll@ "), "àçţüàľ %2$0ll@ 76543210"); - test.equal(rb.getStringJS("actual %qd "), "àçţüàľ %qd 543210"); + test.equal(rb.getStringJS("actual %@ "), "[àçţüàľ %@ 43210]"); + test.equal(rb.getStringJS("actual %2$@ "), "[àçţüàľ %2$@ 543210]"); + test.equal(rb.getStringJS("actual %2$0ll@ "), "[àçţüàľ %2$0ll@ 76543210]"); + test.equal(rb.getStringJS("actual %qd "), "[àçţüàľ %qd 543210]"); test.done(); }, @@ -606,9 +606,9 @@ module.exports.testresources = { test.ok(rb !== null); // should be equivalent to "text" and not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), "Ħëľľõ fŕõm {country}"); - test.equal(rb.getString("Hello from {city}").toString(), "Ħëľľõ fŕõm {city}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "Ĝŕëëţíñğš fŕõm {city} íñ {country}"); + test.equal(rb.getString("Hello from {country}").toString(), "[Ħëľľõ fŕõm {country}]"); + test.equal(rb.getString("Hello from {city}").toString(), "[Ħëľľõ fŕõm {city}]"); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), "[Ĝŕëëţíñğš fŕõm {city} íñ {country}]"); test.done(); }, @@ -623,9 +623,9 @@ module.exports.testresources = { test.ok(rb !== null); // should still pseudo-translate, despite having no translations - test.equal(rb.getString("Hello from {country}").toString(), "Ħëľľõ fŕõm {country}"); - test.equal(rb.getString("Hello from {city}").toString(), "Ħëľľõ fŕõm {city}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "Ĝŕëëţíñğš fŕõm {city} íñ {country}"); + test.equal(rb.getString("Hello from {country}").toString(), "[Ħëľľõ fŕõm {country}]"); + test.equal(rb.getString("Hello from {city}").toString(), "[Ħëľľõ fŕõm {city}]"); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), "[Ĝŕëëţíñğš fŕõm {city} íñ {country}]"); test.done(); }, @@ -641,7 +641,7 @@ module.exports.testresources = { test.ok(rb !== null); // short: increase by 50% - test.equal(rb.getString("Hello from Paris").toString(), "Ħëľľõ fŕõm Pàŕíš76543210"); + test.equal(rb.getString("Hello from Paris").toString(), "[Ħëľľõ fŕõm Pàŕíš76543210]"); test.done(); }, @@ -657,7 +657,7 @@ module.exports.testresources = { test.ok(rb !== null); // short: increase by 33% - test.equal(rb.getString("Hello from Paris, city of lights").toString(), "Ħëľľõ fŕõm Pàŕíš, çíţÿ õf ľíğĥţš09876543210"); + test.equal(rb.getString("Hello from Paris, city of lights").toString(), "[Ħëľľõ fŕõm Pàŕíš, çíţÿ õf ľíğĥţš09876543210]"); test.done(); }, @@ -673,7 +673,7 @@ module.exports.testresources = { test.ok(rb !== null); // short: increase by 20% - test.equal(rb.getString("Hello from Paris, city of culture, lights, and superb cuisine.").toString(), "Ħëľľõ fŕõm Pàŕíš, çíţÿ õf çüľţüŕë, ľíğĥţš, àñð šüþëŕb çüíšíñë.109876543210"); + test.equal(rb.getString("Hello from Paris, city of culture, lights, and superb cuisine.").toString(), "[Ħëľľõ fŕõm Pàŕíš, çíţÿ õf çüľţüŕë, ľíğĥţš, àñð šüþëŕb çüíšíñë.109876543210]"); test.done(); }, @@ -687,7 +687,7 @@ module.exports.testresources = { test.ok(rb !== null); - test.equal(rb.getString("Hello from {city}").toString(), "Ħëľľõ fŕõm {city}"); + test.equal(rb.getString("Hello from {city}").toString(), "[Ħëľľõ fŕõm {city}]"); test.done(); }, @@ -701,7 +701,7 @@ module.exports.testresources = { test.ok(rb !== null); - test.equal(rb.getString('nCluster: {clusterName}').toString(), 'ñÇľüšţëŕ: {clusterName}'); + test.equal(rb.getString('nCluster: {clusterName}').toString(), '[ñÇľüšţëŕ: {clusterName}]'); test.done(); }, @@ -715,7 +715,7 @@ module.exports.testresources = { test.ok(rb !== null); - test.equal(rb.getString("Hello from {city}").toString(), "Ħëľľõ fŕõm <à ĥŕëf='üŕľ'>{çíţÿ}"); + test.equal(rb.getString("Hello from {city}").toString(), "[Ħëľľõ fŕõm <à ĥŕëf='üŕľ'>{çíţÿ}]"); test.done(); }, @@ -729,7 +729,7 @@ module.exports.testresources = { test.ok(rb !== null); - test.equal(rb.getString("Hello from {city}").toString(), "Ħëľľõ fŕõm <à ĥŕëf='üŕľ'>{city}"); + test.equal(rb.getString("Hello from {city}").toString(), "[Ħëľľõ fŕõm <à ĥŕëf='üŕľ'>{city}]"); test.done(); }, @@ -743,7 +743,7 @@ module.exports.testresources = { test.ok(rb !== null); - test.equal(rb.getString("Hello from {city} & {country}").toString(), "Ħëľľõ fŕõm {city} & {country}"); + test.equal(rb.getString("Hello from {city} & {country}").toString(), "[Ħëľľõ fŕõm {city} & {country}]"); test.done(); }, @@ -757,7 +757,7 @@ module.exports.testresources = { test.ok(rb !== null); - test.equal(rb.getString("Hello from {city} & {country}").toString(), "Ħëľľõ fŕõm {çíţÿ} &àmþ; {çõüñţŕÿ}"); + test.equal(rb.getString("Hello from {city} & {country}").toString(), "[Ħëľľõ fŕõm {çíţÿ} &àmþ; {çõüñţŕÿ}]"); test.done(); }, @@ -771,7 +771,7 @@ module.exports.testresources = { test.ok(rb !== null); - test.equal(rb.getString("Hello from {city} & {country}").toString(), "Ħëľľõ fŕõm {city} &àmþ; {country}"); + test.equal(rb.getString("Hello from {city} & {country}").toString(), "[Ħëľľõ fŕõm {city} &àmþ; {country}]"); test.done(); }, @@ -786,9 +786,9 @@ module.exports.testresources = { test.ok(rb !== null); // should still pseudo-translate, despite having no translations - test.equal(rb.getString("Hello from {country}").toString(), "Ħëľľõ fŕõm {country}"); - test.equal(rb.getString("Hello from {city}").toString(), "Ħëľľõ fŕõm {city}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "Ĝŕëëţíñğš fŕõm {city} íñ {country}"); + test.equal(rb.getString("Hello from {country}").toString(), "[Ħëľľõ fŕõm {country}]"); + test.equal(rb.getString("Hello from {city}").toString(), "[Ħëľľõ fŕõm {city}]"); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), "[Ĝŕëëţíñğš fŕõm {city} íñ {country}]"); test.done(); }, @@ -804,7 +804,7 @@ module.exports.testresources = { test.ok(rb !== null); // short: increase by 50% - test.equal(rb.getString("Hello from Paris").toString(), "Ħëľľõ fŕõm Pàŕíš76543210"); + test.equal(rb.getString("Hello from Paris").toString(), "[Ħëľľõ fŕõm Pàŕíš76543210]"); test.done(); }, @@ -820,7 +820,7 @@ module.exports.testresources = { test.ok(rb !== null); // short: increase by 33% - test.equal(rb.getString("Hello from Paris, city of lights").toString(), "Ħëľľõ fŕõm Pàŕíš, çíţÿ õf ľíğĥţš09876543210"); + test.equal(rb.getString("Hello from Paris, city of lights").toString(), "[Ħëľľõ fŕõm Pàŕíš, çíţÿ õf ľíğĥţš09876543210]"); test.done(); }, @@ -836,7 +836,7 @@ module.exports.testresources = { test.ok(rb !== null); // short: increase by 20% - test.equal(rb.getString("Hello from Paris, city of culture, lights, and superb cuisine.").toString(), "Ħëľľõ fŕõm Pàŕíš, çíţÿ õf çüľţüŕë, ľíğĥţš, àñð šüþëŕb çüíšíñë.109876543210"); + test.equal(rb.getString("Hello from Paris, city of culture, lights, and superb cuisine.").toString(), "[Ħëľľõ fŕõm Pàŕíš, çíţÿ õf çüľţüŕë, ľíğĥţš, àñð šüþëŕb çüíšíñë.109876543210]"); test.done(); }, @@ -850,7 +850,7 @@ module.exports.testresources = { test.ok(rb !== null); - test.equal(rb.getString("Hello from {city}").toString(), "Ħëľľõ fŕõm {city}"); + test.equal(rb.getString("Hello from {city}").toString(), "[Ħëľľõ fŕõm {city}]"); test.done(); }, @@ -864,7 +864,7 @@ module.exports.testresources = { test.ok(rb !== null); - test.equal(rb.getString("Hello from {city} & {country}").toString(), "Ħëľľõ fŕõm {city} & {country}"); + test.equal(rb.getString("Hello from {city} & {country}").toString(), "[Ħëľľõ fŕõm {city} & {country}]"); test.done(); }, @@ -1188,7 +1188,7 @@ module.exports.testresources = { test.ok(rb !== null); - test.equal(rb.getString("Hello from Paris, city of lights.").toString(), "Ħëľľõ fŕõm Pàŕíš, çíţÿ õf ľíğĥţš."); + test.equal(rb.getString("Hello from Paris, city of lights.").toString(), "[Ħëľľõ fŕõm Pàŕíš, çíţÿ õf ľíğĥţš.]"); test.done(); }, @@ -1202,7 +1202,7 @@ module.exports.testresources = { test.ok(rb !== null); - test.equal(rb.getString("Hello from Paris, city of lights.", undefined, "html").toString(), "Ħëľľõ fŕõm <a href=\"asdf\">Pàŕíš</a>, çíţÿ õf ľíğĥţš."); + test.equal(rb.getString("Hello from Paris, city of lights.", undefined, "html").toString(), "[Ħëľľõ fŕõm <a href=\"asdf\">Pàŕíš</a>, çíţÿ õf ľíğĥţš.]"); test.done(); }, @@ -1217,7 +1217,7 @@ module.exports.testresources = { test.ok(rb !== null); test.equal(rb.getStringJS("Hello from <%= (i > 4) ? RB.getStringJS(\"Las Vegas\") : RB.getStringJS(\"Paris\") %>, city of lights.", undefined, "none"), - "Ħëľľõ fŕõm <%= (i > 4) ? RB.getStringJS(\"Las Vegas\") : RB.getStringJS(\"Paris\") %>, çíţÿ õf ľíğĥţš."); + "[Ħëľľõ fŕõm <%= (i > 4) ? RB.getStringJS(\"Las Vegas\") : RB.getStringJS(\"Paris\") %>, çíţÿ õf ľíğĥţš.]"); test.done(); }, @@ -1231,7 +1231,7 @@ module.exports.testresources = { test.ok(rb !== null); - test.equal(rb.getStringJS("Hello from %PARIS%, city of lights.", undefined, "html"), "Ħëľľõ fŕõm %PARIS%, çíţÿ õf ľíğĥţš."); + test.equal(rb.getStringJS("Hello from %PARIS%, city of lights.", undefined, "html"), "[Ħëľľõ fŕõm %PARIS%, çíţÿ õf ľíğĥţš.]"); test.done(); }, @@ -1245,7 +1245,7 @@ module.exports.testresources = { test.ok(rb !== null); - test.equal(rb.getStringJS("Hello from %{city}, city of #{description}."), "Ħëľľõ fŕõm %{city}, çíţÿ õf #{description}."); + test.equal(rb.getStringJS("Hello from %{city}, city of #{description}."), "[Ħëľľõ fŕõm %{city}, çíţÿ õf #{description}.]"); test.done(); }, @@ -1259,7 +1259,7 @@ module.exports.testresources = { test.ok(rb !== null); - test.equal(rb.getString("Hello from Paris, city of lights.", undefined, "js").toString(), "Ħëľľõ fŕõm Pàŕíš, çíţÿ õf ľíğĥţš."); + test.equal(rb.getString("Hello from Paris, city of lights.", undefined, "js").toString(), "[Ħëľľõ fŕõm Pàŕíš, çíţÿ õf ľíğĥţš.]"); test.done(); }, @@ -1552,9 +1552,9 @@ module.exports.testresources = { test.ok(rb !== null); // should pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), "Хэлло фром {чоунтря}"); - test.equal(rb.getString("Hello from {city}").toString(), "Хэлло фром {читя}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "Грээтингс фром {читя} ин {чоунтря}"); + test.equal(rb.getString("Hello from {country}").toString(), "[Хэлло фром {чоунтря}]"); + test.equal(rb.getString("Hello from {city}").toString(), "[Хэлло фром {читя}]"); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), "[Грээтингс фром {читя} ин {чоунтря}]"); test.done(); }, testResBundleGetStringko_KR: function(test) { @@ -1678,9 +1678,9 @@ module.exports.testresources = { test.ok(rb !== null); // should not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), "Хэлло фром {country}"); - test.equal(rb.getString("Hello from {city}").toString(), "Хэлло фром {city}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "Грээтингс фром {city} ин {country}"); + test.equal(rb.getString("Hello from {country}").toString(), "[Хэлло фром {country}]"); + test.equal(rb.getString("Hello from {city}").toString(), "[Хэлло фром {city}]"); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), "[Грээтингс фром {city} ин {country}]"); test.done(); }, @@ -1695,9 +1695,9 @@ module.exports.testresources = { test.ok(rb !== null); // should not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), "Хэлло фром {country}"); - test.equal(rb.getString("Hello from {city}").toString(), "Хэлло фром {city}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "Грээтингс фром {city} ин {country}"); + test.equal(rb.getString("Hello from {country}").toString(), "[Хэлло фром {country}]"); + test.equal(rb.getString("Hello from {city}").toString(), "[Хэлло фром {city}]"); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), "[Грээтингс фром {city} ин {country}]"); test.done(); }, @@ -1712,9 +1712,9 @@ module.exports.testresources = { test.ok(rb !== null); // should not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), "Хэлло фром {country}"); - test.equal(rb.getString("Hello from {city}").toString(), "Хэлло фром {city}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "Грээтингс фром {city} ин {country}"); + test.equal(rb.getString("Hello from {country}").toString(), "[Хэлло фром {country}]"); + test.equal(rb.getString("Hello from {city}").toString(), "[Хэлло фром {city}]"); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), "[Грээтингс фром {city} ин {country}]"); test.done(); }, @@ -1728,9 +1728,9 @@ module.exports.testresources = { test.ok(rb !== null); // should be equivalent to "text" and not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), "Хэлло фром {country}"); - test.equal(rb.getString("Hello from {city}").toString(), "Хэлло фром {city}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "Грээтингс фром {city} ин {country}"); + test.equal(rb.getString("Hello from {country}").toString(), "[Хэлло фром {country}]"); + test.equal(rb.getString("Hello from {city}").toString(), "[Хэлло фром {city}]"); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), "[Грээтингс фром {city} ин {country}]"); test.done(); }, @@ -1746,9 +1746,9 @@ module.exports.testresources = { // should not pseudo-ize the replacement parameter names // for Chinese scripts, remove the spaces to the simulate Chinese writing style - test.equal(rb.getString("Hello from {country}").toString(), "和俄了了夥凡熱夥们{country}"); - test.equal(rb.getString("Hello from {city}").toString(), "和俄了了夥凡熱夥们{city}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "个熱俄俄推意尼个思凡熱夥们{city}意尼{country}"); + test.equal(rb.getString("Hello from {country}").toString(), "[和俄了了夥凡熱夥们{country}]"); + test.equal(rb.getString("Hello from {city}").toString(), "[和俄了了夥凡熱夥们{city}]"); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), "[个熱俄俄推意尼个思凡熱夥们{city}意尼{country}]"); test.done(); }, @@ -1763,9 +1763,9 @@ module.exports.testresources = { test.ok(rb !== null); // should not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), "הֶללֹ פרֹמ {country}"); - test.equal(rb.getString("Hello from {city}").toString(), "הֶללֹ פרֹמ {city}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "גרֶֶטִנגס פרֹמ {city} ִנ {country}"); + test.equal(rb.getString("Hello from {country}").toString(), '[הֶללֹ פרֹמ {country}]'); + test.equal(rb.getString("Hello from {city}").toString(), '[הֶללֹ פרֹמ {city}]'); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), '[גרֶֶטִנגס פרֹמ {city} ִנ {country}]'); test.done(); }, @@ -1854,9 +1854,9 @@ module.exports.testresources = { test.ok(rb !== null); - test.equal(rb.getString("Hello from {country}").toString(), "Хэлло фром {чоунтря}"); - test.equal(rb.getString("Hello from {city}").toString(), "Хэлло фром {читя}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "Грээтингс фром {читя} ин {чоунтря}"); + test.equal(rb.getString("Hello from {country}").toString(), "[Хэлло фром {чоунтря}]"); + test.equal(rb.getString("Hello from {city}").toString(), "[Хэлло фром {читя}]"); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), "[Грээтингс фром {читя} ин {чоунтря}]"); test.done(); }, @@ -1888,9 +1888,9 @@ module.exports.testresources = { test.ok(rb !== null); // should not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), "Ħëľľõ fŕõm {country}"); - test.equal(rb.getString("Hello from {city}").toString(), "Ħëľľõ fŕõm {city}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "Ĝŕëëţíñğš fŕõm {city} íñ {country}"); + test.equal(rb.getString("Hello from {country}").toString(), "[Ħëľľõ fŕõm {country}]"); + test.equal(rb.getString("Hello from {city}").toString(), "[Ħëľľõ fŕõm {city}]"); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), "[Ĝŕëëţíñğš fŕõm {city} íñ {country}]"); test.done(); }, @@ -1905,9 +1905,9 @@ module.exports.testresources = { test.ok(rb !== null); // should not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), "Хэлло фром {country}"); - test.equal(rb.getString("Hello from {city}").toString(), "Хэлло фром {city}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "Грээтингс фром {city} ин {country}"); + test.equal(rb.getString("Hello from {country}").toString(), "[Хэлло фром {country}]"); + test.equal(rb.getString("Hello from {city}").toString(), "[Хэлло фром {city}]"); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), "[Грээтингс фром {city} ин {country}]"); test.done(); }, @@ -1922,9 +1922,9 @@ module.exports.testresources = { test.ok(rb !== null); // should not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), "הֶללֹ פרֹמ {country}"); - test.equal(rb.getString("Hello from {city}").toString(), "הֶללֹ פרֹמ {city}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "גרֶֶטִנגס פרֹמ {city} ִנ {country}"); + test.equal(rb.getString("Hello from {country}").toString(), '[הֶללֹ פרֹמ {country}]'); + test.equal(rb.getString("Hello from {city}").toString(), '[הֶללֹ פרֹמ {city}]'); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), '[גרֶֶטִנגס פרֹמ {city} ִנ {country}]'); test.done(); }, @@ -1940,9 +1940,9 @@ module.exports.testresources = { // should not pseudo-ize the replacement parameter names // for Chinese scripts, remove the spaces to the simulate Chinese writing style - test.equal(rb.getString("Hello from {country}").toString(), "和俄了了夥凡熱夥们{country}"); - test.equal(rb.getString("Hello from {city}").toString(), "和俄了了夥凡熱夥们{city}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "个熱俄俄推意尼个思凡熱夥们{city}意尼{country}"); + test.equal(rb.getString("Hello from {country}").toString(), "[和俄了了夥凡熱夥们{country}]"); + test.equal(rb.getString("Hello from {city}").toString(), "[和俄了了夥凡熱夥们{city}]"); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), "[个熱俄俄推意尼个思凡熱夥们{city}意尼{country}]"); test.done(); }, @@ -2013,7 +2013,7 @@ module.exports.testresources = { var rb = new ResBundle({ locale:'eu-ES' }); - test.equal(rb.getStringJS("This is pseudo string test"), "Ťĥíš íš þšëüðõ šţŕíñğ ţëšţ"); + test.equal(rb.getStringJS("This is pseudo string test"), "[Ťĥíš íš þšëüðõ šţŕíñğ ţëšţ]"); test.done(); ilib.clearPseudoLocales(); }, @@ -2025,7 +2025,7 @@ module.exports.testresources = { var rb = new ResBundle({ locale:'ps-AF' }); - test.equal(rb.getStringJS("This is pseudo string test"), 'טהִס ִס פסֶֻדֹ סטרִנג טֶסט'); + test.equal(rb.getStringJS("This is pseudo string test"), '[טהִס ִס פסֶֻדֹ סטרִנג טֶסט]'); test.done(); ilib.clearPseudoLocales(); @@ -2038,7 +2038,7 @@ module.exports.testresources = { var rb = new ResBundle({ locale:'de-DE' }); - test.equal(rb.getStringJS("This is pseudo string test"), "Ťĥíš íš þšëüðõ šţŕíñğ ţëšţ"); + test.equal(rb.getStringJS("This is pseudo string test"), "[Ťĥíš íš þšëüðõ šţŕíñğ ţëšţ]"); test.done(); ilib.clearPseudoLocales(); }, @@ -2135,7 +2135,7 @@ module.exports.testresources = { // this used to throw an exception: var rb = new ResBundle(); - test.equal(rb.getStringJS("translation"), "ţŕàñšľàţíõñ"); + test.equal(rb.getStringJS("translation"), "[ţŕàñšľàţíõñ]"); test.done(); ilib.setLocale(tmp); diff --git a/js/test/root/testresourcesasync.js b/js/test/root/testresourcesasync.js index fe35d256f1..866630c6a4 100644 --- a/js/test/root/testresourcesasync.js +++ b/js/test/root/testresourcesasync.js @@ -197,9 +197,9 @@ module.exports.testresourcesasync = { test.ok(rb !== null); // should not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), "Ħëľľõ fŕõm {çõüñţŕÿ}"); - test.equal(rb.getString("Hello from {city}").toString(), "Ħëľľõ fŕõm {çíţÿ}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "Ĝŕëëţíñğš fŕõm {çíţÿ} íñ {çõüñţŕÿ}"); + test.equal(rb.getString("Hello from {country}").toString(), "[Ħëľľõ fŕõm {çõüñţŕÿ}]"); + test.equal(rb.getString("Hello from {city}").toString(), "[Ħëľľõ fŕõm {çíţÿ}]"); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), "[Ĝŕëëţíñğš fŕõm {çíţÿ} íñ {çõüñţŕÿ}]"); test.done(); } }); @@ -247,9 +247,9 @@ module.exports.testresourcesasync = { test.ok(rb !== null); // should pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), "Хэлло фром {чоунтря}"); - test.equal(rb.getString("Hello from {city}").toString(), "Хэлло фром {читя}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "Грээтингс фром {читя} ин {чоунтря}"); + test.equal(rb.getString("Hello from {country}").toString(),'[Хэлло фром {чоунтря}]'); + test.equal(rb.getString("Hello from {city}").toString(), '[Хэлло фром {читя}]'); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), '[Грээтингс фром {читя} ин {чоунтря}]'); test.done(); } }); @@ -268,9 +268,9 @@ module.exports.testresourcesasync = { // should not pseudo-ize the replacement parameter names // for Chinese scripts, remove the spaces to the simulate Chinese writing style - test.equal(rb.getString("Hello from {country}").toString(), "和俄了了夥凡熱夥们{country}"); - test.equal(rb.getString("Hello from {city}").toString(), "和俄了了夥凡熱夥们{city}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "个熱俄俄推意尼个思凡熱夥们{city}意尼{country}"); + test.equal(rb.getString("Hello from {country}").toString(), "[和俄了了夥凡熱夥们{country}]"); + test.equal(rb.getString("Hello from {city}").toString(), "[和俄了了夥凡熱夥们{city}]"); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), '[个熱俄俄推意尼个思凡熱夥们{city}意尼{country}]'); test.done(); } }); @@ -288,9 +288,9 @@ module.exports.testresourcesasync = { test.ok(rb !== null); // should not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), "הֶללֹ פרֹמ {country}"); - test.equal(rb.getString("Hello from {city}").toString(), "הֶללֹ פרֹמ {city}"); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), "גרֶֶטִנגס פרֹמ {city} ִנ {country}"); + test.equal(rb.getString("Hello from {country}").toString(),'[הֶללֹ פרֹמ {country}]'); + test.equal(rb.getString("Hello from {city}").toString(), '[הֶללֹ פרֹמ {city}]'); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), '[גרֶֶטִנגס פרֹמ {city} ִנ {country}]'); test.done(); } }); @@ -305,7 +305,7 @@ module.exports.testresourcesasync = { locale:'eu-ES', sync: false, onLoad: function(rb) { - test.equal(rb.getString("This is psuedo string test").toString(), "Ťĥíš íš þšüëðõ šţŕíñğ ţëšţ"); + test.equal(rb.getString("This is psuedo string test").toString(), '[Ťĥíš íš þšüëðõ šţŕíñğ ţëšţ]'); test.done(); ilib.clearPseudoLocales(); } @@ -320,7 +320,7 @@ module.exports.testresourcesasync = { locale:'ps-AF', sync: false, onLoad: function(rb) { - test.equal(rb.getString("This is psuedo string test").toString(), "טהִס ִס פסֶֻדֹ סטרִנג טֶסט"); + test.equal(rb.getString("This is psuedo string test").toString(), '[טהִס ִס פסֶֻדֹ סטרִנג טֶסט]'); test.done(); ilib.clearPseudoLocales(); } From 8ba6d80c33840bc5df9a9c88e4ef219e6af9e4cf Mon Sep 17 00:00:00 2001 From: Goun Lee Date: Wed, 5 Jul 2023 10:03:46 +0900 Subject: [PATCH 17/24] update version --- build.properties | 2 +- docs/ReleaseNotes.md | 5 +++-- js/test/root/testglobal.js | 2 +- package.json | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build.properties b/build.properties index 6ac74ac52e..3b252c2828 100644 --- a/build.properties +++ b/build.properties @@ -13,4 +13,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -version=14.17.1 +version=14.18.0 diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index 44e6ffe4f5..adfa992182 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -3,8 +3,9 @@ Release Notes for Version 14 Build 027 ------- -Published as version 14.17.1 - +Published as version 14.18.0 +New Features: +* Updated pseudo string to be encapsulated. Bug Fixes: * Updated to IANA time zone data version 2023b diff --git a/js/test/root/testglobal.js b/js/test/root/testglobal.js index e3554195ed..d5012babe2 100644 --- a/js/test/root/testglobal.js +++ b/js/test/root/testglobal.js @@ -74,7 +74,7 @@ module.exports.testglobal = { return; } test.expect(1); - test.equal(ilib.getVersion().substring(0,5), "14.17"); + test.equal(ilib.getVersion().substring(0,5), "14.18"); test.done(); }, diff --git a/package.json b/package.json index 76d8c622a8..e8a640eea6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ilib", - "version": "14.17.1", + "version": "14.18.0", "main": "js/index.js", "description": "iLib is a cross-engine library of internationalization (i18n) classes written in pure JS", "keywords": [ From 29b85a334a6874b30f0a881a18fb67241149d19d Mon Sep 17 00:00:00 2001 From: Goun Lee Date: Wed, 5 Jul 2023 10:21:00 +0900 Subject: [PATCH 18/24] Update file's copyright year --- js/test/root/testresources.js | 2 +- js/test/root/testresourcesasync.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/test/root/testresources.js b/js/test/root/testresources.js index 5fd369f3c4..4abd6d41bc 100644 --- a/js/test/root/testresources.js +++ b/js/test/root/testresources.js @@ -1,7 +1,7 @@ /* * testresources.js - test the Resources object * - * Copyright © 2012-2015, 2017-2019, 2021-2022 JEDLSoft + * Copyright © 2012-2015, 2017-2019, 2021-2023 JEDLSoft * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/js/test/root/testresourcesasync.js b/js/test/root/testresourcesasync.js index 866630c6a4..aad6efc060 100644 --- a/js/test/root/testresourcesasync.js +++ b/js/test/root/testresourcesasync.js @@ -1,7 +1,7 @@ /* * testresourcesasync.js - test the Resources object * - * Copyright © 2018-2019, 2022 JEDLSoft + * Copyright © 2018-2019, 2022-2023 JEDLSoft * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From d05524cc4a0a5a92e6f3dba64f3720bdd7526a3c Mon Sep 17 00:00:00 2001 From: Goun Lee Date: Wed, 5 Jul 2023 13:33:59 +0900 Subject: [PATCH 19/24] Update ReleaseNotes to give more information --- docs/ReleaseNotes.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index adfa992182..8e92d016eb 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -4,8 +4,10 @@ Release Notes for Version 14 Build 027 ------- Published as version 14.18.0 + New Features: -* Updated pseudo string to be encapsulated. +* Updated pseudo strings to be encapsulated with square brackets so that you can tell when the resource string starts and ends. + Bug Fixes: * Updated to IANA time zone data version 2023b From 65ddebd07743e64292c2991bb3ad413ac7fe85f6 Mon Sep 17 00:00:00 2001 From: Goun Lee Date: Wed, 5 Jul 2023 14:34:59 +0900 Subject: [PATCH 20/24] Fix test failures --- js/test/root/testresources.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/js/test/root/testresources.js b/js/test/root/testresources.js index 4f8ea4a12e..0630e26c6e 100644 --- a/js/test/root/testresources.js +++ b/js/test/root/testresources.js @@ -623,9 +623,9 @@ module.exports.testresources = { test.ok(rb !== null); // should be equivalent to "text" and not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), 'ঠ্ড়িহএললও fরওম {country}'); - test.equal(rb.getString("Hello from {city}").toString(), 'ঠ্ড়িহএললও fরওম {city}'); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), 'ঠ্ড়িগরএএতইনগশ fরওম {city} ইন {country}'); + test.equal(rb.getString("Hello from {country}").toString(), '[ঠ্ড়িহএললও fরওম {country}]'); + test.equal(rb.getString("Hello from {city}").toString(), '[ঠ্ড়িহএললও fরওম {city}]'); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), '[ঠ্ড়িগরএএতইনগশ fরওম {city} ইন {country}]'); ilib.clearPseudoLocales(); test.done(); @@ -642,9 +642,9 @@ module.exports.testresources = { test.ok(rb !== null); // should be equivalent to "text" and not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), 'ઈૄહએલલઓ fૃઓં {country}'); - test.equal(rb.getString("Hello from {city}").toString(), 'ઈૄહએલલઓ fૃઓં {city}'); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), 'ઈૄગૃએએતઇઙગષ fૃઓં {city} ઇઙ {country}'); + test.equal(rb.getString("Hello from {country}").toString(), '[ઈૄહએલલઓ fૃઓં {country}]'); + test.equal(rb.getString("Hello from {city}").toString(), '[ઈૄહએલલઓ fૃઓં {city}]'); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), '[ઈૄગૃએએતઇઙગષ fૃઓં {city} ઇઙ {country}]'); ilib.clearPseudoLocales(); test.done(); @@ -661,9 +661,9 @@ module.exports.testresources = { test.ok(rb !== null); // should be equivalent to "text" and not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), 'ବିୣଁହଁଏଲଲଓ ଫଁରଓମ {country}'); - test.equal(rb.getString("Hello from {city}").toString(), 'ବିୣଁହଁଏଲଲଓ ଫଁରଓମ {city}'); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), 'ବିୣଁଗରଏଏତଇନଗସଁ ଫଁରଓମ {city} ଇନ {country}'); + test.equal(rb.getString("Hello from {country}").toString(), '[ବିୣଁହଁଏଲଲଓ ଫଁରଓମ {country}]'); + test.equal(rb.getString("Hello from {city}").toString(), '[ବିୣଁହଁଏଲଲଓ ଫଁରଓମ {city}]'); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), '[ବିୣଁଗରଏଏତଇନଗସଁ ଫଁରଓମ {city} ଇନ {country}]'); ilib.clearPseudoLocales(); test.done(); @@ -679,9 +679,9 @@ module.exports.testresources = { test.ok(rb !== null); // should be equivalent to "text" and not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), 'ሿ፝ሁኤለለኦ ፈረኦመ {country}'); - test.equal(rb.getString("Hello from {city}").toString(), 'ሿ፝ሁኤለለኦ ፈረኦመ {city}'); - test.equal(rb.getString("Greetings from {city} in {country}").toString(),'ሿ፝ጉረኤኤተኢነገሰ ፈረኦመ {city} ኢነ {country}'); + test.equal(rb.getString("Hello from {country}").toString(), '[ሿ፝ሁኤለለኦ ፈረኦመ {country}]'); + test.equal(rb.getString("Hello from {city}").toString(), '[ሿ፝ሁኤለለኦ ፈረኦመ {city}]'); + test.equal(rb.getString("Greetings from {city} in {country}").toString(),'[ሿ፝ጉረኤኤተኢነገሰ ፈረኦመ {city} ኢነ {country}]'); ilib.clearPseudoLocales(); test.done(); @@ -698,9 +698,9 @@ module.exports.testresources = { test.ok(rb !== null); // should be equivalent to "text" and not pseudo-ize the replacement parameter names - test.equal(rb.getString("Hello from {country}").toString(), 'ਊਂਹ੍ਹਐਲਲਔ ਫ਼ਰਔਮ {country}'); - test.equal(rb.getString("Hello from {city}").toString(), 'ਊਂਹ੍ਹਐਲਲਔ ਫ਼ਰਔਮ {city}'); - test.equal(rb.getString("Greetings from {city} in {country}").toString(), 'ਊਂਹ੍ਗਰਐਐਤਇਨਗਸ ਫ਼ਰਔਮ {city} ਇਨ {country}'); + test.equal(rb.getString("Hello from {country}").toString(), '[ਊਂਹ੍ਹਐਲਲਔ ਫ਼ਰਔਮ {country}]'); + test.equal(rb.getString("Hello from {city}").toString(), '[ਊਂਹ੍ਹਐਲਲਔ ਫ਼ਰਔਮ {city}]'); + test.equal(rb.getString("Greetings from {city} in {country}").toString(), '[ਊਂਹ੍ਗਰਐਐਤਇਨਗਸ ਫ਼ਰਔਮ {city} ਇਨ {country}]'); ilib.clearPseudoLocales(); test.done(); From 390a64c9201249679e235ed285b4c5132aafd827 Mon Sep 17 00:00:00 2001 From: Goun Lee Date: Wed, 5 Jul 2023 16:42:20 +0900 Subject: [PATCH 21/24] update doc to check it the updating happen properly --- docs/ReleaseNotes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index f2b61982e4..d235658c8f 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -8,7 +8,7 @@ Published as version 14.18.0 New Features: * Updated pseudo strings to be encapsulated with square brackets so that you can tell when the resource string starts and ends. * Added more pseudomap data to test by adding pseudoLocale. - * Added tall properly in some pseudo map data which is the tallest glyphs in the script + * Added tall properly in some `pseudomap.json` files which is the tallest glyphs in the script and it is going to be included first in a pseudo string. Bug Fixes: From b93e41384f294dea5a715f411ab274be42a6ff4d Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Sun, 9 Jul 2023 15:11:54 -0700 Subject: [PATCH 22/24] Update to time zone data 2023c --- js/data/locale/zoneinfo/Asia/Beirut.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/data/locale/zoneinfo/Asia/Beirut.json b/js/data/locale/zoneinfo/Asia/Beirut.json index 9fc34e2f97..65e5292877 100644 --- a/js/data/locale/zoneinfo/Asia/Beirut.json +++ b/js/data/locale/zoneinfo/Asia/Beirut.json @@ -10,8 +10,8 @@ "o": "2:0", "s": { "c": "S", - "m": 4, - "r": "21", + "m": 3, + "r": "l0", "t": "0:0", "v": "1:0" } From 7eec2aec76c579cce68b53209cbb07787502c91d Mon Sep 17 00:00:00 2001 From: Edwin Hoogerbeets Date: Sun, 9 Jul 2023 15:13:09 -0700 Subject: [PATCH 23/24] Add rel note --- docs/ReleaseNotes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index 8e92d016eb..7302cb4a2e 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -9,7 +9,7 @@ New Features: * Updated pseudo strings to be encapsulated with square brackets so that you can tell when the resource string starts and ends. Bug Fixes: -* Updated to IANA time zone data version 2023b +* Updated to IANA time zone data version 2023b and then 2023c Build 026 ------- From db66f5c8b91d14a2695064e50f4b793387078fe9 Mon Sep 17 00:00:00 2001 From: Goun Lee Date: Mon, 10 Jul 2023 11:23:17 +0900 Subject: [PATCH 24/24] Update ReleaseNotes --- docs/ReleaseNotes.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/ReleaseNotes.md b/docs/ReleaseNotes.md index d235658c8f..4321f0c1bf 100644 --- a/docs/ReleaseNotes.md +++ b/docs/ReleaseNotes.md @@ -7,9 +7,10 @@ Published as version 14.18.0 New Features: * Updated pseudo strings to be encapsulated with square brackets so that you can tell when the resource string starts and ends. -* Added more pseudomap data to test by adding pseudoLocale. - * Added tall properly in some `pseudomap.json` files which is the tallest glyphs in the script - and it is going to be included first in a pseudo string. +* Added more pseudomap data for use in testing different fonts using pseudo locales. + * Added a "tall" property in some pseudomap.json files which gives the tallest glyph in the script. + This tallest glyph is included at the beginning of a pseudo localized string in order to test + if there is enough room for the height of text in each UI element. Bug Fixes: * Updated to IANA time zone data version 2023b