|
1 | 1 | export namespace i18n {
|
2 |
| - interface ConfigurationOptions { |
3 |
| - /** |
4 |
| - * Setup some locales - other locales default to en silently |
5 |
| - * @default [] |
6 |
| - */ |
7 |
| - locales?: string[]; |
8 |
| - |
9 |
| - /** |
10 |
| - * Language fallback map |
11 |
| - * @default {} |
12 |
| - */ |
13 |
| - fallbacks?: { |
14 |
| - [locale: string]: string; |
15 |
| - }; |
16 |
| - |
17 |
| - /** |
18 |
| - * Alter a site wide default locale |
19 |
| - * @default "en" |
20 |
| - */ |
21 |
| - defaultLocale?: string; |
22 |
| - |
23 |
| - /** |
24 |
| - * Sets a custom cookie name to parse locale settings from |
25 |
| - * @default null |
26 |
| - */ |
27 |
| - cookie?: string; |
28 |
| - |
29 |
| - /** |
30 |
| - * Query parameter to switch locale (ie. /home?lang=ch) |
31 |
| - * @default null |
32 |
| - */ |
33 |
| - queryParameter?: string; |
34 |
| - |
35 |
| - /** |
36 |
| - * Where to store json files, relative to modules directory |
37 |
| - * @default "./locales" |
38 |
| - */ |
39 |
| - directory?: string; |
40 |
| - |
41 |
| - /** |
42 |
| - * Control mode on directory creation. Setting has no effect on win. |
43 |
| - * @default null |
44 |
| - */ |
45 |
| - directoryPermissions?: string; |
46 |
| - |
47 |
| - /** |
48 |
| - * Watch for changes in json files to reload locale on updates |
49 |
| - * @default false |
50 |
| - */ |
51 |
| - autoReload?: boolean; |
52 |
| - |
53 |
| - /** |
54 |
| - * Whether to write new locale information to disk |
55 |
| - * @default true |
56 |
| - */ |
57 |
| - updateFiles?: boolean; |
58 |
| - |
59 |
| - /** |
60 |
| - * Sync locale information across all files |
61 |
| - * @default false |
62 |
| - */ |
63 |
| - syncFiles?: boolean; |
64 |
| - |
65 |
| - /** |
66 |
| - * What to use as the indentation unit |
67 |
| - * @default "\t" |
68 |
| - */ |
69 |
| - indent?: string; |
70 |
| - |
71 |
| - /** |
72 |
| - * Setting extension of json files (you might want to set this to '.js' according to webtranslateit) |
73 |
| - * @default ".json" |
74 |
| - */ |
75 |
| - extension?: string; |
76 |
| - |
77 |
| - /** |
78 |
| - * Setting prefix of json files name (in case you use different locale files naming scheme (webapp-en.json), rather then just en.json) |
79 |
| - * @default "" |
80 |
| - */ |
81 |
| - prefix?: string; |
82 |
| - |
83 |
| - /** |
84 |
| - * Enable object notation |
85 |
| - * @default false |
86 |
| - */ |
87 |
| - objectNotation?: boolean; |
88 |
| - |
89 |
| - /** |
90 |
| - * Setting of log level DEBUG |
91 |
| - * @default require("debug")("i18n:debug") |
92 |
| - */ |
93 |
| - logDebugFn?: (msg: string) => void; |
94 |
| - |
95 |
| - /** |
96 |
| - * Setting of log level WARN |
97 |
| - * @default require("debug")("i18n:warn") |
98 |
| - */ |
99 |
| - logWarnFn?: (msg: string) => void; |
100 |
| - |
101 |
| - /** |
102 |
| - * Setting of log level ERROR |
103 |
| - * @default require("debug")("i18n:error") |
104 |
| - */ |
105 |
| - logErrorFn?: (msg: string) => void; |
106 |
| - |
107 |
| - /** |
108 |
| - * object or [obj1, obj2] to bind the i18n api and current locale to |
109 |
| - * @default null |
110 |
| - */ |
111 |
| - register?: any; |
112 |
| - |
113 |
| - /** |
114 |
| - * Hash to specify different aliases for i18n's internal methods to apply on the request/response objects (method -> alias). |
115 |
| - * Note that this will *not* overwrite existing properties with the same name. |
116 |
| - * @default undefined |
117 |
| - */ |
118 |
| - api?: { |
119 |
| - [method: string]: string; |
120 |
| - }; |
121 |
| - |
122 |
| - /** |
123 |
| - * Downcase locale when passed on queryParam; e.g. lang=en-US becomes en-us. |
124 |
| - * When set to false, the queryParam value will be used as passed; e.g. lang=en-US remains en-US. |
125 |
| - * @default true |
126 |
| - */ |
127 |
| - preserveLegacyCase?: boolean; |
128 |
| - } |
| 2 | + interface ConfigurationOptions { |
| 3 | + /** |
| 4 | + * Setup some locales - other locales default to en silently |
| 5 | + * @default [] |
| 6 | + */ |
| 7 | + locales?: string[]; |
| 8 | + |
| 9 | + /** |
| 10 | + * Language fallback map |
| 11 | + * @default {} |
| 12 | + */ |
| 13 | + fallbacks?: { |
| 14 | + [locale: string]: string; |
| 15 | + }; |
| 16 | + |
| 17 | + /** |
| 18 | + * Alter a site wide default locale |
| 19 | + * @default "en" |
| 20 | + */ |
| 21 | + defaultLocale?: string; |
| 22 | + |
| 23 | + /** |
| 24 | + * Sets a custom cookie name to parse locale settings from |
| 25 | + * @default null |
| 26 | + */ |
| 27 | + cookie?: string; |
| 28 | + |
| 29 | + /** |
| 30 | + * Query parameter to switch locale (ie. /home?lang=ch) |
| 31 | + * @default null |
| 32 | + */ |
| 33 | + queryParameter?: string; |
| 34 | + |
| 35 | + /** |
| 36 | + * Where to store json files, relative to modules directory |
| 37 | + * @default "./locales" |
| 38 | + */ |
| 39 | + directory?: string; |
| 40 | + |
| 41 | + /** |
| 42 | + * Control mode on directory creation. Setting has no effect on win. |
| 43 | + * @default null |
| 44 | + */ |
| 45 | + directoryPermissions?: string; |
| 46 | + |
| 47 | + /** |
| 48 | + * Watch for changes in json files to reload locale on updates |
| 49 | + * @default false |
| 50 | + */ |
| 51 | + autoReload?: boolean; |
| 52 | + |
| 53 | + /** |
| 54 | + * Whether to write new locale information to disk |
| 55 | + * @default true |
| 56 | + */ |
| 57 | + updateFiles?: boolean; |
| 58 | + |
| 59 | + /** |
| 60 | + * Sync locale information across all files |
| 61 | + * @default false |
| 62 | + */ |
| 63 | + syncFiles?: boolean; |
| 64 | + |
| 65 | + /** |
| 66 | + * What to use as the indentation unit |
| 67 | + * @default "\t" |
| 68 | + */ |
| 69 | + indent?: string; |
| 70 | + |
| 71 | + /** |
| 72 | + * Setting extension of json files (you might want to set this to '.js' according to webtranslateit) |
| 73 | + * @default ".json" |
| 74 | + */ |
| 75 | + extension?: string; |
| 76 | + |
| 77 | + /** |
| 78 | + * Setting prefix of json files name (in case you use different locale files naming scheme (webapp-en.json), rather then just en.json) |
| 79 | + * @default "" |
| 80 | + */ |
| 81 | + prefix?: string; |
| 82 | + |
| 83 | + /** |
| 84 | + * Enable object notation |
| 85 | + * @default false |
| 86 | + */ |
| 87 | + objectNotation?: boolean; |
| 88 | + |
| 89 | + /** |
| 90 | + * Setting of log level DEBUG |
| 91 | + * @default require("debug")("i18n:debug") |
| 92 | + */ |
| 93 | + logDebugFn?: (msg: string) => void; |
| 94 | + |
| 95 | + /** |
| 96 | + * Setting of log level WARN |
| 97 | + * @default require("debug")("i18n:warn") |
| 98 | + */ |
| 99 | + logWarnFn?: (msg: string) => void; |
| 100 | + |
| 101 | + /** |
| 102 | + * Setting of log level ERROR |
| 103 | + * @default require("debug")("i18n:error") |
| 104 | + */ |
| 105 | + logErrorFn?: (msg: string) => void; |
| 106 | + |
| 107 | + /** |
| 108 | + * object or [obj1, obj2] to bind the i18n api and current locale to |
| 109 | + * @default null |
| 110 | + */ |
| 111 | + register?: any; |
| 112 | + |
| 113 | + /** |
| 114 | + * Hash to specify different aliases for i18n's internal methods to apply on the request/response objects (method -> alias). |
| 115 | + * Note that this will *not* overwrite existing properties with the same name. |
| 116 | + * @default undefined |
| 117 | + */ |
| 118 | + api?: { |
| 119 | + [method: string]: string; |
| 120 | + }; |
| 121 | + |
| 122 | + /** |
| 123 | + * Downcase locale when passed on queryParam; e.g. lang=en-US becomes en-us. |
| 124 | + * When set to false, the queryParam value will be used as passed; e.g. lang=en-US remains en-US. |
| 125 | + * @default true |
| 126 | + */ |
| 127 | + preserveLegacyCase?: boolean; |
| 128 | + } |
129 | 129 | }
|
0 commit comments