From 1987cb5f3acb2d2d2f474dee76c6b79fc473d0f4 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sun, 11 Aug 2019 22:29:44 +0200 Subject: [PATCH] GUI: make languages "Undetermined"/"No linguistic content" translatable --- src/common/iso639.cpp | 10 ++++++++-- src/mkvtoolnix-gui/app.cpp | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/common/iso639.cpp b/src/common/iso639.cpp index 73401784b..e053fdeb1 100644 --- a/src/common/iso639.cpp +++ b/src/common/iso639.cpp @@ -538,7 +538,7 @@ list_iso639_languages() { size_t longest[3] = { get_width_in_em(w_col1), get_width_in_em(w_col2), get_width_in_em(w_col3) }; for (auto &lang : g_iso639_languages) { - longest[0] = std::max(longest[0], get_width_in_em(to_wide(lang.english_name))); + longest[0] = std::max(longest[0], get_width_in_em(to_wide(gettext(lang.english_name.c_str())))); longest[1] = std::max(longest[1], get_width_in_em(to_wide(lang.iso639_2_code))); longest[2] = std::max(longest[2], get_width_in_em(to_wide(lang.iso639_1_code))); } @@ -547,7 +547,7 @@ list_iso639_languages() { mxinfo(std::wstring(longest[0] + 1, L'-') + L'+' + std::wstring(longest[1] + 2, L'-') + L'+' + std::wstring(longest[2] + 1, L'-') + L"\n"); for (auto &lang : g_iso639_languages) { - std::wstring english = to_wide(lang.english_name); + std::wstring english = to_wide(gettext(lang.english_name.c_str())); std::wstring code2 = to_wide(lang.iso639_2_code); std::wstring code1 = to_wide(lang.iso639_1_code); mxinfo(FILL(english, 0) + L" | " + FILL(code2, 1) + L" | " + FILL(code1, 2) + L"\n"); @@ -637,3 +637,9 @@ map_to_iso639_2_code(std::string const &s, return -1; } + +// Make the following two strings translatable: +#undef Y +#define Y(x) +Y("Undetermined") +Y("No linguistic content; Not applicable") diff --git a/src/mkvtoolnix-gui/app.cpp b/src/mkvtoolnix-gui/app.cpp index c6e6c5e7f..2ca8abdb5 100644 --- a/src/mkvtoolnix-gui/app.cpp +++ b/src/mkvtoolnix-gui/app.cpp @@ -233,7 +233,7 @@ App::initializeIso639Languages() { for (auto const &language : g_iso639_languages) { auto languageCode = Q(language.iso639_2_code); - auto description = Q("%1 (%2)").arg(Q(language.english_name)).arg(languageCode); + auto description = Q("%1 (%2)").arg(Q(gettext(language.english_name.c_str()))).arg(languageCode); auto isCommon = cfg.m_oftenUsedLanguages.indexOf(languageCode) != -1; s_iso639Languages.emplace_back(description, languageCode);