Skip to content

Commit

Permalink
feat(i18n): updated locales
Browse files Browse the repository at this point in the history
  • Loading branch information
krypt0nn committed Jan 20, 2024
1 parent 46b8561 commit e83ce74
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 11 deletions.
7 changes: 7 additions & 0 deletions assets/locales/en/errors.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ game-get-settings-failed = Unable to get {$game-title} settings
game-get-addons-failed = Unable to get {$game-title} addons
game-get-paths-failed = Unable to get {$game-title} paths
game-get-integrity-failed = Unable to get {$game-title} integrity info
game-get-status-failed = Unable to get {$game-title} status
game-not-installed = {$game-title} is not installed
game-launch-failed = Failed to launch {$game-title}
game-kill-failed = Failed to kill {$game-title}
launch-required-addon-unavailable = Addon {$addon-title} from group {$group-title} is unavailable or outdated. You can launch the game without it or continue to use old version
Expand All @@ -34,3 +37,7 @@ loading-checking-wine-version-failed = Failed to check wine version
loading-checking-dxvk-version-failed = Failed to check dxvk version
loading-checking-applied-dxvk-failed = Failed to check applied dxvk version
loading-checking-games-addons-failed = Failed to check games addons
main-open-launcher-folder-failed = Failed to open launcher folder
main-open-config-file-failed = Failed to open config file
main-open-debug-file-failed = Failed to open debug file
5 changes: 5 additions & 0 deletions assets/locales/en/main.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ main-menu-launcher-folder = Launcher folder
main-menu-config-file = Config file
main-menu-debug-file = Debug file
main-menu-about = About
main-installed-games = Installed games
main-queued-games = Queued games
main-outdated-games = Outdated games
main-available-games = Available games
8 changes: 8 additions & 0 deletions assets/locales/ru/errors.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ game-find-path-failed = Не удалось найти путь уст
game-get-settings-failed = Не удалось получить настройки {$game-title}
game-get-addons-failed = Не удалось получить дополнения {$game-title}
game-get-paths-failed = Не удалось получить пути для {$game-title}
game-get-integrity-failed = Не удалось получить информацию для проверки файлов {$game-title}
game-get-status-failed = Не удалось получить статус {$game-title}
game-not-installed = {$game-title} не установлен
game-launch-failed = Не удалось запустить {$game-title}
game-kill-failed = Не удалось убить процесс {$game-title}
launch-required-addon-unavailable = Дополнение {$addon-title} из группы {$group-title} недоступно или устарело. Вы можете запустить игру без него или продолжить использовать старую версию
Expand All @@ -33,3 +37,7 @@ loading-checking-wine-version-failed = Не удалось проверить в
loading-checking-dxvk-version-failed = Не удалось проверить версию DXVK
loading-checking-applied-dxvk-failed = Не удалось проверить установленную версию DXVK
loading-checking-games-addons-failed = Не удалось проверить дополнения игр
main-open-launcher-folder-failed = Не удалось открыть папку лаунчера
main-open-config-file-failed = Не удалось открыть файл настроек
main-open-debug-file-failed = Не удалось открыть файл отладки
5 changes: 5 additions & 0 deletions assets/locales/ru/main.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ main-menu-launcher-folder = Папка лаунчера
main-menu-config-file = Файл настроек
main-menu-debug-file = Файл отладки
main-menu-about = О программе
main-installed-games = Установленные игры
main-queued-games = Игры в очереди
main-outdated-games = Устаревшие игры
main-available-games = Доступные игры
7 changes: 7 additions & 0 deletions assets/locales/zh-cn/errors.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ game-get-settings-failed = 无法获取 {$game-title} 的设置
game-get-addons-failed = 无法获取 {$game-title} 的语言文件
game-get-paths-failed = 无法获取 {$game-title} 的路径
game-get-integrity-failed = 无法获取 {$game-title} integrity info
game-get-status-failed = Unable to get {$game-title} status
game-not-installed = {$game-title} 未安装
game-launch-failed = Failed to launch {$game-title}
game-kill-failed = Failed to kill {$game-title}
launch-required-addon-unavailable = Addon {$addon-title} from group {$group-title} is unavailable or outdated. You can launch the game without it or continue to use old version
Expand All @@ -34,3 +37,7 @@ loading-checking-wine-version-failed = 无法检查 Wine 版本
loading-checking-dxvk-version-failed = 无法检查 DXVK 版本
loading-checking-applied-dxvk-failed = Failed to check applied dxvk version
loading-checking-games-addons-failed = Failed to check games addons
main-open-launcher-folder-failed = Failed to open launcher folder
main-open-config-file-failed = Failed to open config file
main-open-debug-file-failed = Failed to open debug file
5 changes: 5 additions & 0 deletions assets/locales/zh-cn/main.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ main-menu-launcher-folder = 启动器路径
main-menu-config-file = 配置文件
main-menu-debug-file = Debug 文件
main-menu-about = 关于
main-installed-games = Installed games
main-queued-games = Queued games
main-outdated-games = Outdated games
main-available-games = Available games
30 changes: 19 additions & 11 deletions src/ui/windows/main/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ impl SimpleAsyncComponent for MainApp {
#[watch]
set_visible: !model.installed_games.is_empty(),

set_label: "Installed games"
set_label: &tr!("main-installed-games")
},

