diff options
Diffstat (limited to 'src/i18n.tsx')
-rw-r--r-- | src/i18n.tsx | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/src/i18n.tsx b/src/i18n.tsx index a8b842d9c..443d3997a 100644 --- a/src/i18n.tsx +++ b/src/i18n.tsx @@ -105,7 +105,7 @@ function getPluralValue (values: any) { /** - * Store information about the result of the last to i18n() or i18n.parts() + * Store information about the result of the last to i18n(). * * @param i18nString the string template as found in i18n.strings * @param pluralValue value returned by getPluralValue() @@ -147,42 +147,6 @@ i18n.strings = {}; /** - * Interpolate i18nized values with arbitrary objects. - * @return Array of strings/objects. - */ -i18n.parts = function(strings: string[], ...values: any[]) { - init(); - if ("object" !== typeof jed) { - // Fallback implementation in case i18n lib is not there - let parts: string[] = []; - - for (let i = 0; i < strings.length; i++) { - parts.push(strings[i]); - if (i < values.length) { - parts.push(values[i]); - } - } - return parts; - } - - let str = toI18nString(strings); - let n = getPluralValue(values); - let tr = jed.ngettext(str, str, n).split(/%(\d+)\$s/); - let parts: string[] = []; - for (let i = 0; i < tr.length; i++) { - if (0 == i % 2) { - parts.push(tr[i]); - } else { - parts.push(values[parseInt(tr[i]) - 1]); - } - } - - setI18nResult(str, n); - return parts; -}; - - -/** * Pluralize based on first numeric parameter in the template. * @todo The plural argument is used for extraction by pogen.js */ |