mirror of
https://github.com/jamiepine/voicebox.git
synced 2026-09-19 06:40:38 -07:00
feat: french translation (#802)
* Add French (fr) language support - Create app/src/i18n/locales/fr/translation.json with full UI translations - Register French in SUPPORTED_LANGUAGES and i18next resources - Wire French locale from date-fns for relative date formatting * Fix Vite file watcher EBUSY error on Windows by excluding Rust target directory
This commit is contained in:
@@ -6,6 +6,7 @@ import ja from './locales/ja/translation.json';
|
|||||||
import ptBR from './locales/pt-BR/translation.json';
|
import ptBR from './locales/pt-BR/translation.json';
|
||||||
import zhCN from './locales/zh-CN/translation.json';
|
import zhCN from './locales/zh-CN/translation.json';
|
||||||
import zhTW from './locales/zh-TW/translation.json';
|
import zhTW from './locales/zh-TW/translation.json';
|
||||||
|
import fr from './locales/fr/translation.json';
|
||||||
|
|
||||||
export const SUPPORTED_LANGUAGES = [
|
export const SUPPORTED_LANGUAGES = [
|
||||||
{ code: 'en', label: 'English' },
|
{ code: 'en', label: 'English' },
|
||||||
@@ -13,6 +14,7 @@ export const SUPPORTED_LANGUAGES = [
|
|||||||
{ code: 'ja', label: '日本語' },
|
{ code: 'ja', label: '日本語' },
|
||||||
{ code: 'zh-CN', label: '简体中文' },
|
{ code: 'zh-CN', label: '简体中文' },
|
||||||
{ code: 'zh-TW', label: '繁體中文' },
|
{ code: 'zh-TW', label: '繁體中文' },
|
||||||
|
{ code: 'fr', label: 'Français' },
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export type LanguageCode = (typeof SUPPORTED_LANGUAGES)[number]['code'];
|
export type LanguageCode = (typeof SUPPORTED_LANGUAGES)[number]['code'];
|
||||||
@@ -27,6 +29,7 @@ i18n
|
|||||||
ja: { translation: ja },
|
ja: { translation: ja },
|
||||||
'zh-CN': { translation: zhCN },
|
'zh-CN': { translation: zhCN },
|
||||||
'zh-TW': { translation: zhTW },
|
'zh-TW': { translation: zhTW },
|
||||||
|
fr: { translation: fr },
|
||||||
},
|
},
|
||||||
fallbackLng: 'en',
|
fallbackLng: 'en',
|
||||||
supportedLngs: SUPPORTED_LANGUAGES.map((l) => l.code),
|
supportedLngs: SUPPORTED_LANGUAGES.map((l) => l.code),
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
|||||||
import { formatDistance } from 'date-fns';
|
import { formatDistance } from 'date-fns';
|
||||||
import { ja, zhCN, zhTW } from 'date-fns/locale';
|
import { ja, zhCN, zhTW, fr } from 'date-fns/locale';
|
||||||
import i18n from '@/i18n';
|
import i18n from '@/i18n';
|
||||||
|
|
||||||
export function formatDuration(seconds: number): string {
|
export function formatDuration(seconds: number): string {
|
||||||
@@ -16,6 +16,8 @@ function getDateLocale() {
|
|||||||
return zhCN;
|
return zhCN;
|
||||||
case 'zh-TW':
|
case 'zh-TW':
|
||||||
return zhTW;
|
return zhTW;
|
||||||
|
case 'fr':
|
||||||
|
return fr;
|
||||||
default:
|
default:
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ export default defineConfig({
|
|||||||
strictPort: true,
|
strictPort: true,
|
||||||
// Watch files in the app directory for changes
|
// Watch files in the app directory for changes
|
||||||
watch: {
|
watch: {
|
||||||
ignored: ['!**/../app/**'],
|
ignored: ['!**/../app/**', '**/target/**'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
envPrefix: ['VITE_', 'TAURI_'],
|
envPrefix: ['VITE_', 'TAURI_'],
|
||||||
|
|||||||
Reference in New Issue
Block a user