Skip to content

Commit

Permalink
Transferring Sing-Box error messages to the Lang file
Browse files Browse the repository at this point in the history
انتقال متن خطاهای مربوط به سینگ‌باکس به فایل زبان
  • Loading branch information
ircfspace committed Sep 6, 2024
1 parent b45b24c commit 560a9fb
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 11 deletions.
4 changes: 3 additions & 1 deletion src/localization/cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,9 @@ const chinese: Language = {
error_wp_not_found: 'warp-plus 文件不在应用程序包旁边。',
error_wp_stopped: 'warp-plus 文件在运行时遇到了问题!',
error_connection_failed: '无法连接到1.1.1.1。',
error_country_failed: '无法连接到所选国家.'
error_country_failed: '无法连接到所选国家.',
error_singbox_failed_stop: '停止 Sing-Box 失败!',
error_singbox_failed_start: '启动 Sing-Box 失败!'
},
about: {
title: '关于应用',
Expand Down
4 changes: 3 additions & 1 deletion src/localization/de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ const deutsch: Language = {
error_wp_not_found: 'Die Datei warp-plus befindet sich nicht neben dem Anwendungspaket.',
error_wp_stopped: 'Die Datei warp-plus hat ein Problem beim Ausführen!',
error_connection_failed: 'Verbindung zu 1.1.1.1 war nicht möglich.',
error_country_failed: 'Verbindung zum ausgewählten Land nicht möglich.'
error_country_failed: 'Verbindung zum ausgewählten Land nicht möglich.',
error_singbox_failed_stop: 'Sing-Box konnte nicht gestoppt werden!',
error_singbox_failed_start: 'Sing-Box konnte nicht gestartet werden!'
},
about: {
title: 'Über',
Expand Down
4 changes: 3 additions & 1 deletion src/localization/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ const english: Language = {
error_wp_not_found: 'The warp-plus file is not located alongside the application package!',
error_wp_stopped: 'The warp-plus file has encountered an issue running!',
error_connection_failed: 'Connection to 1.1.1.1 was not possible.',
error_country_failed: 'Cannot connect to the selected country.'
error_country_failed: 'Cannot connect to the selected country.',
error_singbox_failed_stop: 'Failed to stop Sing-Box!',
error_singbox_failed_start: 'Failed to start Sing-Box!'
},
about: {
title: 'About App',
Expand Down
4 changes: 3 additions & 1 deletion src/localization/fa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ const persian: Language = {
error_wp_not_found: `فایل warp-plus در کنار بسته برنامه وجود ندارد!`,
error_wp_stopped: `فایل warp-plus برای اجرا با مشکل مواجه است!`,
error_connection_failed: 'اتصال به 1.1.1.1 امکان‌پذیر نبود.',
error_country_failed: 'امکان اتصال به کشور انتخابی وجود ندارد.'
error_country_failed: 'امکان اتصال به کشور انتخابی وجود ندارد.',
error_singbox_failed_stop: 'متوقف‌کردن سینگ‌باکس با خطا مواجه شد!',
error_singbox_failed_start: 'فعال‌کردن سینگ‌باکس با خطا مواجه شد!'
},
about: {
title: 'درباره برنامه',
Expand Down
4 changes: 3 additions & 1 deletion src/localization/id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,9 @@ const indonesia: Language = {
error_wp_not_found: 'File warp-plus tidak terletak di samping paket aplikasi!',
error_wp_stopped: 'File warp-plus mengalami masalah saat dijalankan!',
error_connection_failed: 'Koneksi ke 1.1.1.1 tidak berhasil.',
error_country_failed: 'Tidak dapat terhubung ke negara yang dipilih.'
error_country_failed: 'Tidak dapat terhubung ke negara yang dipilih.',
error_singbox_failed_stop: 'Gagal menghentikan Sing-Box!',
error_singbox_failed_start: 'Gagal memulai Sing-Box!'
},
about: {
title: 'Tentang Aplikasi',
Expand Down
4 changes: 3 additions & 1 deletion src/localization/ru.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,9 @@ const russian: Language = {
error_wp_not_found: 'Файл warp-plus не находится рядом с пакетом приложения.',
error_wp_stopped: 'Файл warp-plus столкнулся с проблемой при запуске!',
error_connection_failed: 'Подключение к 1.1.1.1 невозможно.',
error_country_failed: 'Невозможно подключиться к выбранной стране.'
error_country_failed: 'Невозможно подключиться к выбранной стране.',
error_singbox_failed_stop: 'Не удалось остановить Sing-Box!',
error_singbox_failed_start: 'Не удалось запустить Sing-Box!'
},
about: {
title: 'О приложении',
Expand Down
4 changes: 3 additions & 1 deletion src/localization/tr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ const turkish: Language = {
error_wp_not_found: 'Warp-plus dosyası uygulama paketiyle birlikte yer almıyor!',
error_wp_stopped: 'warp-plus dosyası çalışırken bir sorunla karşılaştı!',
error_connection_failed: '1.1.1.1 ile bağlantı sağlanamadı.',
error_country_failed: 'Seçilen ülkeye bağlanılamıyor.'
error_country_failed: 'Seçilen ülkeye bağlanılamıyor.',
error_singbox_failed_stop: 'Sing-Box durdurulamadı!',
error_singbox_failed_start: 'Sing-Box başlatılamadı!'
},
about: {
title: 'Uygulama Hakkında',
Expand Down
2 changes: 2 additions & 0 deletions src/localization/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ export interface Log {
error_wp_not_found: string;
error_wp_stopped: string;
error_connection_failed: string;
error_singbox_failed_stop: string;
error_singbox_failed_start: string;
}

export interface About {
Expand Down
8 changes: 4 additions & 4 deletions src/main/ipcListeners/wp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ ipcMain.on('wp-start', async (event) => {
if (proxyMode === 'tun' && isSingBoxRunning) {
isSingBoxRunning = !(await singBoxManager.stopSingBox());
if (isSingBoxRunning) {
event.reply('guide-toast', 'Failed to stop Sing-Box');
event.reply('guide-toast', appLang.log.error_singbox_failed_stop);
} else {
disconnectedFlags[0] = true;
sendDisconnectedSignalToRenderer();
Expand Down Expand Up @@ -189,7 +189,7 @@ ipcMain.on('wp-start', async (event) => {
connectedFlags[1] = true;
sendConnectedSignalToRenderer();
} else {
event.reply('guide-toast', 'Failed to start Sing-Box');
event.reply('guide-toast', appLang.log.error_singbox_failed_start);
event.reply('wp-end', true);
if (typeof child?.pid !== 'undefined') {
treeKill(child.pid, 'SIGKILL');
Expand Down Expand Up @@ -241,7 +241,7 @@ ipcMain.on('wp-end', async (event) => {
if (proxyMode === 'tun' && isSingBoxRunning) {
isSingBoxRunning = !(await singBoxManager.stopSingBox());
if (isSingBoxRunning) {
event.reply('guide-toast', 'Failed to stop Sing-Box');
event.reply('guide-toast', appLang.log.error_singbox_failed_stop);
event.reply('wp-end', false);
event.reply('wp-start', true);
} else {
Expand All @@ -266,7 +266,7 @@ ipcMain.on('end-wp-and-exit-app', async (event) => {
if (proxyMode === 'tune' && isSingBoxRunning) {
isSingBoxRunning = !(await singBoxManager.stopSingBox());
if (isSingBoxRunning) {
event.reply('guide-toast', 'Failed to stop Sing-Box');
event.reply('guide-toast', appLang.log.error_singbox_failed_stop);
event.reply('wp-end', false);
event.reply('wp-start', true);
} else {
Expand Down

0 comments on commit 560a9fb

Please sign in to comment.