@enso-ui/ui 7.1.9 → 7.1.11

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enso-ui/ui",
3
- "version": "7.1.9",
3
+ "version": "7.1.11",
4
4
  "description": "Laravel Enso UI",
5
5
  "main": "bulma/index.js",
6
6
  "scripts": {
package/src/core/Root.vue CHANGED
@@ -3,7 +3,7 @@ import { isNavigationFailure } from 'vue-router';
3
3
  import RouteMapper from '@enso-ui/route-mapper';
4
4
  import toastr from '@enso-ui/toastr';
5
5
  import http from 'axios';
6
- import i18n from '../modules/plugins/i18n';
6
+ import i18n from '@enso-ui/localisation/i18n';
7
7
  import ErrorHandler from './services/errorHandler';
8
8
  import { useStore } from './services/pinia';
9
9
  import { app } from '../pinia/app';
@@ -1,41 +0,0 @@
1
- import { useStore } from '../../core/services/pinia';
2
-
3
- export default (key, params = null) => {
4
- if (key === null || key === '' || typeof key === 'undefined') {
5
- return null;
6
- }
7
-
8
- const localisation = useStore('localisation');
9
-
10
- if (!localisation?.ready) {
11
- return key;
12
- }
13
-
14
- let translation = localisation.translate(key);
15
-
16
- if (typeof translation === 'undefined' || translation === null) {
17
- translation = key;
18
-
19
- if (localisation.keyCollector) {
20
- localisation.addMissingKey(key);
21
- }
22
- }
23
-
24
- return !!params && typeof params === 'object'
25
- ? translation.replace(/:(\w*)/g, (e, key) => {
26
- if (typeof params[key.toLowerCase()] === 'undefined') {
27
- return key;
28
- }
29
-
30
- const param = params[key.toLowerCase()];
31
-
32
- if (key === key.toUpperCase()) {
33
- return param.toUpperCase();
34
- }
35
-
36
- return key[0] === key[0].toUpperCase()
37
- ? param.charAt(0).toUpperCase() + param.slice(1)
38
- : param;
39
- })
40
- : translation || key;
41
- };