@nexim/localizer 1.1.3 → 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/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.1.4](https://github.com/the-nexim/nanolib/compare/@nexim/localizer@1.1.3...@nexim/localizer@1.1.4) (2025-11-22)
7
+
8
+ **Note:** Version bump only for package @nexim/localizer
9
+
6
10
  ## [1.1.3](https://github.com/the-nexim/nanolib/compare/@nexim/localizer@1.1.2...@nexim/localizer@1.1.3) (2025-08-30)
7
11
 
8
12
  **Note:** Version bump only for package @nexim/localizer
package/dist/main.cjs CHANGED
@@ -1,168 +1,4 @@
1
- /* @nexim/localizer v1.1.3 */
2
- "use strict";
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
-
21
- // src/main.ts
22
- var main_exports = {};
23
- __export(main_exports, {
24
- Localizer: () => Localizer
25
- });
26
- module.exports = __toCommonJS(main_exports);
27
- var import_logger = require("@alwatr/logger");
28
- var import_package_tracer = require("@alwatr/package-tracer");
29
- var import_unicode_digits = require("@alwatr/unicode-digits");
30
- __dev_mode__: import_package_tracer.packageTracer.add("@nexim/localizer", "1.1.3");
31
- var Localizer = class _Localizer {
32
- /**
33
- * Creates a new instance of the Localizer class.
34
- *
35
- * @param options__ - Configuration options for localization
36
- */
37
- constructor(options__) {
38
- this.options__ = options__;
39
- this.logger_ = (0, import_logger.createLogger)("@nexim/localizer");
40
- this.numberFormatter_ = new Intl.NumberFormat(this.options__.locale.code);
41
- this.unicodeDigits_ = new import_unicode_digits.UnicodeDigits(this.options__.locale.language);
42
- }
43
- static {
44
- /**
45
- * Time units used for relative time calculations.
46
- * @internal
47
- */
48
- this.timeUnits_ = [
49
- { label: "year", seconds: 31536e3 },
50
- { label: "month", seconds: 2592e3 },
51
- { label: "week", seconds: 604800 },
52
- { label: "day", seconds: 86400 },
53
- { label: "hour", seconds: 3600 },
54
- { label: "minute", seconds: 60 },
55
- { label: "second", seconds: 1 }
56
- ];
57
- }
58
- /**
59
- * Retrieves a localized message by key from the resource dictionary.
60
- *
61
- * @param key - The key to lookup in the resource dictionary
62
- * @returns The localized message string
63
- *
64
- * @remarks
65
- * - Returns "\{key\}" if the key is not found in the dictionary
66
- * - Returns an empty string if the key is null or undefined
67
- *
68
- * @example
69
- * ```typescript
70
- * const localizer = new Localizer({...});
71
- * console.log(localizer.message('hello_world')); // "Hello world!"
72
- * console.log(localizer.message('missing_key')); // "{missing_key}"
73
- * ```
74
- */
75
- message(key) {
76
- if (!key) return "";
77
- const msg = this.options__.resource?.[key];
78
- if (msg === void 0) {
79
- this.logger_.accident("message", "l10n_key_not_found", "Key not defined in the localization resource", {
80
- key,
81
- locale: this.options__.locale
82
- });
83
- return `{${key}}`;
84
- }
85
- return msg;
86
- }
87
- /**
88
- * Formats a number according to the current locale settings.
89
- *
90
- * @param number - The number to format
91
- * @param decimal - Number of decimal places (default: 2)
92
- * @returns Formatted number string using locale-specific formatting
93
- *
94
- * @example
95
- * ```typescript
96
- * const localizer = new Localizer({...});
97
- * console.log(localizer.number(1234.567)); // "1,234.57"
98
- * console.log(localizer.number(1234.567, 1)); // "1,234.6"
99
- * ```
100
- */
101
- number(number, decimal = 2) {
102
- if (number == null) return "";
103
- decimal = Math.pow(10, decimal);
104
- number = Math.round(number * decimal) / decimal;
105
- return this.numberFormatter_.format(number);
106
- }
107
- /**
108
- * Replaces all numeric digits in a string with their locale-specific Unicode equivalents.
109
- *
110
- * @param str - The input string containing numbers to replace
111
- * @returns String with numbers converted to locale-specific digits
112
- *
113
- * @example
114
- * ```typescript
115
- * const localizer = new Localizer({locale: {code: 'fa-IR', language: 'fa'}, ...});
116
- * console.log(localizer.replaceNumber('123')); // '۱۲۳'
117
- * ```
118
- */
119
- replaceNumber(str) {
120
- return this.unicodeDigits_.translate(str);
121
- }
122
- /**
123
- * Formats a date according to the current locale settings.
124
- *
125
- * @param date - Date to format (as Date object or timestamp)
126
- * @param options - Intl.DateTimeFormatOptions for customizing the output
127
- * @returns Localized date string
128
- *
129
- * @example
130
- * ```typescript
131
- * const localizer = new Localizer({...});
132
- * console.log(localizer.time(new Date())); // "4/21/2025"
133
- * ```
134
- */
135
- time(date, options) {
136
- if (typeof date === "number") date = new Date(date);
137
- return date.toLocaleDateString(this.options__.locale.code, options);
138
- }
139
- /**
140
- * Creates a relative time string comparing two dates.
141
- *
142
- * @param date - The date to compare (as Date object or timestamp)
143
- * @param from - Reference date for comparison (defaults to current time)
144
- * @param options - Formatting options for relative time
145
- * @returns Localized relative time string
146
- *
147
- * @example
148
- * ```typescript
149
- * const localizer = new Localizer({...});
150
- * const date = new Date(Date.now() - 3600000); // 1 hour ago
151
- * console.log(localizer.relativeTime(date)); // "1 hour ago"
152
- * ```
153
- */
154
- relativeTime(date, from = Date.now(), options = { numeric: "auto", style: "narrow" }) {
155
- const rtf = new Intl.RelativeTimeFormat(this.options__.locale.code, options);
156
- if (typeof date !== "number") date = date.getTime();
157
- if (typeof from !== "number") from = from.getTime();
158
- const diffSec = (from - date) / 1e3;
159
- for (const unit of _Localizer.timeUnits_) {
160
- const interval = Math.floor(Math.abs(diffSec / unit.seconds));
161
- if (interval >= 1) {
162
- return rtf.format(diffSec > 0 ? interval : -interval, unit.label);
163
- }
164
- }
165
- return rtf.format(0, "second");
166
- }
167
- };
1
+ /** 📦 @nexim/localizer v1.1.4 */
2
+ __dev_mode__: console.debug("📦 @nexim/localizer v1.1.4");
3
+ "use strict";var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __hasOwnProp=Object.prototype.hasOwnProperty;var __export=(target,all)=>{for(var name in all)__defProp(target,name,{get:all[name],enumerable:true})};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from==="object"||typeof from==="function"){for(let key of __getOwnPropNames(from))if(!__hasOwnProp.call(to,key)&&key!==except)__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable})}return to};var __toCommonJS=mod=>__copyProps(__defProp({},"__esModule",{value:true}),mod);var main_exports={};__export(main_exports,{Localizer:()=>Localizer});module.exports=__toCommonJS(main_exports);var import_logger=require("@alwatr/logger");var import_package_tracer=require("@alwatr/package-tracer");var import_unicode_digits=require("@alwatr/unicode-digits");__dev_mode__:import_package_tracer.packageTracer.add("@nexim/localizer","1.1.4");var Localizer=class _Localizer{constructor(options__){this.options__=options__;this.logger_=(0,import_logger.createLogger)("@nexim/localizer");this.numberFormatter_=new Intl.NumberFormat(this.options__.locale.code);this.unicodeDigits_=new import_unicode_digits.UnicodeDigits(this.options__.locale.language)}static{this.timeUnits_=[{label:"year",seconds:31536e3},{label:"month",seconds:2592e3},{label:"week",seconds:604800},{label:"day",seconds:86400},{label:"hour",seconds:3600},{label:"minute",seconds:60},{label:"second",seconds:1}]}message(key){if(!key)return"";const msg=this.options__.resource?.[key];if(msg===void 0){this.logger_.accident("message","l10n_key_not_found","Key not defined in the localization resource",{key,locale:this.options__.locale});return`{${key}}`}return msg}number(number,decimal=2){if(number==null)return"";decimal=Math.pow(10,decimal);number=Math.round(number*decimal)/decimal;return this.numberFormatter_.format(number)}replaceNumber(str){return this.unicodeDigits_.translate(str)}time(date,options){if(typeof date==="number")date=new Date(date);return date.toLocaleDateString(this.options__.locale.code,options)}relativeTime(date,from=Date.now(),options={numeric:"auto",style:"narrow"}){const rtf=new Intl.RelativeTimeFormat(this.options__.locale.code,options);if(typeof date!=="number")date=date.getTime();if(typeof from!=="number")from=from.getTime();const diffSec=(from-date)/1e3;for(const unit of _Localizer.timeUnits_){const interval=Math.floor(Math.abs(diffSec/unit.seconds));if(interval>=1){return rtf.format(diffSec>0?interval:-interval,unit.label)}}return rtf.format(0,"second")}};
168
4
  //# sourceMappingURL=main.cjs.map
