feat: completed wodox locale; improved i18n logic
This commit is contained in:
parent
9d5e67136e
commit
00651b8e36
11 changed files with 213 additions and 125 deletions
1
apps/vdn-static/src/utils/deep-partial.ts
Normal file
1
apps/vdn-static/src/utils/deep-partial.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export type DeepPartial<T> = { [K in keyof T]?: DeepPartial<T[K]> };
|
||||
|
|
@ -5,7 +5,7 @@ export function localizeLayout<T>(
|
|||
layout: DeepReadonly<Layout<T>>,
|
||||
): T[keyof T][] {
|
||||
const sections: T[keyof T][] = [];
|
||||
for (const sectionId of layout.layout ?? []) {
|
||||
for (const sectionId of layout.order ?? []) {
|
||||
const section = (layout.data as T)[sectionId as keyof T];
|
||||
if (section) {
|
||||
sections.push(section);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue