Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Use with **Qwen Code:**
- **Cross-platform** - Desktop app and web interface
- **File @-mentions** - Reference files directly in conversations
- **MCP server integration** - Model Context Protocol support
- **Multi-language UI** - English, Chinese (Simplified & Traditional)
- **Multi-language UI** - English, Chinese (Simplified & Traditional), Russian

## Development & Building

Expand Down
1 change: 0 additions & 1 deletion crates/backend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@ impl<E: EventEmitter + 'static> GeminiBackend<E> {
let output = {
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x08000000;
Command::new("cmd.exe")
.args(["/C", &command])
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/common/SettingsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ export const SettingsDialog: React.FC<SettingsDialogProps> = ({
<SelectItem value="en">English</SelectItem>
<SelectItem value="zh-CN">简体中文</SelectItem>
<SelectItem value="zh-TW">繁體中文</SelectItem>
<SelectItem value="ru">Русский</SelectItem>
</SelectContent>
</Select>
</div>
Expand Down
7 changes: 6 additions & 1 deletion frontend/src/i18n/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ import LanguageDetector from "i18next-browser-languagedetector";
import en from "./locales/en/translation.json";
import zhCN from "./locales/zh-CN/translation.json";
import zhTW from "./locales/zh-TW/translation.json";
import ru from "./locales/ru/translation.json";

// Define supported languages
export const supportedLanguages = ["en", "zh-CN", "zh-TW"] as const;
export const supportedLanguages = ["en", "zh-CN", "zh-TW", "ru"] as const;
export type SupportedLanguage = (typeof supportedLanguages)[number];

// Language names for display
export const languageNames: Record<SupportedLanguage, string> = {
en: "English",
"zh-CN": "简体中文",
"zh-TW": "繁體中文",
ru: "Русский",
};

// Translation resources
Expand All @@ -29,6 +31,9 @@ const resources = {
"zh-TW": {
translation: zhTW,
},
ru: {
translation: ru,
},
};

// Initialize i18next
Expand Down
9 changes: 5 additions & 4 deletions frontend/src/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,21 @@ export {
// Re-export commonly used react-i18next functions for convenience
export { useTranslation, Trans, Translation } from "react-i18next";

// Import the type for use in function definitions
import type { SupportedLanguage } from "./config";
// Import the type and constant for use in function definitions
import { supportedLanguages, type SupportedLanguage } from "./config";

// Export language detection utility
export const isValidLanguage = (lang: string): lang is SupportedLanguage => {
return ["en", "zh-CN", "zh-TW"].includes(lang);
return supportedLanguages.includes(lang as SupportedLanguage);
};

// Export language display utility
export const getLanguageDisplayName = (lang: SupportedLanguage): string => {
const names = {
const names: Record<SupportedLanguage, string> = {
en: "English",
"zh-CN": "简体中文",
"zh-TW": "繁體中文",
ru: "Русский",
};
return names[lang];
};
Loading