feat(i18n): add Turkish (tr) translation (#1571)

This commit is contained in:
Samed Yüksel
2026-06-03 10:59:38 +02:00
committed by GitHub
parent 77655d8dfa
commit d736611ded
3 changed files with 6044 additions and 1 deletions
+14
View File
@@ -319,6 +319,19 @@ const ES_COGNATES = [
'Avery 5160 — US Letter sheet (25.4 × 66.7 mm × 30)',
];
// Turkish cognates — technical UI labels that Turkish speakers use verbatim
// from English (loanwords + acronyms + format strings). Curated, not a shortcut.
const TR_COGNATES = [
'Filament', 'Firmware', 'Disk', 'Hex', 'Test', 'Port', 'Model', 'Metal',
'Min', 'Normal', 'Platform', 'Net', 'Trend', 'Commit', 'Global', 'Proxy',
'N/A', 'email',
'STARTTLS (Port 587)', 'SSL/TLS (Port 465)',
'({{count}}/8)', 'Hex: #{{hex}}', 'MakerWorld: {{designer}}',
'{{count}} filament', '{{printer}}: {{error}}', '{{weight}}g',
'Filament {{index}} ({{type}})',
'EC984C,#6CD4BC,A66EB9,D87694',
];
const IDENTICAL_TO_EN_ALLOWED = {
de: new Set(DE_COGNATES),
fr: new Set(FR_COGNATES),
@@ -329,6 +342,7 @@ const IDENTICAL_TO_EN_ALLOWED = {
'pt-BR': new Set(PT_BR_COGNATES),
'zh-CN': new Set(ZH_CN_COGNATES),
'zh-TW': new Set(ZH_TW_COGNATES),
tr: new Set(TR_COGNATES),
};
// Pure comparison logic, exported so tests can verify each failure mode
+4 -1
View File
@@ -13,6 +13,7 @@ import ko from './locales/ko';
import ptBR from './locales/pt-BR';
import zhCN from './locales/zh-CN';
import zhTW from './locales/zh-TW';
import tr from './locales/tr';
const resources = {
en: { translation: en },
@@ -25,6 +26,7 @@ const resources = {
'pt-BR': { translation: ptBR },
'zh-CN': { translation: zhCN },
'zh-TW': { translation: zhTW },
tr: { translation: tr },
};
i18n
@@ -33,7 +35,7 @@ i18n
.init({
resources,
fallbackLng: 'en',
supportedLngs: ['en', 'de', 'es', 'fr', 'ja', 'it', 'ko', 'pt-BR', 'zh-CN', 'zh-TW'],
supportedLngs: ['en', 'de', 'es', 'fr', 'ja', 'it', 'ko', 'pt-BR', 'tr', 'zh-CN', 'zh-TW'],
detection: {
// Order of detection methods
@@ -67,4 +69,5 @@ export const availableLanguages = [
{ code: 'pt-BR', name: 'Portuguese (Brazil)', nativeName: 'Português (Brasil)' },
{ code: 'zh-CN', name: 'Chinese (Simplified)', nativeName: '简体中文' },
{ code: 'zh-TW', name: 'Chinese (Traditional)', nativeName: '繁體中文' },
{ code: 'tr', name: 'Turkish', nativeName: 'Türkçe' },
];
File diff suppressed because it is too large Load Diff