@quenty/clienttranslator 14.18.2-canary.544.d46888c.0 → 14.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [14.18.2
|
|
6
|
+
## [14.18.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/clienttranslator@14.18.1...@quenty/clienttranslator@14.18.2) (2025-03-31)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @quenty/clienttranslator
|
|
9
9
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/clienttranslator",
|
|
3
|
-
"version": "14.18.2
|
|
3
|
+
"version": "14.18.2",
|
|
4
4
|
"description": "Gets local translator for player",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,20 +25,20 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/blend": "12.17.2
|
|
29
|
-
"@quenty/instanceutils": "13.16.2
|
|
30
|
-
"@quenty/loader": "10.8.0",
|
|
31
|
-
"@quenty/maid": "3.4.0",
|
|
32
|
-
"@quenty/promise": "10.10.1",
|
|
33
|
-
"@quenty/promisemaid": "5.10.1",
|
|
34
|
-
"@quenty/pseudolocalize": "3.4.0",
|
|
35
|
-
"@quenty/rx": "13.16.2
|
|
36
|
-
"@quenty/string": "3.3.1",
|
|
37
|
-
"@quenty/table": "3.7.1",
|
|
38
|
-
"@quenty/valueobject": "13.16.2
|
|
28
|
+
"@quenty/blend": "^12.17.2",
|
|
29
|
+
"@quenty/instanceutils": "^13.16.2",
|
|
30
|
+
"@quenty/loader": "^10.8.0",
|
|
31
|
+
"@quenty/maid": "^3.4.0",
|
|
32
|
+
"@quenty/promise": "^10.10.1",
|
|
33
|
+
"@quenty/promisemaid": "^5.10.1",
|
|
34
|
+
"@quenty/pseudolocalize": "^3.4.0",
|
|
35
|
+
"@quenty/rx": "^13.16.2",
|
|
36
|
+
"@quenty/string": "^3.3.1",
|
|
37
|
+
"@quenty/table": "^3.7.1",
|
|
38
|
+
"@quenty/valueobject": "^13.16.2"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "af926ec08f523833f37d22477c72dca034219823"
|
|
44
44
|
}
|
|
@@ -1,112 +1,110 @@
|
|
|
1
|
-
local require = require(
|
|
1
|
+
local require = require(script.Parent.loader).load(script)
|
|
2
2
|
|
|
3
|
-
local Jest = require("Jest")
|
|
4
3
|
local NumberLocalizationUtils = require("NumberLocalizationUtils")
|
|
5
4
|
local RoundingBehaviourTypes = require("RoundingBehaviourTypes")
|
|
6
5
|
|
|
7
|
-
|
|
8
|
-
local expect = Jest.Globals.expect
|
|
9
|
-
local it = Jest.Globals.it
|
|
6
|
+
return function()
|
|
10
7
|
|
|
11
|
-
local function checkLocale(locale, responseMapping)
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
local function checkLocale(locale, responseMapping)
|
|
9
|
+
for input, output in pairs(responseMapping) do
|
|
10
|
+
expect(NumberLocalizationUtils.localize(input, locale)).to.equal(output)
|
|
11
|
+
end
|
|
14
12
|
end
|
|
15
|
-
end
|
|
16
13
|
|
|
17
|
-
local function checkValid_en_zh(locale)
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
end
|
|
14
|
+
local function checkValid_en_zh(locale)
|
|
15
|
+
checkLocale(locale, {
|
|
16
|
+
[0] = "0",
|
|
17
|
+
[1] = "1",
|
|
18
|
+
[25] = "25",
|
|
19
|
+
[364] = "364",
|
|
20
|
+
[4120] = "4,120",
|
|
21
|
+
[57860] = "57,860",
|
|
22
|
+
[624390] = "624,390",
|
|
23
|
+
[7857000] = "7,857,000",
|
|
24
|
+
[-12345678] = "-12,345,678",
|
|
25
|
+
[23987.45678] = "23,987.45678",
|
|
26
|
+
[-12.3456] = "-12.3456",
|
|
27
|
+
[-23987.45678] = "-23,987.45678",
|
|
28
|
+
})
|
|
29
|
+
end
|
|
33
30
|
|
|
34
|
-
describe("NumberLocalizationUtils.localize", function()
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
describe("NumberLocalizationUtils.localize", function()
|
|
32
|
+
-- it("should default to en-us when locale is not recognized", function()
|
|
33
|
+
-- local logs = Logging.capture(function()
|
|
34
|
+
-- checkValid_en_zh("bad_locale")
|
|
35
|
+
-- end)
|
|
36
|
+
-- expect(string.match(logs.warnings[1], "^Warning: Locale not found:") ~= nil).to.equal(true)
|
|
37
|
+
-- end)
|
|
41
38
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
39
|
+
-- it("should default to en-us when locale is nil", function()
|
|
40
|
+
-- local logs = Logging.capture(function()
|
|
41
|
+
-- checkValid_en_zh(nil)
|
|
42
|
+
-- end)
|
|
43
|
+
-- expect(string.match(logs.warnings[1], "^Warning: Locale not found:") ~= nil).to.equal(true)
|
|
44
|
+
-- end)
|
|
48
45
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
-- it("should default to en-us when locale is empty", function()
|
|
47
|
+
-- local logs = Logging.capture(function()
|
|
48
|
+
-- checkValid_en_zh("")
|
|
49
|
+
-- end)
|
|
50
|
+
-- expect(string.match(logs.warnings[1], "^Warning: Locale not found:") ~= nil).to.equal(true)
|
|
51
|
+
-- end)
|
|
55
52
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
53
|
+
it("should localize correctly. (en-us)", function()
|
|
54
|
+
checkValid_en_zh("en-us")
|
|
55
|
+
end)
|
|
59
56
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
it("should localize correctly. (en-gb)", function()
|
|
58
|
+
checkValid_en_zh("en-gb")
|
|
59
|
+
end)
|
|
63
60
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
it("should localize correctly. (zh-cn)", function()
|
|
62
|
+
checkValid_en_zh("zh-cn")
|
|
63
|
+
end)
|
|
67
64
|
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
it("should localize correctly. (zh-tw)", function()
|
|
66
|
+
checkValid_en_zh("zh-tw")
|
|
67
|
+
end)
|
|
70
68
|
end)
|
|
71
|
-
end)
|
|
72
69
|
|
|
73
|
-
describe("NumberLocalizationUtils.abbreviate", function()
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
70
|
+
describe("NumberLocalizationUtils.abbreviate", function()
|
|
71
|
+
it("should round towards zero when using RoundingBehaviourTypes.Truncate", function()
|
|
72
|
+
local roundToZeroMap = {
|
|
73
|
+
[0] = "0",
|
|
74
|
+
[1] = "1",
|
|
75
|
+
[25] = "25",
|
|
76
|
+
[364] = "364",
|
|
77
|
+
[4120] = "4.1K",
|
|
78
|
+
[57860] = "57.8K",
|
|
79
|
+
[624390] = "624K",
|
|
80
|
+
[999999] = "999K",
|
|
81
|
+
[7857000] = "7.8M",
|
|
82
|
+
[8e7] = "80M",
|
|
83
|
+
[9e8] = "900M",
|
|
84
|
+
[1e9] = "1B",
|
|
85
|
+
[1e12] = "1,000B",
|
|
86
|
+
[-0] = "0",
|
|
87
|
+
[-1] = "-1",
|
|
88
|
+
[-25] = "-25",
|
|
89
|
+
[-364] = "-364",
|
|
90
|
+
[-4120] = "-4.1K",
|
|
91
|
+
[-57860] = "-57.8K",
|
|
92
|
+
[-624390] = "-624K",
|
|
93
|
+
[-999999] = "-999K",
|
|
94
|
+
[-7857000] = "-7.8M",
|
|
95
|
+
[-8e7] = "-80M",
|
|
96
|
+
[-9e8] = "-900M",
|
|
97
|
+
[-1e9] = "-1B",
|
|
98
|
+
[-1e12] = "-1,000B",
|
|
99
|
+
[1.1] = "1.1",
|
|
100
|
+
[1499.99] = "1.4K",
|
|
101
|
+
[-1.1] = "-1.1",
|
|
102
|
+
[-1499.99] = "-1.4K",
|
|
103
|
+
}
|
|
107
104
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
105
|
+
for input, output in pairs(roundToZeroMap) do
|
|
106
|
+
expect(NumberLocalizationUtils.abbreviate(input, "en-us", RoundingBehaviourTypes.TRUNCATE)).to.equal(output)
|
|
107
|
+
end
|
|
108
|
+
end)
|
|
111
109
|
end)
|
|
112
|
-
end
|
|
110
|
+
end
|