From: Dirk-Jan C. Binnema Date: Mon, 12 Nov 2007 09:22:02 +0000 (+0000) Subject: * add little trick to fallback to en_GB when the X-Git-Tag: git_migration_finished~2123 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=1fff54a7e5b3f9efc177c116fc956fbf47d20f95 * add little trick to fallback to en_GB when the chosen language is not available. This is for making modest useful for those who don't have the closed-source l10n package pmo-trunk-r3700 --- diff --git a/src/modest-init.c b/src/modest-init.c index ddf2811..92dbfd1 100644 --- a/src/modest-init.c +++ b/src/modest-init.c @@ -551,15 +551,23 @@ static void init_i18n (void) { const gchar* gettext_package; - /* Setup gettext, to use our .po files: */ - /* GETTEXT_PACKAGE and MODEST_LOCALE_DIR are defined in config.h */ -/* #ifdef MODEST_HILDON_VERSION_0 */ -/* gettext_package = GETTEXT_PACKAGE; */ -/* bindtextdomain (gettext_package, MODEST_LOCALE_DIR); */ -/* #else */ -/* gettext_package = "osso-email"; /\* HACK to use the localizations *\/ */ -/* bindtextdomain (gettext_package, "/usr/share/locale"); */ -/* #endif /\*MODEST_HILDON_VERSION_0*\/ */ + +#ifdef MODEST_PLATFORM_MAEMO + /* little trick make en_GB the fallback language, instead + * of the logical IDs + * we need the ugly ifdefs, because modest_platform_init is + * too late. + */ + const gchar *lang = getenv ("LANG"); + if (!lang) + setenv ("LANGUAGE", "en_GB", 1); + else { + gchar *language = g_strdup_printf ("%s:en_GB", lang); + setenv ("LANGUAGE", language, 1); + g_free (language); + } + /* end of little trick */ +#endif /*MODEST_PLATFORM_MAEMO */ gettext_package = GETTEXT_PACKAGE;