mirror of
https://github.com/johannesjo/super-productivity.git
synced 2026-01-23 02:36:05 +00:00
fix(i18n): string generation not working correctly #33
This commit is contained in:
parent
46ae8fcd73
commit
bb38b3b157
2 changed files with 29 additions and 29 deletions
|
|
@ -5,19 +5,19 @@ console.log(path);
|
|||
const _tr = fs.readFileSync(path);
|
||||
const tr = JSON.parse(_tr);
|
||||
|
||||
const parse = (o) => {
|
||||
const parse = (o, pref = '') => {
|
||||
return Object.keys(o).reduce((acc, key) => {
|
||||
console.log(key);
|
||||
|
||||
if (typeof o[key] === 'object') {
|
||||
return {
|
||||
...acc,
|
||||
[key]: parse(o[key]),
|
||||
[key]: parse(o[key], key + '.'),
|
||||
};
|
||||
} else if (typeof o[key] === 'string') {
|
||||
return {
|
||||
...acc,
|
||||
[key]: key,
|
||||
[key]: pref + key,
|
||||
};
|
||||
} else {
|
||||
throw 'Invalid Data';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue