@rimori/client 1.4.9 → 1.4.10

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.
@@ -41,10 +41,11 @@ export class Translator {
41
41
  }
42
42
  getTranslationUrl(language) {
43
43
  // For localhost development, use local- prefix for non-English languages
44
- const isLocalhost = window.location.hostname === 'localhost';
45
- const isEnglish = language === 'en';
46
- const filename = isLocalhost && !isEnglish ? `local-${language}` : language;
47
- return `${window.location.origin}/locales/${filename}.json`;
44
+ if (window.location.hostname === 'localhost') {
45
+ const filename = language !== 'en' ? `local-${language}` : language;
46
+ return `${window.location.origin}/locales/${filename}.json`;
47
+ }
48
+ return `./locales/${language}.json`;
48
49
  }
49
50
  usePlugin(plugin) {
50
51
  if (!this.i18n) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rimori/client",
3
- "version": "1.4.9",
3
+ "version": "1.4.10",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "bin": {
@@ -39,11 +39,13 @@ export class Translator {
39
39
 
40
40
  private getTranslationUrl(language: string): string {
41
41
  // For localhost development, use local- prefix for non-English languages
42
- const isLocalhost = window.location.hostname === 'localhost';
43
- const isEnglish = language === 'en';
44
- const filename = isLocalhost && !isEnglish ? `local-${language}` : language;
42
+ if (window.location.hostname === 'localhost') {
43
+ const filename = language !== 'en' ? `local-${language}` : language;
45
44
 
46
- return `${window.location.origin}/locales/${filename}.json`;
45
+ return `${window.location.origin}/locales/${filename}.json`;
46
+ }
47
+
48
+ return `./locales/${language}.json`;
47
49
  }
48
50
 
49
51
  public usePlugin(plugin: ThirdPartyModule): void {