From c19f3f07b0cdfba8938040d271a2147446b007ed Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 28 Nov 2022 10:17:28 -0700 Subject: [PATCH] on macOS, try to fix weird language preference handling If the user has en_XX, consider that as untranslated english EXCEPT for en_GB --- gtk2_ardour/cocoacarbon.mm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/cocoacarbon.mm b/gtk2_ardour/cocoacarbon.mm index 9d6707f909..13fd6c7332 100644 --- a/gtk2_ardour/cocoacarbon.mm +++ b/gtk2_ardour/cocoacarbon.mm @@ -99,17 +99,26 @@ set_language_preference () */ have_translatable_languages = false; cout << "User has en as primary language choice. " << PROGRAM_NAME << " will not be translated\n"; + } else if (len == 5 && cstr[len-2] == 'G' && cstr[len-1] == 'B') { + /* primary language is english (GB). Stop + looking, because we know there is a + translation. + */ + cout << "Use has en_GB a primary language choice. " << PROGRAM_NAME << " will be translated\n"; } else if (len == 5 && cstr[len-2] == 'U' && cstr[len-1] == 'S') { /* primary language choice is english (US). Stop looking, and do not set LANGUAGE. gettext needs to just skip translation entirely. */ have_translatable_languages = false; cout << "User has en_US as primary language choice. " << PROGRAM_NAME << " will not be translated\n"; + } else { + /* primary language choice is english with some + * non-anglosphere locale, eg. en_DE. We will + * not translate. + */ + have_translatable_languages = false; + cout << "User has " << cstr << " as primary language/locale choice. " << PROGRAM_NAME << " will not be translated\n"; } - - /* else en- ... still leave the door open for translation - to other version of english (e.g. en_IN, en_GB, etc) - */ } if (have_translatable_languages) {