@ooneex/translation 1.1.2 → 1.1.4

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/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  declare const locales: readonly ["ar", "bg", "cs", "da", "de", "el", "en", "eo", "es", "et", "eu", "fi", "fr", "hu", "hy", "it", "ja", "ko", "lt", "nl", "no", "pl", "pt", "ro", "ru", "sk", "sv", "th", "uk", "zh", "zh-tw"];
2
2
  import { Exception } from "@ooneex/exception";
3
3
  declare class TranslationException extends Exception {
4
- constructor(message: string, data?: Record<string, unknown>);
4
+ constructor(message: string, key: string, data?: Record<string, unknown>);
5
5
  }
6
6
  type LocaleType = (typeof locales)[number];
7
7
  type LocaleInfoType = {
package/dist/index.js CHANGED
@@ -1,3 +1,54 @@
1
- var r=["ar","bg","cs","da","de","el","en","eo","es","et","eu","fi","fr","hu","hy","it","ja","ko","lt","nl","no","pl","pt","ro","ru","sk","sv","th","uk","zh","zh-tw"];import{Exception as n}from"@ooneex/exception";import{HttpStatus as s}from"@ooneex/http-status";class o extends n{constructor(t,e={}){super(t,{status:s.Code.NotFound,data:e});this.name="TranslationException"}}export{r as locales,o as TranslationException};
1
+ // src/locales.ts
2
+ var locales = [
3
+ "ar",
4
+ "bg",
5
+ "cs",
6
+ "da",
7
+ "de",
8
+ "el",
9
+ "en",
10
+ "eo",
11
+ "es",
12
+ "et",
13
+ "eu",
14
+ "fi",
15
+ "fr",
16
+ "hu",
17
+ "hy",
18
+ "it",
19
+ "ja",
20
+ "ko",
21
+ "lt",
22
+ "nl",
23
+ "no",
24
+ "pl",
25
+ "pt",
26
+ "ro",
27
+ "ru",
28
+ "sk",
29
+ "sv",
30
+ "th",
31
+ "uk",
32
+ "zh",
33
+ "zh-tw"
34
+ ];
35
+ // src/TranslationException.ts
36
+ import { Exception } from "@ooneex/exception";
37
+ import { HttpStatus } from "@ooneex/http-status";
2
38
 
3
- //# debugId=59F3A1792C61C99864756E2164756E21
39
+ class TranslationException extends Exception {
40
+ constructor(message, key, data = {}) {
41
+ super(message, {
42
+ key,
43
+ status: HttpStatus.Code.NotFound,
44
+ data
45
+ });
46
+ this.name = "TranslationException";
47
+ }
48
+ }
49
+ export {
50
+ locales,
51
+ TranslationException
52
+ };
53
+
54
+ //# debugId=C1414D2FD0C9D40C64756E2164756E21
package/dist/index.js.map CHANGED
@@ -3,9 +3,9 @@
3
3
  "sources": ["src/locales.ts", "src/TranslationException.ts"],
4
4
  "sourcesContent": [
5
5
  "export const locales = [\n \"ar\",\n \"bg\",\n \"cs\",\n \"da\",\n \"de\",\n \"el\",\n \"en\",\n \"eo\",\n \"es\",\n \"et\",\n \"eu\",\n \"fi\",\n \"fr\",\n \"hu\",\n \"hy\",\n \"it\",\n \"ja\",\n \"ko\",\n \"lt\",\n \"nl\",\n \"no\",\n \"pl\",\n \"pt\",\n \"ro\",\n \"ru\",\n \"sk\",\n \"sv\",\n \"th\",\n \"uk\",\n \"zh\",\n \"zh-tw\",\n] as const;\n",
6
- "import { Exception } from \"@ooneex/exception\";\nimport { HttpStatus } from \"@ooneex/http-status\";\n\nexport class TranslationException extends Exception {\n constructor(message: string, data: Record<string, unknown> = {}) {\n super(message, {\n status: HttpStatus.Code.NotFound,\n data,\n });\n this.name = \"TranslationException\";\n }\n}\n"
6
+ "import { Exception } from \"@ooneex/exception\";\nimport { HttpStatus } from \"@ooneex/http-status\";\n\nexport class TranslationException extends Exception {\n constructor(message: string, key: string, data: Record<string, unknown> = {}) {\n super(message, {\n key,\n status: HttpStatus.Code.NotFound,\n data,\n });\n this.name = \"TranslationException\";\n }\n}\n"
7
7
  ],
8
- "mappings": "AAAO,IAAM,EAAU,CACrB,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,KACA,OACF,EChCA,oBAAS,0BACT,qBAAS,4BAEF,MAAM,UAA6B,CAAU,CAClD,WAAW,CAAC,EAAiB,EAAgC,CAAC,EAAG,CAC/D,MAAM,EAAS,CACb,OAAQ,EAAW,KAAK,SACxB,MACF,CAAC,EACD,KAAK,KAAO,uBAEhB",
9
- "debugId": "59F3A1792C61C99864756E2164756E21",
8
+ "mappings": ";AAAO,IAAM,UAAU;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;AChCA;AACA;AAAA;AAEO,MAAM,6BAA6B,UAAU;AAAA,EAClD,WAAW,CAAC,SAAiB,KAAa,OAAgC,CAAC,GAAG;AAAA,IAC5E,MAAM,SAAS;AAAA,MACb;AAAA,MACA,QAAQ,WAAW,KAAK;AAAA,MACxB;AAAA,IACF,CAAC;AAAA,IACD,KAAK,OAAO;AAAA;AAEhB;",
9
+ "debugId": "C1414D2FD0C9D40C64756E2164756E21",
10
10
  "names": []
11
11
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ooneex/translation",
3
3
  "description": "Internationalization framework with locale management, translation key resolution, and pluralization support for multi-language applications",
4
- "version": "1.1.2",
4
+ "version": "1.1.4",
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": "1.1.2",
33
- "@ooneex/http-status": "1.1.2"
32
+ "@ooneex/exception": "1.1.3",
33
+ "@ooneex/http-status": "1.1.3"
34
34
  },
35
35
  "devDependencies": {},
36
36
  "keywords": [