@ooneex/translation 0.0.18 → 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.
Files changed (2) hide show
  1. package/README.md +4 -32
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,11 +1,9 @@
1
1
  # @ooneex/translation
2
2
 
3
- A comprehensive TypeScript/JavaScript library for internationalization (i18n) and localization (l10n). This package provides powerful translation utilities with support for multiple languages, parameter interpolation, pluralization, and nested key structures.
3
+ Internationalization framework with locale management, translation key resolution, and pluralization support for multi-language applications.
4
4
 
5
5
  ![Browser](https://img.shields.io/badge/Browser-Compatible-green?style=flat-square&logo=googlechrome)
6
6
  ![Bun](https://img.shields.io/badge/Bun-Compatible-orange?style=flat-square&logo=bun)
7
- ![Deno](https://img.shields.io/badge/Deno-Compatible-blue?style=flat-square&logo=deno)
8
- ![Node.js](https://img.shields.io/badge/Node.js-Compatible-green?style=flat-square&logo=node.js)
9
7
  ![TypeScript](https://img.shields.io/badge/TypeScript-Ready-blue?style=flat-square&logo=typescript)
10
8
  ![MIT License](https://img.shields.io/badge/License-MIT-yellow?style=flat-square)
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** - Full TypeScript support with proper type definitions
14
+ ✅ **Type-Safe Locales** - `LocaleType` union type and `LocaleInfoType` with region data
17
15
 
18
- ✅ **Parameter Interpolation** - Replace placeholders with dynamic values
16
+ ✅ **Locale Constants** - Readonly `locales` array of all supported locale codes
19
17
 
20
- ✅ **Pluralization Support** - Handle singular, plural, and zero forms automatically
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 (i18n) and localization utilities for multi-language support in Ooneex applications",
4
- "version": "0.0.18",
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.17",
33
- "@ooneex/http-status": "0.0.17"
32
+ "@ooneex/exception": "0.0.18",
33
+ "@ooneex/http-status": "0.0.18"
34
34
  },
35
35
  "devDependencies": {},
36
36
  "keywords": [