Initial import: open-design source for helix-mind.ai distribution
Some checks failed
ci / Validate workspace (push) Successful in 12m32s
landing-page-ci / Validate landing page (push) Successful in 9m41s
landing-page-deploy / Deploy landing page (push) Failing after 5m23s
github-metrics / Generate repository metrics SVG (push) Failing after 2m6s
refresh-contributors-wall / Refresh contributors wall cache bust (push) Failing after 12s
Some checks failed
ci / Validate workspace (push) Successful in 12m32s
landing-page-ci / Validate landing page (push) Successful in 9m41s
landing-page-deploy / Deploy landing page (push) Failing after 5m23s
github-metrics / Generate repository metrics SVG (push) Failing after 2m6s
refresh-contributors-wall / Refresh contributors wall cache bust (push) Failing after 12s
This repository contains the open-design daemon CLI source code, built and packaged at https://helix-mind.ai/cli/open-design/latest.tgz for use by the HelixMind /design slash command. Licenses: Apache-2.0 (root) + MIT (skills/*)
This commit is contained in:
33
apps/web/tests/i18n/design-files-agent-copy.test.ts
Normal file
33
apps/web/tests/i18n/design-files-agent-copy.test.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { de } from '../../src/i18n/locales/de';
|
||||
import { en } from '../../src/i18n/locales/en';
|
||||
import { esES } from '../../src/i18n/locales/es-ES';
|
||||
import { fa } from '../../src/i18n/locales/fa';
|
||||
import { fr } from '../../src/i18n/locales/fr';
|
||||
import { ja } from '../../src/i18n/locales/ja';
|
||||
import { ptBR } from '../../src/i18n/locales/pt-BR';
|
||||
import { ru } from '../../src/i18n/locales/ru';
|
||||
import { zhCN } from '../../src/i18n/locales/zh-CN';
|
||||
import { zhTW } from '../../src/i18n/locales/zh-TW';
|
||||
|
||||
const LOCALE_DICTS = {
|
||||
de,
|
||||
en,
|
||||
esES,
|
||||
fa,
|
||||
fr,
|
||||
ja,
|
||||
ptBR,
|
||||
ru,
|
||||
zhCN,
|
||||
zhTW,
|
||||
};
|
||||
|
||||
describe('Design Files agent copy', () => {
|
||||
it('uses neutral agent wording in shared helper text', () => {
|
||||
for (const [locale, dict] of Object.entries(LOCALE_DICTS)) {
|
||||
expect(dict['designFiles.dropDesc'], locale).not.toMatch(/claude/i);
|
||||
}
|
||||
});
|
||||
});
|
||||
33
apps/web/tests/i18n/design-files-dropzone-copy.test.ts
Normal file
33
apps/web/tests/i18n/design-files-dropzone-copy.test.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
import { de } from '../../src/i18n/locales/de';
|
||||
import { en } from '../../src/i18n/locales/en';
|
||||
import { esES } from '../../src/i18n/locales/es-ES';
|
||||
import { fa } from '../../src/i18n/locales/fa';
|
||||
import { fr } from '../../src/i18n/locales/fr';
|
||||
import { ja } from '../../src/i18n/locales/ja';
|
||||
import { ptBR } from '../../src/i18n/locales/pt-BR';
|
||||
import { ru } from '../../src/i18n/locales/ru';
|
||||
import { zhCN } from '../../src/i18n/locales/zh-CN';
|
||||
import { zhTW } from '../../src/i18n/locales/zh-TW';
|
||||
|
||||
const LOCALE_DICTS = {
|
||||
de,
|
||||
en,
|
||||
esES,
|
||||
fa,
|
||||
fr,
|
||||
ja,
|
||||
ptBR,
|
||||
ru,
|
||||
zhCN,
|
||||
zhTW,
|
||||
};
|
||||
|
||||
describe('Design Files dropzone copy', () => {
|
||||
it('does not advertise unsupported Figma link drops', () => {
|
||||
for (const [locale, dict] of Object.entries(LOCALE_DICTS)) {
|
||||
expect(dict['designFiles.dropDesc'], locale).not.toMatch(/figma/i);
|
||||
}
|
||||
});
|
||||
});
|
||||
50
apps/web/tests/i18n/locales.test.ts
Normal file
50
apps/web/tests/i18n/locales.test.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { en } from '../../src/i18n/locales/en';
|
||||
import { LOCALES, LOCALE_LABEL, type Dict, type Locale } from '../../src/i18n/types';
|
||||
|
||||
const EXPECTED_LOCALES = ['en', 'de', 'zh-CN', 'zh-TW', 'pt-BR', 'es-ES', 'ru', 'fa', 'ar', 'ja', 'ko', 'pl', 'hu', 'fr', 'uk', 'tr'];
|
||||
|
||||
function placeholders(value: string): string[] {
|
||||
const names: string[] = [];
|
||||
for (const match of value.matchAll(/\{(\w+)\}/g)) {
|
||||
if (match[1]) {
|
||||
names.push(match[1]);
|
||||
}
|
||||
}
|
||||
return names.sort();
|
||||
}
|
||||
|
||||
async function loadDict(locale: Locale): Promise<Dict> {
|
||||
const module = await import(`../../src/i18n/locales/${locale}.ts`);
|
||||
const dict = Object.values(module).find((value): value is Dict => {
|
||||
return Boolean(value) && typeof value === 'object';
|
||||
});
|
||||
if (!dict) {
|
||||
throw new Error(`No dictionary export found for locale ${locale}`);
|
||||
}
|
||||
return dict;
|
||||
}
|
||||
|
||||
describe('i18n locales', () => {
|
||||
it('registers every supported locale in the language menu', () => {
|
||||
expect(LOCALES).toEqual(EXPECTED_LOCALES);
|
||||
expect((LOCALE_LABEL as Record<string, string>).de).toBe('Deutsch');
|
||||
expect((LOCALE_LABEL as Record<string, string>).ja).toBe('日本語');
|
||||
});
|
||||
|
||||
it('keeps locale dictionaries aligned with English keys and placeholders', async () => {
|
||||
const englishKeys = Object.keys(en).sort();
|
||||
|
||||
for (const locale of LOCALES) {
|
||||
const dict = await loadDict(locale);
|
||||
expect(Object.keys(dict).sort()).toEqual(englishKeys);
|
||||
|
||||
for (const key of englishKeys) {
|
||||
const dictKey = key as keyof Dict;
|
||||
expect(placeholders(dict[dictKey]), `${locale}.${key}`).toEqual(
|
||||
placeholders(en[dictKey]),
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user