[gnome-desktop] gnome-languages: Fix translation of 3-letter codes



commit 901513d1ca2f66fa9cd7e0236bc6eb59304df560
Author: Gabor Karsay <gabor karsay gmx at>
Date:   Mon Nov 8 18:55:32 2021 +0100

    gnome-languages: Fix translation of 3-letter codes
    
    Language codes in ISO 639-1 consist of two letters, those in ISO 639-3
    of three letters. Use the appropriate domain for translations.
    
    Fixes: #197

 libgnome-desktop/gnome-languages.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/libgnome-desktop/gnome-languages.c b/libgnome-desktop/gnome-languages.c
index a9b1a197..c4de0e62 100644
--- a/libgnome-desktop/gnome-languages.c
+++ b/libgnome-desktop/gnome-languages.c
@@ -720,7 +720,11 @@ get_translated_language (const char *code,
                         name = g_strdup (_("Unspecified"));
                 } else {
                         g_autofree char *tmp = NULL;
-                        translated_name = dgettext_l (loc, "iso_639", language);
+                        if (strlen (code) == 2) {
+                                translated_name = dgettext_l (loc, "iso_639", language);
+                        } else {
+                                translated_name = dgettext_l (loc, "iso_639_3", language);
+                        }
                         tmp = get_first_item_in_semicolon_list (translated_name);
                         name = capitalize_utf8_string (tmp);
                 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]