package/dist/main.cjs.map CHANGED
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/main.ts"],
4
4
  "sourcesContent": ["import { createLogger } from '@alwatr/logger';\nimport { packageTracer } from '@alwatr/package-tracer';\nimport { UnicodeDigits, type UnicodeLangKeys } from '@alwatr/unicode-digits';\n\n__dev_mode__: packageTracer.add(__package_name__, __package_version__);\n\n/**\n * Represents a locale code in the format \"language-COUNTRY\".\n * The language part must be in lowercase, and the country part must be in uppercase.\n *\n * @example \"en-US\"\n * @example \"fr-FR\"\n * @example \"de-DE\"\n */\nexport type LocaleCode = `${Lowercase<string>}-${Uppercase<string>}`;\n\n/**\n * Represents a locale configuration with language code and language identifier.\n */\nexport interface Locale {\n /**\n * fa-IR, en-US, ...\n */\n code: LocaleCode;\n\n /**\n * The ISO 639-1 language code (e.g., 'fa', 'en')\n */\n language: UnicodeLangKeys;\n}\n\n/**\n * Provides localization and internationalization functionality.\n *\n * @remarks\n * This class handles number formatting, text translation, date formatting,\n * and relative time calculations based on the specified locale.\n */\nexport class Localizer {\n /**\n * Number formatter instance for formatting numbers according to the locale.\n *\n * @internal\n */\n protected numberFormatter_;\n\n /**\n * UnicodeDigits instance for converting numbers to locale-specific digits.\n *\n * @internal\n */\n protected unicodeDigits_;\n\n protected logger_ = createLogger(__package_name__);\n\n /**\n * Time units used for relative time calculations.\n * @internal\n */\n static timeUnits_ = [\n { label: 'year', seconds: 31536000 },\n { label: 'month', seconds: 2592000 },\n { label: 'week', seconds: 604800 },\n { label: 'day', seconds: 86400 },\n { label: 'hour', seconds: 3600 },\n { label: 'minute', seconds: 60 },\n { label: 'second', seconds: 1 },\n ] as const;\n\n /**\n * Creates a new instance of the Localizer class.\n *\n * @param options__ - Configuration options for localization\n */\n constructor(private options__: { locale: Locale; resource: DictionaryReq | null }) {\n this.numberFormatter_ = new Intl.NumberFormat(this.options__.locale.code);\n this.unicodeDigits_ = new UnicodeDigits(this.options__.locale.language);\n }\n\n /**\n * Retrieves a localized message by key from the resource dictionary.\n *\n * @param key - The key to lookup in the resource dictionary\n * @returns The localized message string\n *\n * @remarks\n * - Returns \"\\{key\\}\" if the key is not found in the dictionary\n * - Returns an empty string if the key is null or undefined\n *\n * @example\n * ```typescript\n * const localizer = new Localizer({...});\n * console.log(localizer.message('hello_world')); // \"Hello world!\"\n * console.log(localizer.message('missing_key')); // \"{missing_key}\"\n * ```\n */\n message(key: keyof NonNullable<typeof this.options__.resource>): string {\n // this.logger_.logMethodArgs?.('message', key);\n if (!key) return '';\n\n const msg = this.options__.resource?.[key];\n if (msg === undefined) {\n this.logger_.accident('message', 'l10n_key_not_found', 'Key not defined in the localization resource', {\n key,\n locale: this.options__.locale,\n });\n return `{${key}}`;\n }\n // else\n return msg;\n }\n\n /**\n * Formats a number according to the current locale settings.\n *\n * @param number - The number to format\n * @param decimal - Number of decimal places (default: 2)\n * @returns Formatted number string using locale-specific formatting\n *\n * @example\n * ```typescript\n * const localizer = new Localizer({...});\n * console.log(localizer.number(1234.567)); // \"1,234.57\"\n * console.log(localizer.number(1234.567, 1)); // \"1,234.6\"\n * ```\n */\n number(number?: number | null, decimal = 2): string {\n if (number == null) return '';\n decimal = Math.pow(10, decimal);\n number = Math.round(number * decimal) / decimal;\n return this.numberFormatter_.format(number);\n }\n\n /**\n * Replaces all numeric digits in a string with their locale-specific Unicode equivalents.\n *\n * @param str - The input string containing numbers to replace\n * @returns String with numbers converted to locale-specific digits\n *\n * @example\n * ```typescript\n * const localizer = new Localizer({locale: {code: 'fa-IR', language: 'fa'}, ...});\n * console.log(localizer.replaceNumber('123')); // '۱۲۳'\n * ```\n */\n replaceNumber(str: string): string {\n // this.logger_.logMethodArgs?.('replaceNumber', str);\n return this.unicodeDigits_.translate(str);\n }\n\n /**\n * Formats a date according to the current locale settings.\n *\n * @param date - Date to format (as Date object or timestamp)\n * @param options - Intl.DateTimeFormatOptions for customizing the output\n * @returns Localized date string\n *\n * @example\n * ```typescript\n * const localizer = new Localizer({...});\n * console.log(localizer.time(new Date())); // \"4/21/2025\"\n * ```\n */\n time(date: number | Date, options?: Intl.DateTimeFormatOptions): string {\n // this.logger_.logMethodArgs?.('time', { date, options });\n if (typeof date === 'number') date = new Date(date);\n return date.toLocaleDateString(this.options__.locale.code, options);\n }\n\n /**\n * Creates a relative time string comparing two dates.\n *\n * @param date - The date to compare (as Date object or timestamp)\n * @param from - Reference date for comparison (defaults to current time)\n * @param options - Formatting options for relative time\n * @returns Localized relative time string\n *\n * @example\n * ```typescript\n * const localizer = new Localizer({...});\n * const date = new Date(Date.now() - 3600000); // 1 hour ago\n * console.log(localizer.relativeTime(date)); // \"1 hour ago\"\n * ```\n */\n relativeTime(\n date: number | Date,\n from: number | Date = Date.now(),\n options: Intl.RelativeTimeFormatOptions = { numeric: 'auto', style: 'narrow' },\n ): string {\n // this.logger_.logMethodArgs?.('relativeTime', { date, from, options });\n\n const rtf = new Intl.RelativeTimeFormat(this.options__.locale.code, options);\n\n if (typeof date !== 'number') date = date.getTime();\n if (typeof from !== 'number') from = from.getTime();\n const diffSec = (from - date) / 1000;\n\n // Find the appropriate unit for the time difference\n for (const unit of Localizer.timeUnits_) {\n const interval = Math.floor(Math.abs(diffSec / unit.seconds));\n if (interval >= 1) {\n return rtf.format(diffSec > 0 ? interval : -interval, unit.label);\n }\n }\n\n return rtf.format(0, 'second');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,GAAI,OAAO,OAAS,SAAU,KAAO,IAAI,KAAK,IAAI,EAClD,OAAO,KAAK,mBAAmB,KAAK,UAAU,OAAO,KAAM,OAAO,CACpE,CAiBA,aACE,KACA,KAAsB,KAAK,IAAI,EAC/B,QAA0C,CAAE,QAAS,OAAQ,MAAO,QAAS,EACrE,CAGR,MAAM,IAAM,IAAI,KAAK,mBAAmB,KAAK,UAAU,OAAO,KAAM,OAAO,EAE3E,GAAI,OAAO,OAAS,SAAU,KAAO,KAAK,QAAQ,EAClD,GAAI,OAAO,OAAS,SAAU,KAAO,KAAK,QAAQ,EAClD,MAAM,SAAW,KAAO,MAAQ,IAGhC,UAAW,QAAQ,WAAU,WAAY,CACvC,MAAM,SAAW,KAAK,MAAM,KAAK,IAAI,QAAU,KAAK,OAAO,CAAC,EAC5D,GAAI,UAAY,EAAG,CACjB,OAAO,IAAI,OAAO,QAAU,EAAI,SAAW,CAAC,SAAU,KAAK,KAAK,CAClE,CACF,CAEA,OAAO,IAAI,OAAO,EAAG,QAAQ,CAC/B,CACF",
6
6
  "names": []
7
7
  }
