@nexim/localizer 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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
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
+
10
+ ## [1.1.3](https://github.com/the-nexim/nanolib/compare/@nexim/localizer@1.1.2...@nexim/localizer@1.1.3) (2025-08-30)
11
+
12
+ **Note:** Version bump only for package @nexim/localizer
13
+
6
14
  ## [1.1.2](https://github.com/the-nexim/nanolib/compare/@nexim/localizer@1.1.1...@nexim/localizer@1.1.2) (2025-08-19)
7
15
 
8
16
  **Note:** Version bump only for package @nexim/localizer
package/dist/main.cjs CHANGED
@@ -1,167 +1,4 @@
1
- /* @nexim/localizer v1.1.2 */
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.2");
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
- /**
44
- * Retrieves a localized message by key from the resource dictionary.
45
- *
46
- * @param key - The key to lookup in the resource dictionary
47
- * @returns The localized message string
48
- *
49
- * @remarks
50
- * - Returns "\{key\}" if the key is not found in the dictionary
51
- * - Returns an empty string if the key is null or undefined
52
- *
53
- * @example
54
- * ```typescript
55
- * const localizer = new Localizer({...});
56
- * console.log(localizer.message('hello_world')); // "Hello world!"
57
- * console.log(localizer.message('missing_key')); // "{missing_key}"
58
- * ```
59
- */
60
- message(key) {
61
- if (!key) return "";
62
- const msg = this.options__.resource?.[key];
63
- if (msg === void 0) {
64
- this.logger_.accident("message", "l10n_key_not_found", "Key not defined in the localization resource", {
65
- key,
66
- locale: this.options__.locale
67
- });
68
- return `{${key}}`;
69
- }
70
- return msg;
71
- }
72
- /**
73
- * Formats a number according to the current locale settings.
74
- *
75
- * @param number - The number to format
76
- * @param decimal - Number of decimal places (default: 2)
77
- * @returns Formatted number string using locale-specific formatting
78
- *
79
- * @example
80
- * ```typescript
81
- * const localizer = new Localizer({...});
82
- * console.log(localizer.number(1234.567)); // "1,234.57"
83
- * console.log(localizer.number(1234.567, 1)); // "1,234.6"
84
- * ```
85
- */
86
- number(number, decimal = 2) {
87
- if (number == null) return "";
88
- decimal = Math.pow(10, decimal);
89
- number = Math.round(number * decimal) / decimal;
90
- return this.numberFormatter_.format(number);
91
- }
92
- /**
93
- * Replaces all numeric digits in a string with their locale-specific Unicode equivalents.
94
- *
95
- * @param str - The input string containing numbers to replace
96
- * @returns String with numbers converted to locale-specific digits
97
- *
98
- * @example
99
- * ```typescript
100
- * const localizer = new Localizer({locale: {code: 'fa-IR', language: 'fa'}, ...});
101
- * console.log(localizer.replaceNumber('123')); // '۱۲۳'
102
- * ```
103
- */
104
- replaceNumber(str) {
105
- return this.unicodeDigits_.translate(str);
106
- }
107
- /**
108
- * Formats a date according to the current locale settings.
109
- *
110
- * @param date - Date to format (as Date object or timestamp)
111
- * @param options - Intl.DateTimeFormatOptions for customizing the output
112
- * @returns Localized date string
113
- *
114
- * @example
115
- * ```typescript
116
- * const localizer = new Localizer({...});
117
- * console.log(localizer.time(new Date())); // "4/21/2025"
118
- * ```
119
- */
120
- time(date, options) {
121
- if (typeof date === "number") date = new Date(date);
122
- return date.toLocaleDateString(this.options__.locale.code, options);
123
- }
124
- /**
125
- * Creates a relative time string comparing two dates.
126
- *
127
- * @param date - The date to compare (as Date object or timestamp)
128
- * @param from - Reference date for comparison (defaults to current time)
129
- * @param options - Formatting options for relative time
130
- * @returns Localized relative time string
131
- *
132
- * @example
133
- * ```typescript
134
- * const localizer = new Localizer({...});
135
- * const date = new Date(Date.now() - 3600000); // 1 hour ago
136
- * console.log(localizer.relativeTime(date)); // "1 hour ago"
137
- * ```
138
- */
139
- relativeTime(date, from = Date.now(), options = { numeric: "auto", style: "narrow" }) {
140
- const rtf = new Intl.RelativeTimeFormat(this.options__.locale.code, options);
141
- if (typeof date !== "number") date = date.getTime();
142
- if (typeof from !== "number") from = from.getTime();
143
- const diffSec = (from - date) / 1e3;
144
- for (const unit of _Localizer.timeUnits_) {
145
- const interval = Math.floor(Math.abs(diffSec / unit.seconds));
146
- if (interval >= 1) {
147
- return rtf.format(diffSec > 0 ? interval : -interval, unit.label);
148
- }
149
- }
150
- return rtf.format(0, "second");
151
- }
152
- };
153
- /**
154
- * Time units used for relative time calculations.
155
- * @internal
156
- */
157
- _Localizer.timeUnits_ = [
158
- { label: "year", seconds: 31536e3 },
159
- { label: "month", seconds: 2592e3 },
160
- { label: "week", seconds: 604800 },
161
- { label: "day", seconds: 86400 },
162
- { label: "hour", seconds: 3600 },
163
- { label: "minute", seconds: 60 },
164
- { label: "second", seconds: 1 }
165
- ];
166
- var Localizer = _Localizer;
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")}};
167
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');\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA6B;AAC7B,4BAA8B;AAC9B,4BAAoD;AAEpD,aAAc,qCAAc,IAAI,oBAAkB,OAAmB;AAkC9D,IAAM,aAAN,MAAM,WAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoCrB,YAAoB,WAA+D;AAA/D;AArBpB,SAAU,cAAU,4BAAa,kBAAgB;AAsB/C,SAAK,mBAAmB,IAAI,KAAK,aAAa,KAAK,UAAU,OAAO,IAAI;AACxE,SAAK,iBAAiB,IAAI,oCAAc,KAAK,UAAU,OAAO,QAAQ;AAAA,EACxE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBA,QAAQ,KAAgE;AAEtE,QAAI,CAAC,IAAK,QAAO;AAEjB,UAAM,MAAM,KAAK,UAAU,WAAW,GAAG;AACzC,QAAI,QAAQ,QAAW;AACrB,WAAK,QAAQ,SAAS,WAAW,sBAAsB,gDAAgD;AAAA,QACrG;AAAA,QACA,QAAQ,KAAK,UAAU;AAAA,MACzB,CAAC;AACD,aAAO,IAAI,GAAG;AAAA,IAChB;AAEA,WAAO;AAAA,EACT;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAgBA,OAAO,QAAwB,UAAU,GAAW;AAClD,QAAI,UAAU,KAAM,QAAO;AAC3B,cAAU,KAAK,IAAI,IAAI,OAAO;AAC9B,aAAS,KAAK,MAAM,SAAS,OAAO,IAAI;AACxC,WAAO,KAAK,iBAAiB,O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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/dist/main.mjs CHANGED
@@ -1,147 +1,4 @@
1
- /* @nexim/localizer v1.1.2 */
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.2");
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
- /**
21
- * Retrieves a localized message by key from the resource dictionary.
22
- *
23
- * @param key - The key to lookup in the resource dictionary
24
- * @returns The localized message string
25
- *
26
- * @remarks
27
- * - Returns "\{key\}" if the key is not found in the dictionary
28
- * - Returns an empty string if the key is null or undefined
29
- *
30
- * @example
31
- * ```typescript
32
- * const localizer = new Localizer({...});
33
- * console.log(localizer.message('hello_world')); // "Hello world!"
34
- * console.log(localizer.message('missing_key')); // "{missing_key}"
35
- * ```
36
- */
37
- message(key) {
38
- if (!key) return "";
39
- const msg = this.options__.resource?.[key];
40
- if (msg === void 0) {
41
- this.logger_.accident("message", "l10n_key_not_found", "Key not defined in the localization resource", {
42
- key,
43
- locale: this.options__.locale
44
- });
45
- return `{${key}}`;
46
- }
47
- return msg;
48
- }
49
- /**
50
- * Formats a number according to the current locale settings.
51
- *
52
- * @param number - The number to format
53
- * @param decimal - Number of decimal places (default: 2)
54
- * @returns Formatted number string using locale-specific formatting
55
- *
56
- * @example
57
- * ```typescript
58
- * const localizer = new Localizer({...});
59
- * console.log(localizer.number(1234.567)); // "1,234.57"
60
- * console.log(localizer.number(1234.567, 1)); // "1,234.6"
61
- * ```
62
- */
63
- number(number, decimal = 2) {
64
- if (number == null) return "";
65
- decimal = Math.pow(10, decimal);
66
- number = Math.round(number * decimal) / decimal;
67
- return this.numberFormatter_.format(number);
68
- }
69
- /**
70
- * Replaces all numeric digits in a string with their locale-specific Unicode equivalents.
71
- *
72
- * @param str - The input string containing numbers to replace
73
- * @returns String with numbers converted to locale-specific digits
74
- *
75
- * @example
76
- * ```typescript
77
- * const localizer = new Localizer({locale: {code: 'fa-IR', language: 'fa'}, ...});
78
- * console.log(localizer.replaceNumber('123')); // '۱۲۳'
79
- * ```
80
- */
81
- replaceNumber(str) {
82
- return this.unicodeDigits_.translate(str);
83
- }
84
- /**
85
- * Formats a date according to the current locale settings.
86
- *
87
- * @param date - Date to format (as Date object or timestamp)
88
- * @param options - Intl.DateTimeFormatOptions for customizing the output
89
- * @returns Localized date string
90
- *
91
- * @example
92
- * ```typescript
93
- * const localizer = new Localizer({...});
94
- * console.log(localizer.time(new Date())); // "4/21/2025"
95
- * ```
96
- */
97
- time(date, options) {
98
- if (typeof date === "number") date = new Date(date);
99
- return date.toLocaleDateString(this.options__.locale.code, options);
100
- }
101
- /**
102
- * Creates a relative time string comparing two dates.
103
- *
104
- * @param date - The date to compare (as Date object or timestamp)
105
- * @param from - Reference date for comparison (defaults to current time)
106
- * @param options - Formatting options for relative time
107
- * @returns Localized relative time string
108
- *
109
- * @example
110
- * ```typescript
111
- * const localizer = new Localizer({...});
112
- * const date = new Date(Date.now() - 3600000); // 1 hour ago
113
- * console.log(localizer.relativeTime(date)); // "1 hour ago"
114
- * ```
115
- */
116
- relativeTime(date, from = Date.now(), options = { numeric: "auto", style: "narrow" }) {
117
- const rtf = new Intl.RelativeTimeFormat(this.options__.locale.code, options);
118
- if (typeof date !== "number") date = date.getTime();
119
- if (typeof from !== "number") from = from.getTime();
120
- const diffSec = (from - date) / 1e3;
121
- for (const unit of _Localizer.timeUnits_) {
122
- const interval = Math.floor(Math.abs(diffSec / unit.seconds));
123
- if (interval >= 1) {
124
- return rtf.format(diffSec > 0 ? interval : -interval, unit.label);
125
- }
126
- }
127
- return rtf.format(0, "second");
128
- }
129
- };
130
- /**
131
- * Time units used for relative time calculations.
132
- * @internal
133
- */
134
- _Localizer.timeUnits_ = [
135
- { label: "year", seconds: 31536e3 },
136
- { label: "month", seconds: 2592e3 },
137
- { label: "week", seconds: 604800 },
138
- { label: "day", seconds: 86400 },
139
- { label: "hour", seconds: 3600 },
140
- { label: "minute", seconds: 60 },
141
- { label: "second", seconds: 1 }
142
- ];
143
- var Localizer = _Localizer;
144
- export {
145
- Localizer
146
- };
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};
147
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,aAAN,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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBA,QAAQ,KAAgE;AAEtE,QAAI,CAAC,IAAK,QAAO;AAEjB,UAAM,MAAM,KAAK,UAAU,WAAW,GAAG;AACzC,QAAI,QAAQ,QAAW;AACrB,WAAK,QAAQ,SAAS,WAAW,sBAAsB,gDAAgD;AAAA,QACrG;AAAA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"@nexim/localizer",
3
- "version": "1.1.2",
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.3",
52
- "@alwatr/package-tracer": "^5.5.3",
53
- "@alwatr/unicode-digits": "^5.5.3"
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": "^5.5.3",
57
- "@alwatr/type-helper": "^5.4.1",
56
+ "@alwatr/nano-build": "^6.3.9",
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.10",
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": "e67fe3938015270ff3bb71c5d76334faebc4c142"
116
+ "gitHead": "aa1bbda5f949163da8a2e11e658afe02aad75458"
117
117
  }