Repository: playcanvas/engine
Pull request #4717 (2022-10-10 12:42:25)

Move /i18n to /framework/i18n
- in order to reorganize the engine folder structure to layered approach
- no other changes other than move + automated import paths fixed up


Patch:
diff --git a/src/asset/asset.js b/src/asset/asset.js
index 1a256770b..b5c168be2 100644
--- a/src/asset/asset.js
+++ b/src/asset/asset.js
@@ -3,7 +3,7 @@ import { Tags } from '../core/tags.js';
 
 import { EventHandler } from '../core/event-handler.js';
 
-import { findAvailableLocale } from '../i18n/utils.js';
+import { findAvailableLocale } from '../framework/i18n/utils.js';
 
 import { ABSOLUTE_URL } from './constants.js';
 import { AssetFile } from './asset-file.js';
diff --git a/src/framework/app-base.js b/src/framework/app-base.js
index 9ca1e5f63..746d8bf47 100644
--- a/src/framework/app-base.js
+++ b/src/framework/app-base.js
@@ -48,7 +48,7 @@ import { BundleRegistry } from '../bundles/bundle-registry.js';
 
 import { ScriptRegistry } from './script/script-registry.js';
 
-import { I18n } from '../i18n/i18n.js';
+import { I18n } from '../framework/i18n/i18n.js';
 
 import { ComponentSystemRegistry } from './components/registry.js';
 import { script } from './script.js';
diff --git a/src/i18n/constants.js b/src/framework/i18n/constants.js
similarity index 100%
rename from src/i18n/constants.js
rename to src/framework/i18n/constants.js
diff --git a/src/i18n/i18n-parser.js b/src/framework/i18n/i18n-parser.js
similarity index 100%
rename from src/i18n/i18n-parser.js
rename to src/framework/i18n/i18n-parser.js
diff --git a/src/i18n/i18n.js b/src/framework/i18n/i18n.js
similarity index 98%
rename from src/i18n/i18n.js
rename to src/framework/i18n/i18n.js
index 10c7c0f57..c7b22e9c2 100644
--- a/src/i18n/i18n.js
+++ b/src/framework/i18n/i18n.js
@@ -1,10 +1,10 @@
-import { EventHandler } from '../core/event-handler.js';
+import { EventHandler } from '../../core/event-handler.js';
 
-import { Asset } from '../asset/asset.js';
+import { Asset } from '../../asset/asset.js';
 
 import { I18nParser } from './i18n-parser.js';
 
-/** @typedef {import('../framework/app-base.js').AppBase} AppBase */
+/** @typedef {import('../../framework/app-base.js').AppBase} AppBase */
 
 import {
     DEFAULT_LOCALE,
diff --git a/src/i18n/utils.js b/src/framework/i18n/utils.js
similarity index 100%
rename from src/i18n/utils.js
rename to src/framework/i18n/utils.js
diff --git a/src/index.js b/src/index.js
index ca950af3b..f3dc07815 100644
--- a/src/index.js
+++ b/src/index.js
@@ -199,7 +199,7 @@ export { ScriptRegistry } from './framework/script/script-registry.js';
 export { ScriptType } from './framework/script/script-type.js';
 
 // LOCALIZATION
-export { I18n } from './i18n/i18n.js';
+export { I18n } from './framework/i18n/i18n.js';
 
 // INPUT
 export * from './platform/input/constants.js';


Test patch:
diff --git a/test/framework/application.test.mjs b/test/framework/application.test.mjs
index df40edcac..faf61c784 100644
--- a/test/framework/application.test.mjs
+++ b/test/framework/application.test.mjs
@@ -5,7 +5,7 @@ import { BatchManager } from '../../src/scene/batching/batch-manager.js';
 import { ComponentSystemRegistry } from '../../src/framework/components/registry.js';
 import { Entity } from '../../src/framework/entity.js';
 import { GraphicsDevice } from '../../src/platform/graphics/graphics-device.js';
-import { I18n } from '../../src/i18n/i18n.js';
+import { I18n } from '../../src/framework/i18n/i18n.js';
 import { Lightmapper } from '../../src/scene/lightmapper/lightmapper.js';
 import { ResourceLoader } from '../../src/resources/loader.js';
 import { Scene } from '../../src/scene/scene.js';