@kaspernj/api-maker 1.0.285 → 1.0.286

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/package.json CHANGED
@@ -16,7 +16,7 @@
16
16
  ]
17
17
  },
18
18
  "name": "@kaspernj/api-maker",
19
- "version": "1.0.285",
19
+ "version": "1.0.286",
20
20
  "type": "module",
21
21
  "description": "",
22
22
  "main": "index.js",
@@ -74,7 +74,7 @@
74
74
  "eslint-find-rules": "^4.0.0",
75
75
  "eslint-plugin-jest": "^27.0.1",
76
76
  "eslint-plugin-react": "^7.23.2",
77
- "i18n-on-steroids": "^1.0.5",
77
+ "i18n-on-steroids": "^1.0.7",
78
78
  "jest": "^29.0.1",
79
79
  "jsdom": "^22.0.0"
80
80
  }
@@ -33,8 +33,10 @@ export default class ApiMakerRoutesNative {
33
33
 
34
34
  if (variableMatch) {
35
35
  localizedPathParts.push({type: "variable", count: variableCount++})
36
- } else {
37
- localizedPathParts.push({type: "pathPart", name: dig(this.routeTranslationParts, locale, pathPart) || pathPart})
36
+ } else if (pathPart) {
37
+ const name = this.i18n.t(`routes.${pathPart}`, null, {default: pathPart, locale})
38
+
39
+ localizedPathParts.push({type: "pathPart", name})
38
40
  }
39
41
  }
40
42
 
@@ -63,6 +65,7 @@ export default class ApiMakerRoutesNative {
63
65
  }
64
66
 
65
67
  loadRouteTranslations (i18n) {
68
+ this.i18n = i18n
66
69
  const locales = digg(i18n, "locales")
67
70
 
68
71
  for (const locale in locales) {