pcm-shared-components 0.0.113 → 0.0.116
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/dist/components/Buttons/DropdownButton/index.js +0 -1
- package/dist/components/Buttons/TillButton/index.js +2 -1
- package/dist/index.js +4 -1
- package/dist/languages/en/translations.json +2297 -0
- package/dist/languages/es/translations.json +2297 -0
- package/dist/languages/fr/translations.json +2297 -0
- package/dist/locals/coreLocals.js +45 -0
- package/dist/locals/currencySymbol.js +23 -0
- package/dist/locals/i18n.js +46 -0
- package/dist/locals/translationResources.js +16 -0
- package/dist/styles/prism.css +5 -1
- package/package.json +1 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export const coreLocals = (language_resource = 'en') => {
|
|
2
|
+
//used to return the core international language based on the selected i18n language resource.
|
|
3
|
+
//used when the full core language locals are needed in instances such as currency and dates conversions
|
|
4
|
+
// for a full list go to https://www.w3schools.com/jsref/jsref_tolocalestring.asp
|
|
5
|
+
try {
|
|
6
|
+
switch (language_resource) {
|
|
7
|
+
case 'zh':
|
|
8
|
+
//Chinese - Simplified
|
|
9
|
+
return 'zh-CN';
|
|
10
|
+
|
|
11
|
+
case 'fr':
|
|
12
|
+
//French
|
|
13
|
+
return 'fr-FR';
|
|
14
|
+
|
|
15
|
+
case 'de':
|
|
16
|
+
//German
|
|
17
|
+
return 'de-DE';
|
|
18
|
+
|
|
19
|
+
case 'it':
|
|
20
|
+
//Italian
|
|
21
|
+
return 'it-IT';
|
|
22
|
+
|
|
23
|
+
case 'ja':
|
|
24
|
+
//Japanese
|
|
25
|
+
return 'ja-JP';
|
|
26
|
+
|
|
27
|
+
case 'ko':
|
|
28
|
+
//Korean
|
|
29
|
+
return 'ko-KR';
|
|
30
|
+
|
|
31
|
+
case 'pt':
|
|
32
|
+
//Portuguese - Brazilian
|
|
33
|
+
return 'pt-BR';
|
|
34
|
+
|
|
35
|
+
case 'es':
|
|
36
|
+
//Spanish
|
|
37
|
+
return 'es-ES';
|
|
38
|
+
|
|
39
|
+
default:
|
|
40
|
+
//English
|
|
41
|
+
return 'en-US';
|
|
42
|
+
}
|
|
43
|
+
} catch (error) {}
|
|
44
|
+
};
|
|
45
|
+
export default coreLocals;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const currencySymbol = (currency_code = 'USD') => {
|
|
2
|
+
//used to return the currency symbol based on currency code
|
|
3
|
+
try {
|
|
4
|
+
switch (currency_code) {
|
|
5
|
+
case 'EUR':
|
|
6
|
+
//Euro
|
|
7
|
+
return "€";
|
|
8
|
+
|
|
9
|
+
case 'GBP':
|
|
10
|
+
//Pound Sterling
|
|
11
|
+
return '£';
|
|
12
|
+
|
|
13
|
+
case 'JPY':
|
|
14
|
+
//Yen
|
|
15
|
+
return '¥';
|
|
16
|
+
|
|
17
|
+
default:
|
|
18
|
+
//US Dollar
|
|
19
|
+
return '$';
|
|
20
|
+
}
|
|
21
|
+
} catch (error) {}
|
|
22
|
+
};
|
|
23
|
+
export default currencySymbol;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import i18n from 'i18next';
|
|
2
|
+
import { initReactI18next } from 'react-i18next';
|
|
3
|
+
import LanguageDetector from 'i18next-browser-languagedetector';
|
|
4
|
+
import translationResources from './translationResources'; // import translationEN from '../languages/en/translations.json';
|
|
5
|
+
// import translationFR from '../languages/fr/translations.json';
|
|
6
|
+
// import translationES from '../languages/es/translations.json';
|
|
7
|
+
// // the translations
|
|
8
|
+
// const resources = {
|
|
9
|
+
// en: {
|
|
10
|
+
// translation: translationEN
|
|
11
|
+
// },
|
|
12
|
+
// fr: {
|
|
13
|
+
// translation: translationFR
|
|
14
|
+
// },
|
|
15
|
+
// es: {
|
|
16
|
+
// translation: translationES
|
|
17
|
+
// }
|
|
18
|
+
// };
|
|
19
|
+
|
|
20
|
+
i18n // detect user language
|
|
21
|
+
// learn more: https://github.com/i18next/i18next-browser-languageDetector
|
|
22
|
+
.use(LanguageDetector) // pass the i18n instance to react-i18next.
|
|
23
|
+
.use(initReactI18next) // init i18next
|
|
24
|
+
// for all options read: https://www.i18next.com/overview/configuration-options
|
|
25
|
+
.init({
|
|
26
|
+
resources: translationResources,
|
|
27
|
+
fallbackLng: 'en',
|
|
28
|
+
debug: true,
|
|
29
|
+
interpolation: {
|
|
30
|
+
escapeValue: false // not needed for react as it escapes by default
|
|
31
|
+
|
|
32
|
+
},
|
|
33
|
+
detection: {
|
|
34
|
+
order: ['querystring', 'localStorage', 'navigator'],
|
|
35
|
+
// keys or params to lookup language from
|
|
36
|
+
lookupQuerystring: 'lng',
|
|
37
|
+
lookupLocalStorage: 'i18nextLng',
|
|
38
|
+
caches: ['localStorage']
|
|
39
|
+
},
|
|
40
|
+
react: {
|
|
41
|
+
wait: true,
|
|
42
|
+
useSuspense: false
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
export { i18n };
|
|
46
|
+
export default i18n;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import translationEN from '../languages/en/translations.json';
|
|
2
|
+
import translationFR from '../languages/fr/translations.json';
|
|
3
|
+
import translationES from '../languages/es/translations.json'; // the translations
|
|
4
|
+
|
|
5
|
+
export const translationResources = {
|
|
6
|
+
en: {
|
|
7
|
+
translation: translationEN
|
|
8
|
+
},
|
|
9
|
+
fr: {
|
|
10
|
+
translation: translationFR
|
|
11
|
+
},
|
|
12
|
+
es: {
|
|
13
|
+
translation: translationES
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
export default translationResources;
|
package/dist/styles/prism.css
CHANGED
|
@@ -21,6 +21,8 @@ pre[class*="language-"] {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
|
|
24
|
+
|
|
25
|
+
|
|
24
26
|
code[class*="language-"]::-moz-selection,
|
|
25
27
|
pre[class*="language-"]::-moz-selection,
|
|
26
28
|
code[class*="language-"] ::-moz-selection,
|
|
@@ -31,7 +33,8 @@ pre[class*="language-"] ::-moz-selection {
|
|
|
31
33
|
code[class*="language-"]::selection,
|
|
32
34
|
pre[class*="language-"]::selection,
|
|
33
35
|
code[class*="language-"] ::selection,
|
|
34
|
-
pre[class*="language-"] ::selection
|
|
36
|
+
pre[class*="language-"] ::selection,
|
|
37
|
+
.css-bdtlhc {
|
|
35
38
|
background: #363636 !important;
|
|
36
39
|
}
|
|
37
40
|
|
|
@@ -46,6 +49,7 @@ pre[class*="language-"] {
|
|
|
46
49
|
position: relative !important;
|
|
47
50
|
padding: 10px !important;
|
|
48
51
|
border-radius: 16px !important;
|
|
52
|
+
margin-bottom: 3px !important;
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
.language-css > code,
|