intor-translator 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -116,7 +116,7 @@ var loading = rura.rura.createHook(
|
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
118
|
const { loadingMessage } = config;
|
|
119
|
-
if (loadingMessage) {
|
|
119
|
+
if ("loadingMessage" in config) {
|
|
120
120
|
return { early: true, output: loadingMessage };
|
|
121
121
|
}
|
|
122
122
|
},
|
|
@@ -134,9 +134,9 @@ var missing = rura.rura.createHook(
|
|
|
134
134
|
output: missingHandler(makeHandlerContext(ctx))
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
|
-
const {
|
|
138
|
-
if (
|
|
139
|
-
return { early: true, output:
|
|
137
|
+
const { missingMessage } = config;
|
|
138
|
+
if ("missingMessage" in config) {
|
|
139
|
+
return { early: true, output: missingMessage };
|
|
140
140
|
}
|
|
141
141
|
return { early: true, output: key };
|
|
142
142
|
},
|
package/dist/index.d.cts
CHANGED
|
@@ -258,8 +258,8 @@ type TranslateConfig<M = unknown> = {
|
|
|
258
258
|
fallbackLocales?: FallbackLocalesMap<Locale<M>>;
|
|
259
259
|
/** Optional message to display while translations are still loading. */
|
|
260
260
|
loadingMessage?: string;
|
|
261
|
-
/** Optional
|
|
262
|
-
|
|
261
|
+
/** Optional message used when a translation is missing. */
|
|
262
|
+
missingMessage?: string;
|
|
263
263
|
/** Optional set of handler functions for customizing translation behavior. */
|
|
264
264
|
handlers?: TranslateHandlers;
|
|
265
265
|
};
|
|
@@ -496,4 +496,4 @@ interface Renderer<Output> {
|
|
|
496
496
|
*/
|
|
497
497
|
declare function renderRichMessage<Output>(message: string, renderer: Renderer<Output>): Output[];
|
|
498
498
|
|
|
499
|
-
export { type ASTNode, type DefaultDepth, type FallbackLocalesMap, type FormatHandler, type HandlerContext, type LeafKeys, type LoadingHandler, type Locale, type LocaleMessages, type LocalizedLeafKeys, type LocalizedMessagesUnion, type LocalizedNodeKeys, type MissingHandler, type NestedMessage, type NodeKeys, type Renderer, type Replacement, type ScopedLeafKeys, type TranslateConfig, type TranslateContext, type TranslateHandlers, type TranslateHook, ScopeTranslator as Translator, type ScopeTranslatorMethods as TranslatorMethods, type ScopeTranslatorOptions as TranslatorOptions, type TranslatorPlugin, parseRichMessage, renderRichMessage };
|
|
499
|
+
export { type ASTNode, type Attributes, type DefaultDepth, type FallbackLocalesMap, type FormatHandler, type HandlerContext, type LeafKeys, type LoadingHandler, type Locale, type LocaleMessages, type LocalizedLeafKeys, type LocalizedMessagesUnion, type LocalizedNodeKeys, type MissingHandler, type NestedMessage, type NodeKeys, type Renderer, type Replacement, type ScopedLeafKeys, type TranslateConfig, type TranslateContext, type TranslateHandlers, type TranslateHook, ScopeTranslator as Translator, type ScopeTranslatorMethods as TranslatorMethods, type ScopeTranslatorOptions as TranslatorOptions, type TranslatorPlugin, parseRichMessage, renderRichMessage };
|
package/dist/index.d.ts
CHANGED
|
@@ -258,8 +258,8 @@ type TranslateConfig<M = unknown> = {
|
|
|
258
258
|
fallbackLocales?: FallbackLocalesMap<Locale<M>>;
|
|
259
259
|
/** Optional message to display while translations are still loading. */
|
|
260
260
|
loadingMessage?: string;
|
|
261
|
-
/** Optional
|
|
262
|
-
|
|
261
|
+
/** Optional message used when a translation is missing. */
|
|
262
|
+
missingMessage?: string;
|
|
263
263
|
/** Optional set of handler functions for customizing translation behavior. */
|
|
264
264
|
handlers?: TranslateHandlers;
|
|
265
265
|
};
|
|
@@ -496,4 +496,4 @@ interface Renderer<Output> {
|
|
|
496
496
|
*/
|
|
497
497
|
declare function renderRichMessage<Output>(message: string, renderer: Renderer<Output>): Output[];
|
|
498
498
|
|
|
499
|
-
export { type ASTNode, type DefaultDepth, type FallbackLocalesMap, type FormatHandler, type HandlerContext, type LeafKeys, type LoadingHandler, type Locale, type LocaleMessages, type LocalizedLeafKeys, type LocalizedMessagesUnion, type LocalizedNodeKeys, type MissingHandler, type NestedMessage, type NodeKeys, type Renderer, type Replacement, type ScopedLeafKeys, type TranslateConfig, type TranslateContext, type TranslateHandlers, type TranslateHook, ScopeTranslator as Translator, type ScopeTranslatorMethods as TranslatorMethods, type ScopeTranslatorOptions as TranslatorOptions, type TranslatorPlugin, parseRichMessage, renderRichMessage };
|
|
499
|
+
export { type ASTNode, type Attributes, type DefaultDepth, type FallbackLocalesMap, type FormatHandler, type HandlerContext, type LeafKeys, type LoadingHandler, type Locale, type LocaleMessages, type LocalizedLeafKeys, type LocalizedMessagesUnion, type LocalizedNodeKeys, type MissingHandler, type NestedMessage, type NodeKeys, type Renderer, type Replacement, type ScopedLeafKeys, type TranslateConfig, type TranslateContext, type TranslateHandlers, type TranslateHook, ScopeTranslator as Translator, type ScopeTranslatorMethods as TranslatorMethods, type ScopeTranslatorOptions as TranslatorOptions, type TranslatorPlugin, parseRichMessage, renderRichMessage };
|
package/dist/index.js
CHANGED
|
@@ -114,7 +114,7 @@ var loading = rura.createHook(
|
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
116
|
const { loadingMessage } = config;
|
|
117
|
-
if (loadingMessage) {
|
|
117
|
+
if ("loadingMessage" in config) {
|
|
118
118
|
return { early: true, output: loadingMessage };
|
|
119
119
|
}
|
|
120
120
|
},
|
|
@@ -132,9 +132,9 @@ var missing = rura.createHook(
|
|
|
132
132
|
output: missingHandler(makeHandlerContext(ctx))
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
|
-
const {
|
|
136
|
-
if (
|
|
137
|
-
return { early: true, output:
|
|
135
|
+
const { missingMessage } = config;
|
|
136
|
+
if ("missingMessage" in config) {
|
|
137
|
+
return { early: true, output: missingMessage };
|
|
138
138
|
}
|
|
139
139
|
return { early: true, output: key };
|
|
140
140
|
},
|