@ooneex/translation 0.0.17 → 1.0.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.
- package/README.md +4 -32
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
# @ooneex/translation
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Internationalization framework with locale management, translation key resolution, and pluralization support for multi-language applications.
|
|
4
4
|
|
|
5
5
|

|
|
6
6
|

|
|
7
|
-

|
|
8
|
-

|
|
9
7
|

|
|
10
8
|

|
|
11
9
|
|
|
@@ -13,46 +11,20 @@ A comprehensive TypeScript/JavaScript library for internationalization (i18n) an
|
|
|
13
11
|
|
|
14
12
|
✅ **Multi-Language Support** - 31 supported locales including Arabic, Chinese, French, Spanish, and more
|
|
15
13
|
|
|
16
|
-
✅ **Type-Safe** -
|
|
14
|
+
✅ **Type-Safe Locales** - `LocaleType` union type and `LocaleInfoType` with region data
|
|
17
15
|
|
|
18
|
-
✅ **
|
|
16
|
+
✅ **Locale Constants** - Readonly `locales` array of all supported locale codes
|
|
19
17
|
|
|
20
|
-
✅ **
|
|
21
|
-
|
|
22
|
-
✅ **Nested Keys** - Support for dot notation in translation keys
|
|
23
|
-
|
|
24
|
-
✅ **Flexible Input** - Accept both dictionary keys and direct translation objects
|
|
25
|
-
|
|
26
|
-
✅ **Fallback System** - Graceful fallbacks to English or base keys
|
|
27
|
-
|
|
28
|
-
✅ **Error Handling** - Custom exceptions for missing translations
|
|
29
|
-
|
|
30
|
-
✅ **Lightweight** - Minimal dependencies and optimized bundle size
|
|
18
|
+
✅ **Error Handling** - Custom `TranslationException` for missing or invalid translations
|
|
31
19
|
|
|
32
20
|
✅ **Cross-Platform** - Works in Browser, Node.js, Bun, and Deno
|
|
33
21
|
|
|
34
22
|
## Installation
|
|
35
23
|
|
|
36
|
-
### Bun
|
|
37
24
|
```bash
|
|
38
25
|
bun add @ooneex/translation
|
|
39
26
|
```
|
|
40
27
|
|
|
41
|
-
### pnpm
|
|
42
|
-
```bash
|
|
43
|
-
pnpm add @ooneex/translation
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### Yarn
|
|
47
|
-
```bash
|
|
48
|
-
yarn add @ooneex/translation
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### npm
|
|
52
|
-
```bash
|
|
53
|
-
npm install @ooneex/translation
|
|
54
|
-
```
|
|
55
|
-
|
|
56
28
|
## Usage
|
|
57
29
|
|
|
58
30
|
### Basic Usage
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ooneex/translation",
|
|
3
|
-
"description": "Internationalization
|
|
4
|
-
"version": "0.0
|
|
3
|
+
"description": "Internationalization framework with locale management, translation key resolution, and pluralization support for multi-language applications",
|
|
4
|
+
"version": "1.0.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"wuchale": "bunx wuchale"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@ooneex/exception": "0.0.
|
|
33
|
-
"@ooneex/http-status": "0.0.
|
|
32
|
+
"@ooneex/exception": "0.0.18",
|
|
33
|
+
"@ooneex/http-status": "0.0.18"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {},
|
|
36
36
|
"keywords": [
|