@quenty/localizedtextutils 7.4.0 → 8.0.0-canary.439.eb597ee.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 +5 -5
- package/src/Shared/LocalizedTextUtils.lua +24 -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
|
+
# [8.0.0-canary.439.eb597ee.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/localizedtextutils@7.4.0...@quenty/localizedtextutils@8.0.0-canary.439.eb597ee.0) (2024-01-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Add LocalizedTextUtils.observeLocalizedTextToString(translator) ([43810b9](https://github.com/Quenty/NevermoreEngine/commit/43810b90d33a5e9ae6bdfae6d373c0f563b0b10c))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
# [7.4.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/localizedtextutils@7.3.0...@quenty/localizedtextutils@7.4.0) (2024-01-08)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @quenty/localizedtextutils
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/localizedtextutils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0-canary.439.eb597ee.0",
|
|
4
4
|
"description": "Localized text utils which changes translationKey structures to shared locations",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"access": "public"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@quenty/attributeutils": "
|
|
32
|
-
"@quenty/loader": "
|
|
33
|
-
"@quenty/rx": "
|
|
31
|
+
"@quenty/attributeutils": "10.0.0-canary.439.eb597ee.0",
|
|
32
|
+
"@quenty/loader": "8.0.0-canary.439.eb597ee.0",
|
|
33
|
+
"@quenty/rx": "9.0.0-canary.439.eb597ee.0"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "eb597ee01e62e4dd91190bb7abd1d1404652d5ff"
|
|
36
36
|
}
|
|
@@ -135,8 +135,32 @@ function LocalizedTextUtils.observeFormatByKeyRecursive(translator, translationK
|
|
|
135
135
|
return translator:ObserveFormatByKey(translationKey, observableFormattedArgs)
|
|
136
136
|
end
|
|
137
137
|
|
|
138
|
+
--[=[
|
|
139
|
+
Observes the translations by string recursively
|
|
140
|
+
|
|
141
|
+
@param translator Translator | JSONTranslator
|
|
142
|
+
@param localizedText LocalizedTextData
|
|
143
|
+
@param extraArgs table?
|
|
144
|
+
@return Observable<string>
|
|
145
|
+
]=]
|
|
146
|
+
function LocalizedTextUtils.observeLocalizedTextToString(translator, localizedText, extraArgs)
|
|
147
|
+
assert(translator, "Bad translator")
|
|
148
|
+
assert(LocalizedTextUtils.isLocalizedText(localizedText), "No localizedText")
|
|
149
|
+
|
|
150
|
+
return LocalizedTextUtils.observeFormatByKeyRecursive(
|
|
151
|
+
translator,
|
|
152
|
+
localizedText.translationKey,
|
|
153
|
+
localizedText.translationArgs,
|
|
154
|
+
extraArgs)
|
|
155
|
+
end
|
|
156
|
+
|
|
138
157
|
--[=[
|
|
139
158
|
Recursively formats the translated text
|
|
159
|
+
|
|
160
|
+
:::tip
|
|
161
|
+
Use LocalizedTextUtils.observeLocalizedTextToString(translator, localizedText, extraArgs)
|
|
162
|
+
:::
|
|
163
|
+
|
|
140
164
|
@param translator Translator | JSONTranslator
|
|
141
165
|
@param localizedText LocalizedTextData
|
|
142
166
|
@param extraArgs table?
|