refactor
This commit is contained in:
parent
306622b9a0
commit
77769983d5
@ -24,11 +24,13 @@ export class PoCompiler implements CompilerInterface {
|
|||||||
translations: {
|
translations: {
|
||||||
[this.domain]: Object.keys(collection.values).reduce(
|
[this.domain]: Object.keys(collection.values).reduce(
|
||||||
(translations, key) => {
|
(translations, key) => {
|
||||||
translations[key] = {
|
return {
|
||||||
|
...translations,
|
||||||
|
[key]: {
|
||||||
msgid: key,
|
msgid: key,
|
||||||
msgstr: collection.get(key)
|
msgstr: collection.get(key)
|
||||||
|
}
|
||||||
};
|
};
|
||||||
return translations;
|
|
||||||
},
|
},
|
||||||
{} as any
|
{} as any
|
||||||
)
|
)
|
||||||
@ -50,8 +52,10 @@ export class PoCompiler implements CompilerInterface {
|
|||||||
.filter(key => key.length > 0)
|
.filter(key => key.length > 0)
|
||||||
.reduce(
|
.reduce(
|
||||||
(result, key) => {
|
(result, key) => {
|
||||||
result[key] = po.translations[this.domain][key].msgstr.pop();
|
return {
|
||||||
return result;
|
...result,
|
||||||
|
[key]: po.translations[this.domain][key].msgstr.pop()
|
||||||
|
};
|
||||||
},
|
},
|
||||||
{} as TranslationType
|
{} as TranslationType
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user