@quenty/clienttranslator 14.16.0 → 14.17.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 +11 -0
- package/package.json +3 -3
- package/src/Shared/JSONTranslator.lua +30 -0
- /package/src/{Client → Shared/Numbers}/NumberLocalizationUtils.lua +0 -0
- /package/src/{Client → Shared/Numbers}/NumberLocalizationUtils.spec.lua +0 -0
- /package/src/{Client → Shared/Numbers}/RoundingBehaviourTypes.lua +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
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.17.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/clienttranslator@14.16.0...@quenty/clienttranslator@14.17.0) (2025-01-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Public rounding behavior ([eafe408](https://github.com/Quenty/NevermoreEngine/commit/eafe408fca485f15f1957fa67c5e1fc6dbd00fc7))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [14.16.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/clienttranslator@14.15.0...@quenty/clienttranslator@14.16.0) (2024-12-15)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/clienttranslator
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/clienttranslator",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.17.0",
|
|
4
4
|
"description": "Gets local translator for player",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"Quenty"
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@quenty/blend": "^12.
|
|
28
|
+
"@quenty/blend": "^12.16.0",
|
|
29
29
|
"@quenty/instanceutils": "^13.15.0",
|
|
30
30
|
"@quenty/loader": "^10.7.1",
|
|
31
31
|
"@quenty/maid": "^3.4.0",
|
|
@@ -40,5 +40,5 @@
|
|
|
40
40
|
"publishConfig": {
|
|
41
41
|
"access": "public"
|
|
42
42
|
},
|
|
43
|
-
"gitHead": "
|
|
43
|
+
"gitHead": "a55ec046e30ddacc356f3d93fcbc6058888a88f6"
|
|
44
44
|
}
|
|
@@ -26,6 +26,7 @@ local RxInstanceUtils = require("RxInstanceUtils")
|
|
|
26
26
|
local TranslationKeyUtils = require("TranslationKeyUtils")
|
|
27
27
|
local TranslatorService = require("TranslatorService")
|
|
28
28
|
local ValueObject = require("ValueObject")
|
|
29
|
+
local NumberLocalizationUtils = require("NumberLocalizationUtils")
|
|
29
30
|
|
|
30
31
|
local JSONTranslator = {}
|
|
31
32
|
JSONTranslator.ClassName = "JSONTranslator"
|
|
@@ -109,6 +110,35 @@ function JSONTranslator:Init(serviceBag)
|
|
|
109
110
|
end))
|
|
110
111
|
end
|
|
111
112
|
|
|
113
|
+
function JSONTranslator:ObserveNumber(number)
|
|
114
|
+
return Rx.combineLatest({
|
|
115
|
+
localeId = self:ObserveLocaleId();
|
|
116
|
+
number = number;
|
|
117
|
+
}):Pipe({
|
|
118
|
+
Rx.map(function(state)
|
|
119
|
+
return NumberLocalizationUtils.localize(state.number, state.localeId)
|
|
120
|
+
end)
|
|
121
|
+
})
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
function JSONTranslator:ObserveAbbreviatedNumber(number, roundingBehaviourType, numSignificantDigits)
|
|
125
|
+
return Rx.combineLatest({
|
|
126
|
+
localeId = self:ObserveLocaleId();
|
|
127
|
+
roundingBehaviourType = roundingBehaviourType;
|
|
128
|
+
numSignificantDigits = numSignificantDigits;
|
|
129
|
+
number = number;
|
|
130
|
+
}):Pipe({
|
|
131
|
+
Rx.map(function(state)
|
|
132
|
+
return NumberLocalizationUtils.abbreviate(
|
|
133
|
+
state.number,
|
|
134
|
+
state.localeId,
|
|
135
|
+
state.roundingBehaviourType,
|
|
136
|
+
state.numSignificantDigits)
|
|
137
|
+
end)
|
|
138
|
+
})
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
|
|
112
142
|
--[=[
|
|
113
143
|
Observes the translated value
|
|
114
144
|
@param translationKey string
|
|
File without changes
|
|
File without changes
|
|
File without changes
|