settings
Now we use the name of the country in en_GB to properly select the current
region. It works now for every language, even for those that don't have
translations for osso-countries
Fixes NB#143546
gboolean
modest_init (int argc, char *argv[])
{
gboolean
modest_init (int argc, char *argv[])
{
if (_is_initialized) {
g_printerr ("modest: %s may only be invoked once\n", __FUNCTION__);
return FALSE;
if (_is_initialized) {
g_printerr ("modest: %s may only be invoked once\n", __FUNCTION__);
return FALSE;
init_i18n();
if (!force_ke_recv_load()) {
init_i18n();
if (!force_ke_recv_load()) {
/* initialize the prng, we need it when creating random files */
srandom((int)getpid());
/* initialize the prng, we need it when creating random files */
srandom((int)getpid());
if (!gnome_vfs_initialized()) {
if (!gnome_vfs_init ()) {
g_printerr ("modest: failed to init gnome-vfs\n");
return FALSE;
}
}
if (!gnome_vfs_initialized()) {
if (!gnome_vfs_init ()) {
g_printerr ("modest: failed to init gnome-vfs\n");
return FALSE;
}
}
if (!modest_runtime_init()) {
modest_init_uninit ();
g_printerr ("modest: failed to initialize the modest runtime\n");
return FALSE;
}
if (!modest_runtime_init()) {
modest_init_uninit ();
g_printerr ("modest: failed to initialize the modest runtime\n");
return FALSE;
}
modest_plugin_factory_load_all (modest_runtime_get_plugin_factory ());
/* do an initial guess for the device name */
init_device_name (modest_runtime_get_conf());
modest_plugin_factory_load_all (modest_runtime_get_plugin_factory ());
/* do an initial guess for the device name */
init_device_name (modest_runtime_get_conf());
if (!modest_platform_init(argc, argv)) {
modest_init_uninit ();
g_printerr ("modest: failed to run platform-specific initialization\n");
if (!modest_platform_init(argc, argv)) {
modest_init_uninit ();
g_printerr ("modest: failed to run platform-specific initialization\n");
}
init_default_settings (modest_runtime_get_conf ());
}
init_default_settings (modest_runtime_get_conf ());
if (!modest_init_local_folders(NULL)) {
modest_init_uninit ();
g_printerr ("modest: failed to init local folders\n");
return FALSE;
}
if (!modest_init_local_folders(NULL)) {
modest_init_uninit ();
g_printerr ("modest: failed to init local folders\n");
return FALSE;
}
if (!init_default_account_maybe (modest_runtime_get_account_mgr ())) {
modest_init_uninit ();
g_printerr ("modest: failed to init default account\n");
return FALSE;
if (!init_default_account_maybe (modest_runtime_get_account_mgr ())) {
modest_init_uninit ();
g_printerr ("modest: failed to init default account\n");
return FALSE;
if (!init_ui (argc, argv)) {
modest_init_uninit ();
g_printerr ("modest: failed to init ui\n");
if (!init_ui (argc, argv)) {
modest_init_uninit ();
g_printerr ("modest: failed to init ui\n");
if (mflags & MODEST_RUNTIME_DEBUG_ABORT_ON_WARNING)
g_log_set_always_fatal (G_LOG_LEVEL_ERROR |
G_LOG_LEVEL_CRITICAL |
G_LOG_LEVEL_WARNING);
}
if (mflags & MODEST_RUNTIME_DEBUG_ABORT_ON_WARNING)
g_log_set_always_fatal (G_LOG_LEVEL_ERROR |
G_LOG_LEVEL_CRITICAL |
G_LOG_LEVEL_WARNING);
}
static void
init_i18n (void)
{
const gchar *lc_messages = setlocale (LC_MESSAGES, NULL);
static void
init_i18n (void)
{
const gchar *lc_messages = setlocale (LC_MESSAGES, NULL);
- gchar *new_lc_messages;
if (!lc_messages) {
setenv ("LANGUAGE", "en_GB", 1);
setenv ("LC_MESSAGES", "en_GB", 1);
if (!lc_messages) {
setenv ("LANGUAGE", "en_GB", 1);
setenv ("LC_MESSAGES", "en_GB", 1);
+#ifdef MODEST_PLATFORM_GNOME
+ gchar *new_lc_messages;
new_lc_messages = g_strconcat (lc_messages, ":en_GB", NULL);
setenv ("LANGUAGE", new_lc_messages, 1);
setenv ("LC_MESSAGES", new_lc_messages, 1);
g_free (new_lc_messages);
new_lc_messages = g_strconcat (lc_messages, ":en_GB", NULL);
setenv ("LANGUAGE", new_lc_messages, 1);
setenv ("LC_MESSAGES", new_lc_messages, 1);
g_free (new_lc_messages);
}
bindtextdomain (GETTEXT_PACKAGE, MODEST_LOCALE_DIR);
}
bindtextdomain (GETTEXT_PACKAGE, MODEST_LOCALE_DIR);
/* Create the account store & launch send queues */
acc_store = modest_runtime_get_account_store ();
modest_tny_account_store_start_send_queues (acc_store);
/* Create the account store & launch send queues */
acc_store = modest_runtime_get_account_store ();
modest_tny_account_store_start_send_queues (acc_store);
-modest_plugin_factory_load_all (ModestPluginFactory *self)
+modest_plugin_factory_load_all (ModestPluginFactory *self)
{
ModestPluginFactoryPrivate *priv;
GError *error = NULL;
{
ModestPluginFactoryPrivate *priv;
GError *error = NULL;
while ((dirent = g_dir_read_name (d))) {
if (g_str_has_suffix (dirent, PLUGIN_EXT)) {
gchar *plugin_file;
while ((dirent = g_dir_read_name (d))) {
if (g_str_has_suffix (dirent, PLUGIN_EXT)) {
gchar *plugin_file;
+ ModestPlugin *plugin = NULL;
plugin_file = g_build_filename (MODEST_MAILPLUGINDIR, dirent, NULL);
plugin = modest_plugin_factory_load (plugin_file);
plugin_file = g_build_filename (MODEST_MAILPLUGINDIR, dirent, NULL);
plugin = modest_plugin_factory_load (plugin_file);
priv->plugins = g_slist_prepend (priv->plugins, plugin);
}
}
priv->plugins = g_slist_prepend (priv->plugins, plugin);
}
}
priv->plugins = g_slist_reverse (priv->plugins);
g_dir_close (d);
priv->plugins = g_slist_reverse (priv->plugins);
g_dir_close (d);
}
/* Get the territory specified for the current locale */
}
/* Get the territory specified for the current locale */
- territory = nl_langinfo (_NL_ADDRESS_COUNTRY_NAME);
+ territory = nl_langinfo (_NL_IDENTIFICATION_TERRITORY);
+
+ setlocale (LC_MESSAGES, "en_GB");
while (fgets (line, MCC_FILE_MAX_LINE_LEN, file) != NULL) {
int mcc;
while (fgets (line, MCC_FILE_MAX_LINE_LEN, file) != NULL) {
int mcc;
+ setlocale (LC_MESSAGES, "");
+
/* Now we fill the model */
rewind (file);
country_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
/* Now we fill the model */
rewind (file);
country_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);