@quenty/clienttranslator 6.2.1 → 6.3.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 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
+ # [6.3.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/clienttranslator@6.2.1...@quenty/clienttranslator@6.3.0) (2022-07-31)
7
+
8
+
9
+ ### Features
10
+
11
+ * Add ObserveLocaleId() to JSONTranslator ([b805a9e](https://github.com/Quenty/NevermoreEngine/commit/b805a9e2170623d17cc2a832ea78d867d829e094))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [6.2.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/clienttranslator@6.2.0...@quenty/clienttranslator@6.2.1) (2022-07-19)
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": "6.2.1",
3
+ "version": "6.3.0",
4
4
  "description": "Gets local translator for player",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -25,15 +25,16 @@
25
25
  "Quenty"
26
26
  ],
27
27
  "dependencies": {
28
- "@quenty/blend": "^4.2.1",
28
+ "@quenty/blend": "^4.3.0",
29
+ "@quenty/instanceutils": "^5.2.0",
29
30
  "@quenty/loader": "^5.0.0",
30
- "@quenty/maid": "^2.3.0",
31
- "@quenty/promise": "^5.0.0",
31
+ "@quenty/maid": "^2.4.0",
32
+ "@quenty/promise": "^5.1.0",
32
33
  "@quenty/pseudolocalize": "^2.1.0",
33
- "@quenty/rx": "^5.1.0"
34
+ "@quenty/rx": "^5.2.0"
34
35
  },
35
36
  "publishConfig": {
36
37
  "access": "public"
37
38
  },
38
- "gitHead": "67bd6a4f1957c3727c208d23c564c5757de6d7c8"
39
+ "gitHead": "e31b3a35aa475bb5699a24898a8639e107165b36"
39
40
  }
@@ -16,6 +16,7 @@ local Observable = require("Observable")
16
16
  local Maid = require("Maid")
17
17
  local Blend = require("Blend")
18
18
  local Rx = require("Rx")
19
+ local RxInstanceUtils = require("RxInstanceUtils")
19
20
 
20
21
  local JSONTranslator = {}
21
22
  JSONTranslator.ClassName = "JSONTranslator"
@@ -63,6 +64,24 @@ function JSONTranslator.new(...)
63
64
  return self
64
65
  end
65
66
 
67
+ --[=[
68
+ Observes the current locale id for this translator.
69
+
70
+ @return Observable<string>
71
+ ]=]
72
+ function JSONTranslator:ObserveLocaleId()
73
+ return Rx.fromPromise(self._promiseTranslator):Pipe({
74
+ Rx.switchMap(function(translator)
75
+ return RxInstanceUtils.observeProperty(translator, "LocaleId")
76
+ end)
77
+ })
78
+ end
79
+
80
+ --[=[
81
+ Gets the localization table the translation is using.
82
+
83
+ @return LocalizaitonTable
84
+ ]=]
66
85
  function JSONTranslator:GetLocalizationTable()
67
86
  return self._localizationTable
68
87
  end