@cellarnode/i18n 0.2.0 → 0.3.0
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.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { describe, it, expect } from 'vitest';
|
|
2
2
|
import { SUPPORTED_LANGUAGES, DEFAULT_LANGUAGE, LANGUAGE_DISPLAY_NAMES, } from '../constants';
|
|
3
3
|
describe('SUPPORTED_LANGUAGES', () => {
|
|
4
|
-
it('contains exactly
|
|
5
|
-
expect(SUPPORTED_LANGUAGES).toHaveLength(
|
|
4
|
+
it('contains exactly 8 languages', () => {
|
|
5
|
+
expect(SUPPORTED_LANGUAGES).toHaveLength(8);
|
|
6
6
|
});
|
|
7
7
|
it('contains all required language codes', () => {
|
|
8
|
-
expect(SUPPORTED_LANGUAGES).toEqual(expect.arrayContaining(['en', 'zh', 'fr', 'de', 'it', 'es', 'sv']));
|
|
8
|
+
expect(SUPPORTED_LANGUAGES).toEqual(expect.arrayContaining(['en', 'zh', 'fr', 'de', 'it', 'es', 'sv', 'ru']));
|
|
9
9
|
});
|
|
10
10
|
it('has en as the first element', () => {
|
|
11
11
|
expect(SUPPORTED_LANGUAGES[0]).toBe('en');
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const SUPPORTED_LANGUAGES: readonly ["en", "zh", "fr", "de", "it", "es", "sv"];
|
|
1
|
+
export declare const SUPPORTED_LANGUAGES: readonly ["en", "zh", "fr", "de", "it", "es", "sv", "ru"];
|
|
2
2
|
export declare const DEFAULT_LANGUAGE: "en";
|
|
3
3
|
export type SupportedLanguage = (typeof SUPPORTED_LANGUAGES)[number];
|
|
4
4
|
export declare const LANGUAGE_DISPLAY_NAMES: Record<SupportedLanguage, string>;
|
package/dist/constants.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export const SUPPORTED_LANGUAGES = [
|
|
2
|
-
'en', 'zh', 'fr', 'de', 'it', 'es', 'sv',
|
|
2
|
+
'en', 'zh', 'fr', 'de', 'it', 'es', 'sv', 'ru',
|
|
3
3
|
];
|
|
4
4
|
export const DEFAULT_LANGUAGE = 'en';
|
|
5
5
|
export const LANGUAGE_DISPLAY_NAMES = {
|
|
@@ -10,4 +10,5 @@ export const LANGUAGE_DISPLAY_NAMES = {
|
|
|
10
10
|
it: 'Italiano',
|
|
11
11
|
es: 'Español',
|
|
12
12
|
sv: 'Svenska',
|
|
13
|
+
ru: 'Русский',
|
|
13
14
|
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"save": "Save",
|
|
3
|
+
"cancel": "Cancel",
|
|
4
|
+
"delete": "Delete",
|
|
5
|
+
"edit": "Edit",
|
|
6
|
+
"create": "Create",
|
|
7
|
+
"confirm": "Confirm",
|
|
8
|
+
"close": "Close",
|
|
9
|
+
"back": "Back",
|
|
10
|
+
"next": "Next",
|
|
11
|
+
"submit": "Submit",
|
|
12
|
+
"loading": "Loading...",
|
|
13
|
+
"error": "Error",
|
|
14
|
+
"success": "Success",
|
|
15
|
+
"warning": "Warning",
|
|
16
|
+
"search": "Search",
|
|
17
|
+
"filter": "Filter",
|
|
18
|
+
"sort": "Sort",
|
|
19
|
+
"refresh": "Refresh",
|
|
20
|
+
"retry": "Retry",
|
|
21
|
+
"yes": "Yes",
|
|
22
|
+
"no": "No",
|
|
23
|
+
"ok": "OK",
|
|
24
|
+
"noResults": "No results found",
|
|
25
|
+
"required": "This field is required",
|
|
26
|
+
"invalidEmail": "Please enter a valid email",
|
|
27
|
+
"somethingWentWrong": "Something went wrong",
|
|
28
|
+
"tryAgain": "Please try again",
|
|
29
|
+
"unsavedChanges": "You have unsaved changes",
|
|
30
|
+
"areYouSure": "Are you sure?",
|
|
31
|
+
"copiedToClipboard": "Copied to clipboard",
|
|
32
|
+
"actions": "Actions",
|
|
33
|
+
"status": "Status",
|
|
34
|
+
"name": "Name",
|
|
35
|
+
"description": "Description",
|
|
36
|
+
"date": "Date",
|
|
37
|
+
"type": "Type",
|
|
38
|
+
"viewAll": "View all",
|
|
39
|
+
"showMore": "Show more",
|
|
40
|
+
"showLess": "Show less",
|
|
41
|
+
"selectAll": "Select all",
|
|
42
|
+
"deselectAll": "Deselect all",
|
|
43
|
+
"pagination": {
|
|
44
|
+
"previous": "Previous",
|
|
45
|
+
"next": "Next",
|
|
46
|
+
"page": "Page {{current}} of {{total}}",
|
|
47
|
+
"showing": "Showing {{from}}-{{to}} of {{total}}"
|
|
48
|
+
},
|
|
49
|
+
"validation": {
|
|
50
|
+
"required": "This field is required",
|
|
51
|
+
"minLength": "Must be at least {{min}} characters",
|
|
52
|
+
"maxLength": "Must be at most {{max}} characters",
|
|
53
|
+
"positiveNumber": "Must be a positive number",
|
|
54
|
+
"invalidFormat": "Invalid format"
|
|
55
|
+
}
|
|
56
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cellarnode/i18n",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Shared i18n configuration for CellarNode frontends — language constants, i18next factory, browser locale detection, and common translations.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|