package/dist/main.mjs CHANGED
@@ -1,148 +1,4 @@
1
- /* @nexim/localizer v1.1.3 */
2
-
3
- // src/main.ts
4
- import { createLogger } from "@alwatr/logger";
5
- import { packageTracer } from "@alwatr/package-tracer";
6
- import { UnicodeDigits } from "@alwatr/unicode-digits";
7
- __dev_mode__: packageTracer.add("@nexim/localizer", "1.1.3");
8
- var Localizer = class _Localizer {
9
- /**
10
- * Creates a new instance of the Localizer class.
11
- *
12
- * @param options__ - Configuration options for localization
13
- */
14
- constructor(options__) {
15
- this.options__ = options__;
16
- this.logger_ = createLogger("@nexim/localizer");
17
- this.numberFormatter_ = new Intl.NumberFormat(this.options__.locale.code);
18
- this.unicodeDigits_ = new UnicodeDigits(this.options__.locale.language);
19
- }
20
- static {
21
- /**
22
- * Time units used for relative time calculations.
23
- * @internal
24
- */
25
- this.timeUnits_ = [
26
- { label: "year", seconds: 31536e3 },
27
- { label: "month", seconds: 2592e3 },
28
- { label: "week", seconds: 604800 },
29
- { label: "day", seconds: 86400 },
30
- { label: "hour", seconds: 3600 },
31
- { label: "minute", seconds: 60 },
32
- { label: "second", seconds: 1 }
33
- ];
34
- }
35
- /**
36
- * Retrieves a localized message by key from the resource dictionary.
37
- *
38
- * @param key - The key to lookup in the resource dictionary
39
- * @returns The localized message string
40
- *
41
- * @remarks
42
- * - Returns "\{key\}" if the key is not found in the dictionary
43
- * - Returns an empty string if the key is null or undefined
44
- *
45
- * @example
46
- * ```typescript
47
- * const localizer = new Localizer({...});
48
- * console.log(localizer.message('hello_world')); // "Hello world!"
49
- * console.log(localizer.message('missing_key')); // "{missing_key}"
50
- * ```
51
- */
52
- message(key) {
53
- if (!key) return "";
54
- const msg = this.options__.resource?.[key];
55
- if (msg === void 0) {
56
- this.logger_.accident("message", "l10n_key_not_found", "Key not defined in the localization resource", {
57
- key,
58
- locale: this.options__.locale
59
- });
60
- return `{${key}}`;
61
- }
62
- return msg;
63
- }
64
- /**
65
- * Formats a number according to the current locale settings.
66
- *
67
- * @param number - The number to format
68
- * @param decimal - Number of decimal places (default: 2)
69
- * @returns Formatted number string using locale-specific formatting
70
- *
71
- * @example
72
- * ```typescript
73
- * const localizer = new Localizer({...});
74
- * console.log(localizer.number(1234.567)); // "1,234.57"
75
- * console.log(localizer.number(1234.567, 1)); // "1,234.6"
76
- * ```
77
- */
78
- number(number, decimal = 2) {
79
- if (number == null) return "";
80
- decimal = Math.pow(10, decimal);
81
- number = Math.round(number * decimal) / decimal;
82
- return this.numberFormatter_.format(number);
83
- }
84
- /**
85
- * Replaces all numeric digits in a string with their locale-specific Unicode equivalents.
86
- *
87
- * @param str - The input string containing numbers to replace
88
- * @returns String with numbers converted to locale-specific digits
89
- *
90
- * @example
91
- * ```typescript
92
- * const localizer = new Localizer({locale: {code: 'fa-IR', language: 'fa'}, ...});
93
- * console.log(localizer.replaceNumber('123')); // '۱۲۳'
94
- * ```
95
- */
96
- replaceNumber(str) {
97
- return this.unicodeDigits_.translate(str);
98
- }
99
- /**
100
- * Formats a date according to the current locale settings.
101
- *
102
- * @param date - Date to format (as Date object or timestamp)
103
- * @param options - Intl.DateTimeFormatOptions for customizing the output
104
- * @returns Localized date string
105
- *
106
- * @example
107
- * ```typescript
108
- * const localizer = new Localizer({...});
109
- * console.log(localizer.time(new Date())); // "4/21/2025"
110
- * ```
111
- */
112
- time(date, options) {
113
- if (typeof date === "number") date = new Date(date);
114
- return date.toLocaleDateString(this.options__.locale.code, options);
115
- }
116
- /**
117
- * Creates a relative time string comparing two dates.
118
- *
119
- * @param date - The date to compare (as Date object or timestamp)
120
- * @param from - Reference date for comparison (defaults to current time)
121
- * @param options - Formatting options for relative time
122
- * @returns Localized relative time string
123
- *
124
- * @example
125
- * ```typescript
126
- * const localizer = new Localizer({...});
127
- * const date = new Date(Date.now() - 3600000); // 1 hour ago
128
- * console.log(localizer.relativeTime(date)); // "1 hour ago"
129
- * ```
130
- */
131
- relativeTime(date, from = Date.now(), options = { numeric: "auto", style: "narrow" }) {
132
- const rtf = new Intl.RelativeTimeFormat(this.options__.locale.code, options);
133
- if (typeof date !== "number") date = date.getTime();
134
- if (typeof from !== "number") from = from.getTime();
135
- const diffSec = (from - date) / 1e3;
136
- for (const unit of _Localizer.timeUnits_) {
137
- const interval = Math.floor(Math.abs(diffSec / unit.seconds));
138
- if (interval >= 1) {
139
- return rtf.format(diffSec > 0 ? interval : -interval, unit.label);
140
- }
141
- }
142
- return rtf.format(0, "second");
143
- }
144
- };
145
- export {
146
- Localizer
147
- };
1
+ /** 📦 @nexim/localizer v1.1.4 */
2
+ __dev_mode__: console.debug("📦 @nexim/localizer v1.1.4");
3
+ import{createLogger}from"@alwatr/logger";import{packageTracer}from"@alwatr/package-tracer";import{UnicodeDigits}from"@alwatr/unicode-digits";__dev_mode__:packageTracer.add("@nexim/localizer","1.1.4");var Localizer=class _Localizer{constructor(options__){this.options__=options__;this.logger_=createLogger("@nexim/localizer");this.numberFormatter_=new Intl.NumberFormat(this.options__.locale.code);this.unicodeDigits_=new UnicodeDigits(this.options__.locale.language)}static{this.timeUnits_=[{label:"year",seconds:31536e3},{label:"month",seconds:2592e3},{label:"week",seconds:604800},{label:"day",seconds:86400},{label:"hour",seconds:3600},{label:"minute",seconds:60},{label:"second",seconds:1}]}message(key){if(!key)return"";const msg=this.options__.resource?.[key];if(msg===void 0){this.logger_.accident("message","l10n_key_not_found","Key not defined in the localization resource",{key,locale:this.options__.locale});return`{${key}}`}return msg}number(number,decimal=2){if(number==null)return"";decimal=Math.pow(10,decimal);number=Math.round(number*decimal)/decimal;return this.numberFormatter_.format(number)}replaceNumber(str){return this.unicodeDigits_.translate(str)}time(date,options){if(typeof date==="number")date=new Date(date);return date.toLocaleDateString(this.options__.locale.code,options)}relativeTime(date,from=Date.now(),options={numeric:"auto",style:"narrow"}){const rtf=new Intl.RelativeTimeFormat(this.options__.locale.code,options);if(typeof date!=="number")date=date.getTime();if(typeof from!=="number")from=from.getTime();const diffSec=(from-date)/1e3;for(const unit of _Localizer.timeUnits_){const interval=Math.floor(Math.abs(diffSec/unit.seconds));if(interval>=1){return rtf.format(diffSec>0?interval:-interval,unit.label)}}return rtf.format(0,"second")}};export{Localizer};
148
4
  //# sourceMappingURL=main.mjs.map