#[local_ref]
Expand All @@ -314,7 +314,7 @@ impl SimpleAsyncComponent for MainApp {
#[watch]
set_visible: !model.queued_games.is_empty(),

set_label: "Queued games"
set_label: &tr!("main-queued-games")
},

#[local_ref]
Expand All @@ -338,7 +338,7 @@ impl SimpleAsyncComponent for MainApp {
#[watch]
set_visible: !model.outdated_games.is_empty(),

set_label: "Outdated games"
set_label: &tr!("main-outdated-games")
},

#[local_ref]
Expand All @@ -362,7 +362,7 @@ impl SimpleAsyncComponent for MainApp {
#[watch]
set_visible: !model.available_games.is_empty(),

set_label: "Available games"
set_label: &tr!("main-available-games")
},

#[local_ref]
Expand Down Expand Up @@ -548,7 +548,7 @@ impl SimpleAsyncComponent for MainApp {
group.add_action::<LauncherFolder>(RelmAction::new_stateless(gtk::glib::clone!(@strong sender => move |_| {
if let Err(err) = open::that(LAUNCHER_FOLDER.as_path()) {
sender.input(MainAppMsg::ShowToast {
title: String::from("Failed to open launcher folder"),
title: tr!("main-open-launcher-folder-failed"),
message: Some(err.to_string())
});

Expand All @@ -559,7 +559,7 @@ impl SimpleAsyncComponent for MainApp {
group.add_action::<ConfigFile>(RelmAction::new_stateless(gtk::glib::clone!(@strong sender => move |_| {
if let Err(err) = open::that(CONFIG_FILE.as_path()) {
sender.input(MainAppMsg::ShowToast {
title: String::from("Failed to open config file"),
title: tr!("main-open-config-file-failed"),
message: Some(err.to_string())
});

Expand All @@ -570,7 +570,7 @@ impl SimpleAsyncComponent for MainApp {
group.add_action::<DebugFile>(RelmAction::new_stateless(gtk::glib::clone!(@strong sender => move |_| {
if let Err(err) = open::that(DEBUG_FILE.as_path()) {
sender.input(MainAppMsg::ShowToast {
title: String::from("Failed to open debug file"),
title: tr!("main-open-debug-file-failed"),
message: Some(err.to_string())
});

Expand Down Expand Up @@ -707,7 +707,9 @@ impl SimpleAsyncComponent for MainApp {

Err(err) => {
sender.input(MainAppMsg::ShowToast {
title: format!("Unable to get {} status", info.get_title()),
title: tr!("game-get-status-failed", {
"game-title" = info.get_title()
}),
message: Some(err.to_string())
});
}
Expand Down Expand Up @@ -746,7 +748,9 @@ impl SimpleAsyncComponent for MainApp {

Err(err) => {
sender.input(MainAppMsg::ShowToast {
title: format!("Unable to get {} addons list", game_info.get_title()),
title: tr!("game-get-addons-failed", {
"game-title" = game_info.get_title()
}),
message: Some(err.to_string())
});
}
Expand Down Expand Up @@ -955,7 +959,9 @@ impl SimpleAsyncComponent for MainApp {
std::thread::spawn(move || {
if let Err(err) = launch_game::launch_game(&info) {
sender.input(MainAppMsg::ShowToast {
title: format!("Failed to launch {}", info.get_title()),
title: tr!("game-launch-failed", {
"game-title" = info.get_title()
}),
message: Some(err.to_string())
});
}
Expand All @@ -968,7 +974,9 @@ impl SimpleAsyncComponent for MainApp {
MainAppMsg::KillGame(info) => {
if let Err(err) = kill_game::kill_game(&info) {
sender.input(MainAppMsg::ShowToast {
title: format!("Failed to kill {}", info.get_title()),
title: tr!("game-kill-failed", {
"game-title" = info.get_title()
}),
message: Some(err.to_string())
});
}
Expand Down

0 comments on commit e83ce74

Please sign in to comment.