@esgettext/runtime 1.1.0 → 1.2.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/LICENSE +1 -1
- package/README.md +17 -19
- package/dist/core/catalog-cache.d.ts +11 -0
- package/dist/core/catalog-cache.d.ts.map +1 -1
- package/dist/core/catalog.d.ts +42 -4
- package/dist/core/catalog.d.ts.map +1 -1
- package/dist/core/data-viewlet.d.ts +10 -0
- package/dist/core/data-viewlet.d.ts.map +1 -1
- package/dist/core/locale-container.d.ts +26 -3
- package/dist/core/locale-container.d.ts.map +1 -1
- package/dist/core/resolve-impl.d.ts.map +1 -1
- package/dist/core/textdomain.d.ts +412 -4
- package/dist/core/textdomain.d.ts.map +1 -1
- package/dist/esgettext.cjs.js +684 -141
- package/dist/esgettext.cjs.js.map +1 -1
- package/dist/esgettext.esm.js +684 -141
- package/dist/esgettext.esm.js.map +1 -1
- package/dist/esgettext.js +1415 -0
- package/dist/esgettext.js.map +1 -0
- package/dist/esgettext.min.js +1 -1
- package/dist/esgettext.min.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,56 +1,464 @@
|
|
|
1
|
-
import { Catalog } from './catalog';
|
|
2
|
-
import { LocaleContainer } from './locale-container';
|
|
1
|
+
import type { Catalog } from './catalog';
|
|
2
|
+
import type { LocaleContainer } from './locale-container';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a mapping of placeholder strings to the values that they should be replaced with.
|
|
5
|
+
* Placeholders must match the regular expression `/^[_a-zA-Z][_a-zA-Z0-9]*$/`.
|
|
6
|
+
* @remarks
|
|
7
|
+
* Placeholders provide a way to dynamically replace certain strings in a translatable message.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* const placeholders: Placeholders = {
|
|
12
|
+
* 'name': 'John Doe',
|
|
13
|
+
* 'age': 30,
|
|
14
|
+
* // Add more placeholders as needed
|
|
15
|
+
* };
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* A typical call would look like this:
|
|
19
|
+
*
|
|
20
|
+
* ```typescript
|
|
21
|
+
* console.log(gtx._x('User {name} is {age} years old.'));
|
|
22
|
+
* ```
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
3
25
|
export interface Placeholders {
|
|
4
26
|
[placeholder: string]: any;
|
|
5
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* A Textdomain is a container for an esgettext configuration and all loaded
|
|
30
|
+
* LocaleContainer for the textual domain selected.
|
|
31
|
+
*
|
|
32
|
+
* The actual translation methods have quite funny names like `_()` or
|
|
33
|
+
* `_x()`. The purpose of this naming convention is to make the
|
|
34
|
+
* internationalization of your programs as little obtrusive as possible.
|
|
35
|
+
* Most of the times you just have to exchange
|
|
36
|
+
*
|
|
37
|
+
* ```
|
|
38
|
+
* doSomething('Hello, world!');
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* with
|
|
42
|
+
*
|
|
43
|
+
* ```
|
|
44
|
+
* doSomething(gtx._('Hello, world!'));
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* Besides, depending on the string extractor you are using, it may be useful
|
|
48
|
+
* that the method names do not collide with method names from other packages.
|
|
49
|
+
*/
|
|
6
50
|
export declare class Textdomain {
|
|
7
51
|
private static domains;
|
|
8
|
-
private static readonly cache;
|
|
9
52
|
private static boundDomains;
|
|
10
53
|
private static _locale;
|
|
11
54
|
private domain;
|
|
12
55
|
private _catalogFormat;
|
|
13
56
|
private catalog;
|
|
14
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Retrieve a translation for a string.
|
|
59
|
+
*
|
|
60
|
+
* @param msgid - the string to translate
|
|
61
|
+
*
|
|
62
|
+
* @returns the translated string
|
|
63
|
+
*/
|
|
15
64
|
_(msgid: string): string;
|
|
65
|
+
/**
|
|
66
|
+
* Retrieve a translation for a string containing a possible plural.
|
|
67
|
+
* You will almost always want to call {@link _nx} instead so that
|
|
68
|
+
* you can interpolate the number of items into the strings.
|
|
69
|
+
*
|
|
70
|
+
* @param msgid - the string in the singular
|
|
71
|
+
* @param msgidPlural - the string in the plural
|
|
72
|
+
* @param numItems - the number of items
|
|
73
|
+
*
|
|
74
|
+
* @returns the translated string
|
|
75
|
+
*/
|
|
16
76
|
_n(msgid: string, msgidPlural: string, numItems: number): string;
|
|
77
|
+
/**
|
|
78
|
+
* Translate a string with a context.
|
|
79
|
+
*
|
|
80
|
+
* @param msgctxt - the message context
|
|
81
|
+
* @param msgid - the string to translate
|
|
82
|
+
*
|
|
83
|
+
* @returns the translated string
|
|
84
|
+
*/
|
|
17
85
|
_p(msgctxt: string, msgid: string): string;
|
|
86
|
+
/**
|
|
87
|
+
* The method `_np()` combines `_n()` with `_p()`.
|
|
88
|
+
* You will almost always want to call {@link _npx} instead so that
|
|
89
|
+
* you can interpolate the number of items into the strings.
|
|
90
|
+
|
|
91
|
+
*
|
|
92
|
+
* @param msgctxt - the message context
|
|
93
|
+
* @param msgid - the message id
|
|
94
|
+
* @param placeholders - a dictionary with placehoders
|
|
95
|
+
* @returns the translated string
|
|
96
|
+
*/
|
|
18
97
|
_np(msgctxt: string, msgid: string, msgidPlural: string, numItems: number): string;
|
|
98
|
+
/**
|
|
99
|
+
* Translate a string with placeholders. The placeholders should be
|
|
100
|
+
* wrapped into curly braces and must match the regular expression
|
|
101
|
+
* "[_a-zA-Z][_a-zA-Z0-9]*".
|
|
102
|
+
*
|
|
103
|
+
* @param msgid - the msgid to translate
|
|
104
|
+
* @param placeholders - an optional dictionary of placeholders
|
|
105
|
+
*
|
|
106
|
+
* @returns the translated string with placeholders expanded
|
|
107
|
+
*/
|
|
19
108
|
_x(msgid: string, placeholders?: Placeholders): string;
|
|
109
|
+
/**
|
|
110
|
+
* Translate a string with a plural expression with placeholders.
|
|
111
|
+
*
|
|
112
|
+
* @param msgid - the string in the singular
|
|
113
|
+
* @param msgidPlural - the string in the plural
|
|
114
|
+
* @param numItems - the number of items
|
|
115
|
+
* @param placeholders - an optional dictionary of placeholders
|
|
116
|
+
*
|
|
117
|
+
* @returns the translated string
|
|
118
|
+
*/
|
|
20
119
|
_nx(msgid: string, msgidPlural: string, numItems: number, placeholders?: Placeholders): string;
|
|
120
|
+
/**
|
|
121
|
+
* The method `_px()` combines `_p()` with `_x()`.
|
|
122
|
+
*
|
|
123
|
+
* @param msgctxt - the message context
|
|
124
|
+
* @param msgid - the message id
|
|
125
|
+
* @param placeholders - an optional dictionary with placehoders
|
|
126
|
+
* @returns the translated string
|
|
127
|
+
*/
|
|
21
128
|
_px(msgctxt: string, msgid: string, placeholders?: Placeholders): string;
|
|
129
|
+
/**
|
|
130
|
+
* The method `_npx()` brings it all together. It combines `_n()` and
|
|
131
|
+
* `_p()` and `_x()`.
|
|
132
|
+
*
|
|
133
|
+
* @param msgctxt - the message context
|
|
134
|
+
* @param msgid - the message id
|
|
135
|
+
* @param msgidPlural - the plural string
|
|
136
|
+
* @param numItems - the number of items
|
|
137
|
+
* @param placeholders - an optional dictionary with placehoders
|
|
138
|
+
* @returns the translated string
|
|
139
|
+
*/
|
|
22
140
|
_npx(msgctxt: string, msgid: string, msgidPlural: string, numItems: number, placeholders?: Placeholders): string;
|
|
23
141
|
private static getCatalog;
|
|
142
|
+
/**
|
|
143
|
+
* Retrieve a translation for a string with a fixed locale.
|
|
144
|
+
*
|
|
145
|
+
* @param locale - the locale identifier
|
|
146
|
+
* @param msgid - the string to translate
|
|
147
|
+
*
|
|
148
|
+
* @returns the translated string
|
|
149
|
+
*/
|
|
24
150
|
_l(locale: string, msgid: string): string;
|
|
151
|
+
/**
|
|
152
|
+
* Retrieve a translation for a string containing a possible plural with
|
|
153
|
+
* a fixed locale.
|
|
154
|
+
* You will almost always want to call {@link _nx} instead so that
|
|
155
|
+
* you can interpolate the number of items into the strings.
|
|
156
|
+
*
|
|
157
|
+
* @param locale - the locale identifier
|
|
158
|
+
* @param msgid - the string in the singular
|
|
159
|
+
* @param msgidPlural - the string in the plural
|
|
160
|
+
* @param numItems - the number of items
|
|
161
|
+
*
|
|
162
|
+
* @returns the translated string
|
|
163
|
+
*/
|
|
25
164
|
_ln(locale: string, msgid: string, msgidPlural: string, numItems: number): string;
|
|
165
|
+
/**
|
|
166
|
+
* Translate a string with a context with a fixed locale.
|
|
167
|
+
*
|
|
168
|
+
* @param locale - the locale identifier
|
|
169
|
+
* @param msgctxt - the message context
|
|
170
|
+
* @param msgid - the string to translate
|
|
171
|
+
*
|
|
172
|
+
* @returns the translated string
|
|
173
|
+
*/
|
|
26
174
|
_lp(locale: string, msgctxt: string, msgid: string): string;
|
|
175
|
+
/**
|
|
176
|
+
* The method `_lnp()` combines `_ln()` with `_lp()`.
|
|
177
|
+
* You will almost always want to call {@link _npx} instead so that
|
|
178
|
+
* you can interpolate the number of items into the strings.
|
|
179
|
+
|
|
180
|
+
*
|
|
181
|
+
* @param locale - the locale identifier
|
|
182
|
+
* @param msgctxt - the message context
|
|
183
|
+
* @param msgid - the message id
|
|
184
|
+
* @param placeholders - a dictionary with placehoders
|
|
185
|
+
* @returns the translated string
|
|
186
|
+
*/
|
|
27
187
|
_lnp(locale: string, msgctxt: string, msgid: string, msgidPlural: string, numItems: number): string;
|
|
188
|
+
/**
|
|
189
|
+
* Translate a string with placeholders for a fixed locale.
|
|
190
|
+
* The placeholders should be
|
|
191
|
+
* wrapped into curly braces and must match the regular expression
|
|
192
|
+
* "[_a-zA-Z][_a-zA-Z0-9]*".
|
|
193
|
+
*
|
|
194
|
+
* @param locale - the locale identifier
|
|
195
|
+
* @param msgid - the msgid to translate
|
|
196
|
+
* @param placeholders - an optional dictionary of placeholders
|
|
197
|
+
*
|
|
198
|
+
* @returns the translated string with placeholders expanded
|
|
199
|
+
*/
|
|
28
200
|
_lx(locale: string, msgid: string, placeholders?: Placeholders): string;
|
|
201
|
+
/**
|
|
202
|
+
* Translate a string with a plural expression with placeholders into a
|
|
203
|
+
* fixed locale.
|
|
204
|
+
*
|
|
205
|
+
* @param locale - the locale identifier
|
|
206
|
+
* @param msgid - the string in the singular
|
|
207
|
+
* @param msgidPlural - the string in the plural
|
|
208
|
+
* @param numItems - the number of items
|
|
209
|
+
* @param placeholders - an optional dictionary of placeholders
|
|
210
|
+
*
|
|
211
|
+
* @returns the translated string
|
|
212
|
+
*/
|
|
29
213
|
_lnx(locale: string, msgid: string, msgidPlural: string, numItems: number, placeholders?: Placeholders): string;
|
|
214
|
+
/**
|
|
215
|
+
* The method `_lpx()` combines `_lp()` with `_lx()`.
|
|
216
|
+
*
|
|
217
|
+
* @param locale - the locale identifier
|
|
218
|
+
* @param msgctxt - the message context
|
|
219
|
+
* @param msgid - the message id
|
|
220
|
+
* @param placeholders - an optional dictionary with placehoders
|
|
221
|
+
* @returns the translated string
|
|
222
|
+
*/
|
|
30
223
|
_lpx(locale: string, msgctxt: string, msgid: string, placeholders?: Placeholders): string;
|
|
224
|
+
/**
|
|
225
|
+
* The method `_lnpx()` brings it all together. It combines `_ln()` and
|
|
226
|
+
* `_lp()` and `_lx()`.
|
|
227
|
+
*
|
|
228
|
+
* @param locale - the locale identifier
|
|
229
|
+
* @param msgctxt - the message context
|
|
230
|
+
* @param msgid - the message id
|
|
231
|
+
* @param msgidPlural - the plural string
|
|
232
|
+
* @param numItems - the number of items
|
|
233
|
+
* @param placeholders - an optional dictionary with placehoders
|
|
234
|
+
* @returns the translated string
|
|
235
|
+
*/
|
|
31
236
|
_lnpx(locale: string, msgctxt: string, msgid: string, msgidPlural: string, numItems: number, placeholders?: Placeholders): string;
|
|
32
237
|
private static expand;
|
|
238
|
+
/**
|
|
239
|
+
* Instantiate a Textdomain object. Textdomain objects are singletons
|
|
240
|
+
* for each textdomain identifier.
|
|
241
|
+
*
|
|
242
|
+
* @param textdomain - the textdomain of your application or library.
|
|
243
|
+
*
|
|
244
|
+
* @returns a [[`Textdomain`]]
|
|
245
|
+
*/
|
|
33
246
|
static getInstance(textdomain: string): Textdomain;
|
|
247
|
+
/**
|
|
248
|
+
* Delete all existing singletons. This method should usually be called
|
|
249
|
+
* only, when you want to free memory.
|
|
250
|
+
*/
|
|
34
251
|
static clearInstances(): void;
|
|
252
|
+
/**
|
|
253
|
+
* This method is used for testing. Do not use it yourself!
|
|
254
|
+
*/
|
|
35
255
|
static forgetInstances(): void;
|
|
256
|
+
/**
|
|
257
|
+
* Query the locale in use.
|
|
258
|
+
*/
|
|
36
259
|
static get locale(): string;
|
|
260
|
+
/**
|
|
261
|
+
* Change the locale.
|
|
262
|
+
*
|
|
263
|
+
* For the web you can use all valid language identifier tags that
|
|
264
|
+
* [BCP47](https://tools.ietf.org/html/bcp47) allows
|
|
265
|
+
* (and actually a lot more). The tag is always used unmodified.
|
|
266
|
+
*
|
|
267
|
+
* For server environments, the locale identifier has to match the following
|
|
268
|
+
* scheme:
|
|
269
|
+
*
|
|
270
|
+
* `ll_CC.charset\@modifier`
|
|
271
|
+
*
|
|
272
|
+
* * `ll` is the two- or three-letter language code.
|
|
273
|
+
* * `CC` is the optional two-letter country code.
|
|
274
|
+
* * `charset` is an optional character set (letters, digits, and the hyphen).
|
|
275
|
+
* * `modifier` is an optional variant (letters and digits).
|
|
276
|
+
*
|
|
277
|
+
* The language code is always converted to lowercase, the country code is
|
|
278
|
+
* converted to uppercase, variant and charset are used as is.
|
|
279
|
+
*
|
|
280
|
+
* @param locale - the locale identifier
|
|
281
|
+
* @returns the locale in use
|
|
282
|
+
*/
|
|
37
283
|
static set locale(locale: string);
|
|
38
284
|
private constructor();
|
|
285
|
+
/**
|
|
286
|
+
* A textdomain is an identifier for your application or library. It is
|
|
287
|
+
* the basename of your translation files which are either
|
|
288
|
+
* TEXTDOMAIN.mo.json or TEXTDOMAIN.mo, depending on the format you have
|
|
289
|
+
* chosen.
|
|
290
|
+
*
|
|
291
|
+
* FIXME! This should be a getter!
|
|
292
|
+
*
|
|
293
|
+
* @returns the textdomain
|
|
294
|
+
*/
|
|
39
295
|
textdomain(): string;
|
|
296
|
+
/**
|
|
297
|
+
* Bind a textdomain to a certain path or queries the path that a
|
|
298
|
+
* textdomain is bound to. The catalog file will be searched
|
|
299
|
+
* in `${path}/LC_MESSAGES/${domainname}.EXT` where `EXT` is the
|
|
300
|
+
* selected catalog format (one of `mo.json`, `mo`, or `json`).
|
|
301
|
+
*
|
|
302
|
+
* Alternatively, you can pass a [[`LocaleContainer`]] that holds the
|
|
303
|
+
* catalogs in memory.
|
|
304
|
+
*
|
|
305
|
+
* The returned string or `LocaleContainer` is valid until the next
|
|
306
|
+
* `bindtextdomain` call with an argument.
|
|
307
|
+
*
|
|
308
|
+
* @param path - the base path or [[`LocaleContainer`]] for this textdomain
|
|
309
|
+
*
|
|
310
|
+
* @returns the current base directory or [[`LocaleContainer`]] for this domain, after possibly changing it.
|
|
311
|
+
*/
|
|
40
312
|
bindtextdomain(path?: string | LocaleContainer): string | LocaleContainer;
|
|
313
|
+
/**
|
|
314
|
+
* Resolve a textdomain, i.e. load the LocaleContainer for this domain and all
|
|
315
|
+
* of its dependencies for the currently selected locale or the locale
|
|
316
|
+
* specified.
|
|
317
|
+
*
|
|
318
|
+
* The promise will always resolve. If no catalog was found, an empty
|
|
319
|
+
* catalog will be returned that is still usable.
|
|
320
|
+
*
|
|
321
|
+
* @param locale - an optional locale identifier, defaults to Textdomain.locale
|
|
322
|
+
*
|
|
323
|
+
* @returns a promise for a Catalog that will always resolve.
|
|
324
|
+
*/
|
|
41
325
|
resolve(locale?: string): Promise<Catalog>;
|
|
42
326
|
private resolve1;
|
|
327
|
+
/**
|
|
328
|
+
* Get the catalog format in use.
|
|
329
|
+
*
|
|
330
|
+
* @returns one of 'mo.json' or 'mo' (default is 'mo.json')
|
|
331
|
+
*/
|
|
43
332
|
get catalogFormat(): string;
|
|
333
|
+
/**
|
|
334
|
+
* Set the catalog format to use.
|
|
335
|
+
*
|
|
336
|
+
* @param format - one of 'mo.json' or 'mo'
|
|
337
|
+
*/
|
|
44
338
|
set catalogFormat(format: string);
|
|
339
|
+
/**
|
|
340
|
+
* Queries the user's preferred locales. On the server it queries the
|
|
341
|
+
* environment variables `LANGUAGE`, `LC_ALL`, `LANG`, and `LC_MESSAGES`
|
|
342
|
+
* (in that order). In the browser, it parses it checks the user preferences
|
|
343
|
+
* in the variables `navigator.languages`, `navigator.language`,
|
|
344
|
+
* `navigator.userLanguage`, `navigator.browserLanguage`, and
|
|
345
|
+
* `navigator.systemLanguage`.
|
|
346
|
+
*
|
|
347
|
+
* @returns the set of locales in order of preference
|
|
348
|
+
*
|
|
349
|
+
* Added in \@runtime 0.1.0.
|
|
350
|
+
*/
|
|
45
351
|
static userLocales(): Array<string>;
|
|
352
|
+
/**
|
|
353
|
+
* Select one of the supported locales from a list of locales accepted by
|
|
354
|
+
* the user.
|
|
355
|
+
*
|
|
356
|
+
* @param supported - the list of locales supported by the application
|
|
357
|
+
* @param requested - the list of locales accepted by the user
|
|
358
|
+
*
|
|
359
|
+
* If called with just one argument, then the list of requested locales
|
|
360
|
+
* is determined by calling [[Textdomain.userLocales]].
|
|
361
|
+
*
|
|
362
|
+
* @returns the negotiated locale or 'C' if not possible.
|
|
363
|
+
*/
|
|
46
364
|
static selectLocale(supported: Array<string>, requested?: Array<string>): string;
|
|
365
|
+
/**
|
|
366
|
+
* A no-op method for string marking.
|
|
367
|
+
*
|
|
368
|
+
* Sometimes you want to mark strings for translation but do not actually
|
|
369
|
+
* want to translate them, at least not at the time of their definition.
|
|
370
|
+
* This is often the case, when you have to preserve the original string.
|
|
371
|
+
*
|
|
372
|
+
* Take this example:
|
|
373
|
+
*
|
|
374
|
+
* ```
|
|
375
|
+
* orangeColors = [gtx.N_('coral'), gtx.N_('tomato'), gtx.N_('orangered'),
|
|
376
|
+
* gtx.N_('gold'), gtx.N_('orange'), gtx.N_('darkorange')]
|
|
377
|
+
* ```
|
|
378
|
+
*
|
|
379
|
+
* These are standard CSS colors, and you cannot translate them inside
|
|
380
|
+
* CSS styles. But for presentation you may want to translate them later:
|
|
381
|
+
*
|
|
382
|
+
* ```
|
|
383
|
+
* console.log(gtx._x("The css color '{color}' is {translated}.",
|
|
384
|
+
* {
|
|
385
|
+
* color: orangeColors[2],
|
|
386
|
+
* translated: gtx._(orangeColors[2]),
|
|
387
|
+
* }
|
|
388
|
+
* )
|
|
389
|
+
* );
|
|
390
|
+
* ```
|
|
391
|
+
*
|
|
392
|
+
* In other words: The method just marks strings for translation, so that
|
|
393
|
+
* the extractor `esgettext-xgettext` finds them but it does not actually
|
|
394
|
+
* translate anything.
|
|
395
|
+
*
|
|
396
|
+
* Similar methods are available for other cases (with placeholder
|
|
397
|
+
* expansion, context, or both). They are *not* available for plural
|
|
398
|
+
* methods because that would not make sense.
|
|
399
|
+
*
|
|
400
|
+
* Note that all of these methods are also available as instance methods.
|
|
401
|
+
*
|
|
402
|
+
* @param msgid - the message id
|
|
403
|
+
* @returns the original string
|
|
404
|
+
*/
|
|
47
405
|
static N_(msgid: string): string;
|
|
406
|
+
/**
|
|
407
|
+
* Does the same as the static method `N_()`.
|
|
408
|
+
*
|
|
409
|
+
* @param msgid - the message id
|
|
410
|
+
* @returns the original string
|
|
411
|
+
*/
|
|
48
412
|
N_(msgid: string): string;
|
|
413
|
+
/**
|
|
414
|
+
* Same as `N_()` but with placeholder expansion.
|
|
415
|
+
*
|
|
416
|
+
* @param msgid - the message id
|
|
417
|
+
* @param placeholders - a dictionary of placeholders
|
|
418
|
+
* @returns the original string with placeholders expanded
|
|
419
|
+
*/
|
|
49
420
|
N_x(msgid: string, placeholders?: Placeholders): string;
|
|
421
|
+
/**
|
|
422
|
+
* Does the same as the static method `N_x()`.
|
|
423
|
+
*
|
|
424
|
+
* @param msgid - the message id
|
|
425
|
+
* @param placeholders - a dictionary of placeholders
|
|
426
|
+
* @returns the original string with placeholders expanded
|
|
427
|
+
*/
|
|
50
428
|
static N_x(msgid: string, placeholders?: Placeholders): string;
|
|
429
|
+
/**
|
|
430
|
+
* Same as `N_()` but with context.
|
|
431
|
+
*
|
|
432
|
+
* @param _msgctxt - the message context (not used)
|
|
433
|
+
* @param msgid - the message id
|
|
434
|
+
* @returns the original string
|
|
435
|
+
*/
|
|
51
436
|
N_p(_msgctxt: string, msgid: string): string;
|
|
437
|
+
/**
|
|
438
|
+
* Does the same as the static method `N_p()`.
|
|
439
|
+
*
|
|
440
|
+
* @param _msgctxt - the message context (not used)
|
|
441
|
+
* @param msgid - the message id
|
|
442
|
+
* @returns the original string with placeholders expanded
|
|
443
|
+
*/
|
|
52
444
|
static N_p(_msgctxt: string, msgid: string): string;
|
|
445
|
+
/**
|
|
446
|
+
* Same as `N_()` but with context and placeholder expansion.
|
|
447
|
+
*
|
|
448
|
+
* @param _msgctxt - the message context (not used)
|
|
449
|
+
* @param msgid - the message id
|
|
450
|
+
* @param placeholders - a dictionary of placeholders
|
|
451
|
+
* @returns the original string with placeholders expanded
|
|
452
|
+
*/
|
|
53
453
|
N_px(_msgctxt: string, msgid: string, placeholders?: Placeholders): string;
|
|
454
|
+
/**
|
|
455
|
+
* Does the same as the static method `N_px()`.
|
|
456
|
+
*
|
|
457
|
+
* @param _msgctxt - the message context (not used)
|
|
458
|
+
* @param msgid - the message id
|
|
459
|
+
* @param placeholders - a dictionary of placeholders
|
|
460
|
+
* @returns the original string with placeholders expanded
|
|
461
|
+
*/
|
|
54
462
|
static N_px(_msgctxt: string, msgid: string, placeholders?: Placeholders): string;
|
|
55
463
|
}
|
|
56
464
|
//# sourceMappingURL=textdomain.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textdomain.d.ts","sourceRoot":"","sources":["../../src/core/textdomain.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"textdomain.d.ts","sourceRoot":"","sources":["../../src/core/textdomain.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;GAqB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