package/dist/main.mjs.map CHANGED
@@ -2,6 +2,6 @@
2
2
  "version": 3,
3
3
  "sources": ["../src/main.ts"],
4
4
  "sourcesContent": ["import { createLogger } from '@alwatr/logger';\nimport { packageTracer } from '@alwatr/package-tracer';\nimport { UnicodeDigits, type UnicodeLangKeys } from '@alwatr/unicode-digits';\n\n__dev_mode__: packageTracer.add(__package_name__, __package_version__);\n\n/**\n * Represents a locale code in the format \"language-COUNTRY\".\n * The language part must be in lowercase, and the country part must be in uppercase.\n *\n * @example \"en-US\"\n * @example \"fr-FR\"\n * @example \"de-DE\"\n */\nexport type LocaleCode = `${Lowercase<string>}-${Uppercase<string>}`;\n\n/**\n * Represents a locale configuration with language code and language identifier.\n */\nexport interface Locale {\n /**\n * fa-IR, en-US, ...\n */\n code: LocaleCode;\n\n /**\n * The ISO 639-1 language code (e.g., 'fa', 'en')\n */\n language: UnicodeLangKeys;\n}\n\n/**\n * Provides localization and internationalization functionality.\n *\n * @remarks\n * This class handles number formatting, text translation, date formatting,\n * and relative time calculations based on the specified locale.\n */\nexport class Localizer {\n /**\n * Number formatter instance for formatting numbers according to the locale.\n *\n * @internal\n */\n protected numberFormatter_;\n\n /**\n * UnicodeDigits instance for converting numbers to locale-specific digits.\n *\n * @internal\n */\n protected unicodeDigits_;\n\n protected logger_ = createLogger(__package_name__);\n\n /**\n * Time units used for relative time calculations.\n * @internal\n */\n static timeUnits_ = [\n { label: 'year', seconds: 31536000 },\n { label: 'month', seconds: 2592000 },\n { label: 'week', seconds: 604800 },\n { label: 'day', seconds: 86400 },\n { label: 'hour', seconds: 3600 },\n { label: 'minute', seconds: 60 },\n { label: 'second', seconds: 1 },\n ] as const;\n\n /**\n * Creates a new instance of the Localizer class.\n *\n * @param options__ - Configuration options for localization\n */\n constructor(private options__: { locale: Locale; resource: DictionaryReq | null }) {\n this.numberFormatter_ = new Intl.NumberFormat(this.options__.locale.code);\n this.unicodeDigits_ = new UnicodeDigits(this.options__.locale.language);\n }\n\n /**\n * Retrieves a localized message by key from the resource dictionary.\n *\n * @param key - The key to lookup in the resource dictionary\n * @returns The localized message string\n *\n * @remarks\n * - Returns \"\\{key\\}\" if the key is not found in the dictionary\n * - Returns an empty string if the key is null or undefined\n *\n * @example\n * ```typescript\n * const localizer = new Localizer({...});\n * console.log(localizer.message('hello_world')); // \"Hello world!\"\n * console.log(localizer.message('missing_key')); // \"{missing_key}\"\n * ```\n */\n message(key: keyof NonNullable<typeof this.options__.resource>): string {\n // this.logger_.logMethodArgs?.('message', key);\n if (!key) return '';\n\n const msg = this.options__.resource?.[key];\n if (msg === undefined) {\n this.logger_.accident('message', 'l10n_key_not_found', 'Key not defined in the localization resource', {\n key,\n locale: this.options__.locale,\n });\n return `{${key}}`;\n }\n // else\n return msg;\n }\n\n /**\n * Formats a number according to the current locale settings.\n *\n * @param number - The number to format\n * @param decimal - Number of decimal places (default: 2)\n * @returns Formatted number string using locale-specific formatting\n *\n * @example\n * ```typescript\n * const localizer = new Localizer({...});\n * console.log(localizer.number(1234.567)); // \"1,234.57\"\n * console.log(localizer.number(1234.567, 1)); // \"1,234.6\"\n * ```\n */\n number(number?: number | null, decimal = 2): string {\n if (number == null) return '';\n decimal = Math.pow(10, decimal);\n number = Math.round(number * decimal) / decimal;\n return this.numberFormatter_.format(number);\n }\n\n /**\n * Replaces all numeric digits in a string with their locale-specific Unicode equivalents.\n *\n * @param str - The input string containing numbers to replace\n * @returns String with numbers converted to locale-specific digits\n *\n * @example\n * ```typescript\n * const localizer = new Localizer({locale: {code: 'fa-IR', language: 'fa'}, ...});\n * console.log(localizer.replaceNumber('123')); // '۱۲۳'\n * ```\n */\n replaceNumber(str: string): string {\n // this.logger_.logMethodArgs?.('replaceNumber', str);\n return this.unicodeDigits_.translate(str);\n }\n\n /**\n * Formats a date according to the current locale settings.\n *\n * @param date - Date to format (as Date object or timestamp)\n * @param options - Intl.DateTimeFormatOptions for customizing the output\n * @returns Localized date string\n *\n * @example\n * ```typescript\n * const localizer = new Localizer({...});\n * console.log(localizer.time(new Date())); // \"4/21/2025\"\n * ```\n */\n time(date: number | Date, options?: Intl.DateTimeFormatOptions): string {\n // this.logger_.logMethodArgs?.('time', { date, options });\n if (typeof date === 'number') date = new Date(date);\n return date.toLocaleDateString(this.options__.locale.code, options);\n }\n\n /**\n * Creates a relative time string comparing two dates.\n *\n * @param date - The date to compare (as Date object or timestamp)\n * @param from - Reference date for comparison (defaults to current time)\n * @param options - Formatting options for relative time\n * @returns Localized relative time string\n *\n * @example\n * ```typescript\n * const localizer = new Localizer({...});\n * const date = new Date(Date.now() - 3600000); // 1 hour ago\n * console.log(localizer.relativeTime(date)); // \"1 hour ago\"\n * ```\n */\n relativeTime(\n date: number | Date,\n from: number | Date = Date.now(),\n options: Intl.RelativeTimeFormatOptions = { numeric: 'auto', style: 'narrow' },\n ): string {\n // this.logger_.logMethodArgs?.('relativeTime', { date, from, options });\n\n const rtf = new Intl.RelativeTimeFormat(this.options__.locale.code, options);\n\n if (typeof date !== 'number') date = date.getTime();\n if (typeof from !== 'number') from = from.getTime();\n const diffSec = (from - date) / 1000;\n\n // Find the appropriate unit for the time difference\n for (const unit of Localizer.timeUnits_) {\n const interval = Math.floor(Math.abs(diffSec / unit.seconds));\n if (interval >= 1) {\n return rtf.format(diffSec > 0 ? interval : -interval, unit.label);\n }\n }\n\n return rtf.format(0, 'second');\n }\n}\n"],
