演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。 Co-authored-by: Cursor <cursoragent@cursor.com>
29 lines
861 B
TypeScript
29 lines
861 B
TypeScript
import { loadI18nResource } from '../load-resource'
|
|
|
|
describe('locale resource loading', () => {
|
|
it.each([
|
|
['en_US', 'Save'],
|
|
['zh_Hans', '保存'],
|
|
['ja_JP', '保存'],
|
|
['ZH-hans', '保存'],
|
|
['en--US', 'Save'],
|
|
['unsupported', 'Save'],
|
|
])('loads usable translations for %s', async (locale, expected) => {
|
|
const resource = await loadI18nResource(locale, 'common')
|
|
|
|
expect(resource.default).toMatchObject({ 'operation.save': expected })
|
|
})
|
|
|
|
it.each([
|
|
['en-US', 'Cancel'],
|
|
['zh_Hans', '取消'],
|
|
['ja_JP', 'Cancel'],
|
|
['fr-FR', 'Cancel'],
|
|
['az-AZ', 'Cancel'],
|
|
])('loads Contacts translations with a usable fallback for %s', async (locale, expected) => {
|
|
const resource = await loadI18nResource(locale, 'contacts')
|
|
|
|
expect(resource.default).toMatchObject({ 'action.cancel': expected })
|
|
})
|
|
})
|