The AsideItem type supports two i18n strategies:
- Global i18n object: The entire data set is wrapped in an
i18n object where keys are language codes (e.g., root, en) and values are arrays of items. - Per-item i18n: Each item contains its own
i18n property to override specific fields (like promo or name) for different languages.
import type { AsideItem } from '@theojs/lumen'
// Strategy 1: Global i18n structure
export const Global_i18n_Data: AsideItem = {
i18n: {
root: [{ promo: '活动标题', link: 'https://example.com/' }],
en: [{ promo: 'Promotion Title', link: 'https://example.com/' }]
}
}
// Strategy 2: Per-item i18n structure
export const Item_i18n_Data: AsideItem = [
{
promo: '活动标题',
link: 'https://example.com/',
i18n: {
en: { promo: 'Promotion title' }
}
},
{
name: '普通链接',
link: 'https://example.com/',
i18n: {
en: { name: 'Link' }
}
}
]