5
- "mappings": ";;;AAAA,SAAS,oBAAoB;AAC7B,SAAS,qBAAqB;AAC9B,SAAS,qBAA2C;AAEpD,aAAc,eAAc,IAAI,oBAAkB,OAAmB;AAkC9D,IAAM,YAAN,MAAM,WAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoCrB,YAAoB,WAA+D;AAA/D;AArBpB,SAAU,UAAU,aAAa,kBAAgB;AAsB/C,SAAK,mBAAmB,IAAI,KAAK,aAAa,KAAK,UAAU,OAAO,IAAI;AACxE,SAAK,iBAAiB,IAAI,cAAc,KAAK,UAAU,OAAO,QAAQ;AAAA,EACxE;AAAA,EAlBA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAO,aAAa;AAAA,MAClB,EAAE,OAAO,QAAQ,SAAS,QAAS;AAAA,MACnC,EAAE,OAAO,SAAS,SAAS,OAAQ;AAAA,MACnC,EAAE,OAAO,QAAQ,SAAS,OAAO;AAAA,MACjC,EAAE,OAAO,OAAO,SAAS,MAAM;AAAA,MAC/B,EAAE,OAAO,QAAQ,SAAS,KAAK;AAAA,MAC/B,EAAE,OAAO,UAAU,SAAS,GAAG;AAAA,MAC/B,EAAE,OAAO,UAAU,SAAS,EAAE;AAAA,IAChC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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A,OAAQ,KAAK,UAAU,MACzB,CAAC,EACD,MAAO,IAAI,GAAG,GAChB,CAEA,OAAO,GACT,CAgBA,OAAO,OAAwB,QAAU,EAAW,CAClD,GAAI,QAAU,KAAM,MAAO,GAC3B,QAAU,KAAK,IAAI,GAAI,OAAO,EAC9B,OAAS,KAAK,MAAM,OAAS,OAAO,EAAI,QACxC,OAAO,KAAK,iBAAiB,OAAO,MAAM,CAC5C,CAcA,cAAc,IAAqB,CAEjC,OAAO,KAAK,eAAe,UAAU,GAAG,CAC1C,CAeA,KAAK,KAAqB,QAA8C,CAEtE,GAAI,OAAO,OAAS,SAAU,KAAO,IAAI,KAAK,IAAI,EAClD,OAAO,KAAK,mBAAmB,KAAK,UAAU,OAAO,KAAM,OAAO,CACpE,CAiBA,aACE,KACA,KAAsB,KAAK,IAAI,EAC/B,QAA0C,CAAE,QAAS,OAAQ,MAAO,QAAS,EACrE,CAGR,MAAM,IAAM,IAAI,KAAK,mBAAmB,KAAK,UAAU,OAAO,KAAM,OAAO,EAE3E,GAAI,OAAO,OAAS,SAAU,KAAO,KAAK,QAAQ,EAClD,GAAI,OAAO,OAAS,SAAU,KAAO,KAAK,QAAQ,EAClD,MAAM,SAAW,KAAO,MAAQ,IAGhC,UAAW,QAAQ,WAAU,WAAY,CACvC,MAAM,SAAW,KAAK,MAAM,KAAK,IAAI,QAAU,KAAK,OAAO,CAAC,EAC5D,GAAI,UAAY,EAAG,CACjB,OAAO,IAAI,OAAO,QAAU,EAAI,SAAW,CAAC,SAAU,KAAK,KAAK,CAClE,CACF,CAEA,OAAO,IAAI,OAAO,EAAG,QAAQ,CAC/B,CACF",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nexim/localizer",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "description": "Lightweight i18n utilities to handle translations, number formatting, date/time localization using native browser APIs.",
5
5
  "keywords": [
6
6
  "localization",
@@ -48,19 +48,19 @@
48
48
  "watch": "wireit"
49
49
  },
