fix(lang): keep the {} value and the meaning in four translations (#16701)

* fix(lang): keep the {} value and the meaning in four translations

* test(lang): check that the fixed translations keep their key's {}

translate() replaces {} with the value from the call. The test checks that no non-empty ru, sc or vi translation of a key with {} drops it; on master it fails with "Downloading {}" => "Скачивание".
This commit is contained in:
Lukas authored and GitHub committed 2026-10-27 16:27:53 +08:00
1 parent 59f2953c94
commit eb23902450
4 files changed
+18 -4

No files matched your search

+14
View File
@@ -396,4 +396,18 @@ mod test {
assert_eq!(f("", "zh_MO", false), "zh-tw");
assert_eq!(f("", "zh-Hans-HK", false), "zh-cn");
}
#[test]
fn test_translations_keep_the_placeholder_of_their_key() {
use super::*;
// translate() puts the caller's value where `{}` is, so a translation without `{}` drops it.
for table in [&*ru::T, &*sc::T, &*vi::T] {
for (key, value) in table.iter() {
if key.contains("{}") && !value.is_empty() {
assert!(value.contains("{}"), "{key:?} => {value:?}");
}
}
}
}
}
+1 -1
View File
@@ -664,7 +664,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Import Folder", "Импортировать папку"),
("Copy to clipboard", "Копировать в буфер обмена"),
("Enable remote printer", "Использовать удалённый принтер"),
("Downloading {}", "Скачивание"),
("Downloading {}", "Скачивание {}"),
("{} Update", "Обновить {}"),
("{}-to-update-tip", "{} закроется и установит новую версию."),
("download-new-version-failed-tip", "Ошибка загрузки. Можно повторить попытку или нажать кнопку \"Скачать\", чтобы скачать приложение с официального сайта и обновить вручную."),
+1 -1
View File
@@ -639,7 +639,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Use D3D rendering", "Imprea sa renderizatzione D3D"),
("Printer", "Imprentadora"),
("printer-os-requirement-tip", "Pro pòdere impreare s'imprentadora in seddida bisòngiat a installare {} in custu dispositivu."),
("printer-requires-installed-{}-client-tip", "Pro sa funtzionalidade de imprenta in essida b'at bisòngiu de Window 10 o prus nou."),
("printer-requires-installed-{}-client-tip", ""),
("printer-{}-not-installed-tip", "S'imprentadora {} no est installada"),
("printer-{}-ready-tip", "S'imprentadora {} est installada e pronta pro s'impreu."),
("Install {} Printer", "Installa s'imprentadora {}"),
+2 -2
View File
@@ -522,7 +522,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("auto_disconnect_option_tip", "Tự động ngắt kết nối khi không hoạt động"),
("Connection failed due to inactivity", "Ngắt kết nối do không hoạt động"),
("Check for software update on startup", "Kiểm tra cập nhật khi khởi động"),
("upgrade_rustdesk_server_pro_to_{}_tip", "Nâng cấp lên Pro để có thêm tính năng"),
("upgrade_rustdesk_server_pro_to_{}_tip", "Vui lòng nâng cấp RustDesk Server Pro lên phiên bản {} hoặc mới hơn!"),
("pull_group_failed_tip", "Lấy thông tin nhóm thất bại"),
("Filter by intersection", "Lọc theo giao điểm"),
("Remove wallpaper during incoming sessions", "Xóa hình nền khi có kết nối đến"),
@@ -666,7 +666,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("Enable remote printer", "Bật máy in từ xa"),
("Downloading {}", "Đang tải xuống {}"),
("{} Update", "Cập nhật {}"),
("{}-to-update-tip", "Cần nâng cấp để sử dụng tính năng này."),
("{}-to-update-tip", "{} sẽ đóng ngay bây giờ và cài đặt phiên bản mới."),
("download-new-version-failed-tip", "Tải phiên bản mới thất bại."),
("Auto update", "Tự động cập nhật"),
("update-failed-check-msi-tip", "Cập nhật lỗi, vui lòng kiểm tra file MSI."),