esoftplay 0.0.109-e → 0.0.109-g

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.
Files changed (2) hide show
  1. package/esp.ts +7 -3
  2. package/package.json +1 -1
package/esp.ts CHANGED
@@ -11,6 +11,7 @@ LogBox.ignoreLogs(['VirtualizedLists should never be nested inside plain ScrollV
11
11
  let app = require('../../app.json');
12
12
  let conf = require('../../config.json');
13
13
  let lconf = require('../../config.live.json');
14
+ let langFile
14
15
 
15
16
  export default (() => {
16
17
  function mergeDeep(target: any, source: any): any {
@@ -77,7 +78,7 @@ export default (() => {
77
78
  if (_params.length > 0)
78
79
  for (let i = 0; i < _params.length; i++) {
79
80
  out = out?.[_params[i]];
80
- if (out == undefined){
81
+ if (out == undefined) {
81
82
  break;
82
83
  }
83
84
  }
@@ -87,9 +88,12 @@ export default (() => {
87
88
  }
88
89
 
89
90
  function lang(moduleTask: string, langName: string, ...stringToBe: string[]): string {
90
- let string = readDeepObj(esp.assets("locale/" + langId() + ".json"))(moduleTask, langName)
91
+ if (!langFile) {
92
+ langFile = esp.assets("locale/" + langId() + ".json")
93
+ }
94
+ let string = langFile[moduleTask][langName]
91
95
  if (!string) {
92
- string = readDeepObj(esp.assets("locale/id.json"))(moduleTask, langName)
96
+ string = esp.assets("locale/id.json")[moduleTask][langName]
93
97
  }
94
98
  function sprintf(string: string, index: number) {
95
99
  if (stringToBe[index] != undefined) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "esoftplay",
3
- "version": "0.0.109-e",
3
+ "version": "0.0.109-g",
4
4
  "description": "embedding data from esoftplay framework (web based) into mobile app",
5
5
  "main": "cache/index.js",
6
6
  "types": "../../index.d.ts",