50
50
  "dependencies": {
51
- "@alwatr/logger": "^5.5.6",
52
- "@alwatr/package-tracer": "^5.5.6",
53
- "@alwatr/unicode-digits": "^5.5.6"
51
+ "@alwatr/logger": "^5.6.2",
52
+ "@alwatr/package-tracer": "^5.5.23",
53
+ "@alwatr/unicode-digits": "^5.5.24"
54
54
  },
55
55
  "devDependencies": {
56
- "@alwatr/nano-build": "^6.0.1",
56
+ "@alwatr/nano-build": "^6.3.9",
57
57
  "@alwatr/type-helper": "^5.4.4",
58
58
  "@nexim/typescript-config": "^2.0.1",
59
59
  "ava": "^6.4.1",
60
- "typedoc": "^0.28.11",
61
- "typedoc-plugin-markdown": "^4.8.1",
60
+ "typedoc": "^0.28.14",
61
+ "typedoc-plugin-markdown": "^4.9.0",
62
62
  "typedoc-plugin-no-inherit": "^1.6.1",
63
- "typescript": "^5.9.2",
63
+ "typescript": "^5.9.3",
64
64
  "wireit": "^0.14.12"
65
65
  },
66
66
  "publishConfig": {
@@ -113,5 +113,5 @@
113
113
  "command": "typedoc"
114
114
  }
115
115
  },
116
- "gitHead": "e9784c58e523a33fc5dc6959559ba60cbdd55ab1"
116
+ "gitHead": "aa1bbda5f949163da8a2e11e658afe02aad75458"
117
117
  }