@quenty/clienttranslator 14.20.0-canary.ae8d76d.0 → 14.20.0
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 +2 -2
- package/package.json +13 -13
- package/src/Shared/Conversion/LocalizationEntryParserUtils.lua +23 -9
- package/src/Shared/JSONTranslator.lua +5 -5
- package/src/Shared/Numbers/NumberLocalizationUtils.lua +11 -2
- package/src/Shared/Numbers/NumberLocalizationUtils.spec.lua +2 -1
- package/src/Shared/TranslatorService.lua +2 -2
- package/src/Shared/Utils/LocalizationServiceUtils.lua +1 -1
- package/src/Shared/Utils/TranslationKeyUtils.lua +1 -1
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.20.0
|
|
6
|
+
# [14.20.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/clienttranslator@14.19.3...@quenty/clienttranslator@14.20.0) (2025-05-10)
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
### Bug Fixes
|
|
@@ -13,7 +13,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
13
13
|
|
|
14
14
|
### Features
|
|
15
15
|
|
|
16
|
-
* Add even more types ([
|
|
16
|
+
* Add even more types ([b31717d](https://github.com/Quenty/NevermoreEngine/commit/b31717d8c9f7620c457f5018a2affa760a65334a))
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/clienttranslator",
|
|
3
|
-
"version": "14.20.0
|
|
3
|
+
"version": "14.20.0",
|
|
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.19.0
|
|
29
|
-
"@quenty/instanceutils": "13.18.0
|
|
30
|
-
"@quenty/loader": "10.
|
|
31
|
-
"@quenty/maid": "3.
|
|
32
|
-
"@quenty/promise": "10.11.0
|
|
33
|
-
"@quenty/promisemaid": "5.11.0
|
|
34
|
-
"@quenty/pseudolocalize": "3.
|
|
35
|
-
"@quenty/rx": "13.18.0
|
|
36
|
-
"@quenty/string": "3.3.3",
|
|
37
|
-
"@quenty/table": "3.
|
|
38
|
-
"@quenty/valueobject": "13.18.0
|
|
28
|
+
"@quenty/blend": "^12.19.0",
|
|
29
|
+
"@quenty/instanceutils": "^13.18.0",
|
|
30
|
+
"@quenty/loader": "^10.9.0",
|
|
31
|
+
"@quenty/maid": "^3.5.0",
|
|
32
|
+
"@quenty/promise": "^10.11.0",
|
|
33
|
+
"@quenty/promisemaid": "^5.11.0",
|
|
34
|
+
"@quenty/pseudolocalize": "^3.5.0",
|
|
35
|
+
"@quenty/rx": "^13.18.0",
|
|
36
|
+
"@quenty/string": "^3.3.3",
|
|
37
|
+
"@quenty/table": "^3.8.0",
|
|
38
|
+
"@quenty/valueobject": "^13.18.0"
|
|
39
39
|
},
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "20cff952c2cf06b959f2f11d2293bdef38acc604"
|
|
44
44
|
}
|
|
@@ -88,7 +88,14 @@ function LocalizationEntryParserUtils._parseLocaleFromName(name: string)
|
|
|
88
88
|
end
|
|
89
89
|
end
|
|
90
90
|
|
|
91
|
-
function LocalizationEntryParserUtils._parseTableToResultsList(
|
|
91
|
+
function LocalizationEntryParserUtils._parseTableToResultsList(
|
|
92
|
+
lookupTable,
|
|
93
|
+
sourceLocaleId: string,
|
|
94
|
+
localeId: string,
|
|
95
|
+
baseKey: string,
|
|
96
|
+
dataTable,
|
|
97
|
+
tableName: string
|
|
98
|
+
)
|
|
92
99
|
assert(type(lookupTable) == "table", "Bad lookupTable")
|
|
93
100
|
assert(type(sourceLocaleId) == "string", "Bad sourceLocaleId")
|
|
94
101
|
assert(type(localeId) == "string", "Bad localeId")
|
|
@@ -99,20 +106,27 @@ function LocalizationEntryParserUtils._parseTableToResultsList(lookupTable, sour
|
|
|
99
106
|
for index, text in dataTable do
|
|
100
107
|
local key = baseKey .. index
|
|
101
108
|
if type(text) == "table" then
|
|
102
|
-
LocalizationEntryParserUtils._parseTableToResultsList(
|
|
109
|
+
LocalizationEntryParserUtils._parseTableToResultsList(
|
|
110
|
+
lookupTable,
|
|
111
|
+
sourceLocaleId,
|
|
112
|
+
localeId,
|
|
113
|
+
key .. ".",
|
|
114
|
+
text,
|
|
115
|
+
tableName
|
|
116
|
+
)
|
|
103
117
|
elseif type(text) == "string" then
|
|
104
118
|
local found = lookupTable[key]
|
|
105
119
|
if found then
|
|
106
120
|
found.Values[localeId] = text
|
|
107
121
|
else
|
|
108
122
|
found = {
|
|
109
|
-
Example = text
|
|
110
|
-
Key = key
|
|
111
|
-
Context = string.format("[TEMP] - Generated from %s with key %s", tableName, key)
|
|
112
|
-
Source = text
|
|
123
|
+
Example = text,
|
|
124
|
+
Key = key,
|
|
125
|
+
Context = string.format("[TEMP] - Generated from %s with key %s", tableName, key),
|
|
126
|
+
Source = text, -- Tempt!
|
|
113
127
|
Values = {
|
|
114
|
-
[localeId] = text
|
|
115
|
-
}
|
|
128
|
+
[localeId] = text,
|
|
129
|
+
},
|
|
116
130
|
}
|
|
117
131
|
|
|
118
132
|
lookupTable[key] = found
|
|
@@ -135,4 +149,4 @@ function LocalizationEntryParserUtils._parseTableToResultsList(lookupTable, sour
|
|
|
135
149
|
end
|
|
136
150
|
end
|
|
137
151
|
|
|
138
|
-
return LocalizationEntryParserUtils
|
|
152
|
+
return LocalizationEntryParserUtils
|
|
@@ -21,16 +21,16 @@ local RunService = game:GetService("RunService")
|
|
|
21
21
|
local Blend = require("Blend")
|
|
22
22
|
local LocalizationEntryParserUtils = require("LocalizationEntryParserUtils")
|
|
23
23
|
local Maid = require("Maid")
|
|
24
|
+
local NumberLocalizationUtils = require("NumberLocalizationUtils")
|
|
25
|
+
local Observable = require("Observable")
|
|
26
|
+
local Promise = require("Promise")
|
|
24
27
|
local PseudoLocalize = require("PseudoLocalize")
|
|
25
28
|
local Rx = require("Rx")
|
|
26
29
|
local RxInstanceUtils = require("RxInstanceUtils")
|
|
30
|
+
local ServiceBag = require("ServiceBag")
|
|
27
31
|
local TranslationKeyUtils = require("TranslationKeyUtils")
|
|
28
32
|
local TranslatorService = require("TranslatorService")
|
|
29
33
|
local ValueObject = require("ValueObject")
|
|
30
|
-
local NumberLocalizationUtils = require("NumberLocalizationUtils")
|
|
31
|
-
local ServiceBag = require("ServiceBag")
|
|
32
|
-
local Observable = require("Observable")
|
|
33
|
-
local Promise = require("Promise")
|
|
34
34
|
|
|
35
35
|
local JSONTranslator = {}
|
|
36
36
|
JSONTranslator.ClassName = "JSONTranslator"
|
|
@@ -475,4 +475,4 @@ function JSONTranslator.Destroy(self: JSONTranslator)
|
|
|
475
475
|
setmetatable(self :: any, nil)
|
|
476
476
|
end
|
|
477
477
|
|
|
478
|
-
return JSONTranslator
|
|
478
|
+
return JSONTranslator
|
|
@@ -227,7 +227,11 @@ local function addGroupDelimiters(numberStr, delimiter: string): string
|
|
|
227
227
|
return formatted
|
|
228
228
|
end
|
|
229
229
|
|
|
230
|
-
local function findDenominationEntry(
|
|
230
|
+
local function findDenominationEntry(
|
|
231
|
+
localeInfo,
|
|
232
|
+
number: number,
|
|
233
|
+
roundingBehaviourType: RoundingBehaviourTypes.RoundingBehaviourType
|
|
234
|
+
)
|
|
231
235
|
local denominationEntry = localeInfo[1] -- Default to base denominations
|
|
232
236
|
local absOfNumber = math.abs(number)
|
|
233
237
|
for i = #localeInfo, 2, -1 do
|
|
@@ -283,7 +287,12 @@ end
|
|
|
283
287
|
@param numSignificantDigits number?
|
|
284
288
|
@return string
|
|
285
289
|
]=]
|
|
286
|
-
function NumberLocalizationUtils.abbreviate(
|
|
290
|
+
function NumberLocalizationUtils.abbreviate(
|
|
291
|
+
number: number,
|
|
292
|
+
locale: string,
|
|
293
|
+
roundingBehaviourType: RoundingBehaviourTypes.RoundingBehaviourType?,
|
|
294
|
+
numSignificantDigits: number?
|
|
295
|
+
): string
|
|
287
296
|
assert(type(number) == "number", "Bad number")
|
|
288
297
|
local roundingBehavior = roundingBehaviourType or RoundingBehaviourTypes.ROUND_TO_CLOSEST
|
|
289
298
|
local significantDigits = numSignificantDigits or 3
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
local require =
|
|
1
|
+
local require =
|
|
2
|
+
require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).bootstrapStory(script)
|
|
2
3
|
|
|
3
4
|
local Jest = require("Jest")
|
|
4
5
|
local NumberLocalizationUtils = require("NumberLocalizationUtils")
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
local require = require(script.Parent.loader).load(script)
|
|
9
9
|
|
|
10
|
+
local LocalizationService = game:GetService("LocalizationService")
|
|
10
11
|
local Players = game:GetService("Players")
|
|
11
12
|
local RunService = game:GetService("RunService")
|
|
12
|
-
local LocalizationService = game:GetService("LocalizationService")
|
|
13
13
|
|
|
14
14
|
local LocalizationServiceUtils = require("LocalizationServiceUtils")
|
|
15
15
|
local Maid = require("Maid")
|
|
@@ -235,4 +235,4 @@ function TranslatorService.Destroy(self: TranslatorService)
|
|
|
235
235
|
self._maid:DoCleaning()
|
|
236
236
|
end
|
|
237
237
|
|
|
238
|
-
return TranslatorService
|
|
238
|
+
return TranslatorService
|