From 83cfbd96aa351d1ffc91d409cacb26ad1ec7df2d Mon Sep 17 00:00:00 2001 From: Sergio Villar Senin Date: Wed, 21 Jan 2009 12:41:06 +0000 Subject: [PATCH 1/1] Migrated hildon2 to text-utils dgettext macros pmo-trunk-r7213 --- src/hildon2/modest-address-book.c | 8 ++++---- src/hildon2/modest-hildon2-window.c | 4 ++-- src/hildon2/modest-main-window.c | 2 +- src/hildon2/modest-msg-edit-window.c | 26 +++++++++++++------------- src/hildon2/modest-msg-view-window.c | 22 +++++++++++++--------- src/hildon2/modest-platform.c | 2 +- src/modest-text-utils.h | 1 + 7 files changed, 35 insertions(+), 30 deletions(-) diff --git a/src/hildon2/modest-address-book.c b/src/hildon2/modest-address-book.c index d669b37..c1360bc 100644 --- a/src/hildon2/modest-address-book.c +++ b/src/hildon2/modest-address-book.c @@ -507,7 +507,7 @@ run_add_email_addr_to_contact_dlg(const gchar * contact_name) if ((invalid_char_offset != NULL)&&(*invalid_char_offset != '\0')) { gchar *char_in_string = g_strdup_printf ("%c", *invalid_char_offset); gchar *message = g_strdup_printf( - dgettext("hildon-common-strings", "ckdg_ib_illegal_characters_entered"), + _CS("ckdg_ib_illegal_characters_entered"), char_in_string); hildon_banner_show_information ( add_email_addr_to_contact_dlg, NULL, message ); @@ -753,9 +753,9 @@ modest_address_book_check_names (ModestRecptEditor *recpt_editor, gboolean updat if (!modest_text_utils_validate_recipient (address, &invalid_char_position)) { if ((invalid_char_position != NULL) && (*invalid_char_position != '\0')) { gchar *char_in_string = g_strdup_printf("%c", *invalid_char_position); - gchar *message = g_strdup_printf( - dgettext("hildon-common-strings", "ckdg_ib_illegal_characters_entered"), - char_in_string); + gchar *message = + g_strdup_printf(_CS("ckdg_ib_illegal_characters_entered"), + char_in_string); g_free (char_in_string); hildon_banner_show_information (NULL, NULL, message ); g_free (message); diff --git a/src/hildon2/modest-hildon2-window.c b/src/hildon2/modest-hildon2-window.c index 877910a..995eeb9 100644 --- a/src/hildon2/modest-hildon2-window.c +++ b/src/hildon2/modest-hildon2-window.c @@ -38,6 +38,7 @@ #include #include #include +#include "modest-text-utils.h" #include typedef struct _EditModeRegister { @@ -220,9 +221,8 @@ on_zoom_minus_plus_not_implemented (ModestWindow *window) { g_return_val_if_fail (MODEST_IS_HILDON2_WINDOW (window), FALSE); - hildon_banner_show_information (NULL, NULL, dgettext("hildon-common-strings", "ckct_ib_cannot_zoom_here")); + hildon_banner_show_information (NULL, NULL, _CS("ckct_ib_cannot_zoom_here")); return FALSE; - } static void diff --git a/src/hildon2/modest-main-window.c b/src/hildon2/modest-main-window.c index 35c13f5..b89320d 100644 --- a/src/hildon2/modest-main-window.c +++ b/src/hildon2/modest-main-window.c @@ -2226,7 +2226,7 @@ on_zoom_minus_plus_not_implemented (ModestWindow *window) { g_return_val_if_fail (MODEST_IS_MAIN_WINDOW (window), FALSE); - hildon_banner_show_information (NULL, NULL, dgettext("hildon-common-strings", "ckct_ib_cannot_zoom_here")); + hildon_banner_show_information (NULL, NULL, _CS("ckct_ib_cannot_zoom_here")); return FALSE; } diff --git a/src/hildon2/modest-msg-edit-window.c b/src/hildon2/modest-msg-edit-window.c index 4723602..18b1680 100644 --- a/src/hildon2/modest-msg-edit-window.c +++ b/src/hildon2/modest-msg-edit-window.c @@ -2201,31 +2201,32 @@ modest_msg_edit_window_insert_image (ModestMsgEditWindow *window) mime_part = tny_platform_factory_new_mime_part (modest_runtime_get_platform_factory ()); - + TnyStream *stream = create_stream_for_uri (uri); if (stream == NULL) { - modest_platform_information_banner (NULL, NULL, dgettext("hildon-fm", "sfil_ib_opening_not_allowed")); - + modest_platform_information_banner (NULL, NULL, + _FM("sfil_ib_opening_not_allowed")); + g_object_unref (mime_part); gnome_vfs_file_info_unref (info); continue; } tny_mime_part_construct (mime_part, stream, mime_type, "base64"); - + content_id = g_strdup_printf ("%d", priv->next_cid); tny_mime_part_set_content_id (mime_part, content_id); g_free (content_id); priv->next_cid++; - + basename = g_path_get_basename (filename); tny_mime_part_set_filename (mime_part, basename); g_free (basename); pixbuf = pixbuf_from_stream (stream, mime_type, &stream_size); - + if (pixbuf != NULL) { priv->images_size += stream_size; priv->images_count ++; @@ -2377,7 +2378,7 @@ modest_msg_edit_window_attach_file_one (ModestMsgEditWindow *window, size = info->size; if (size > allowed_size) { modest_platform_information_banner (NULL, NULL, - dgettext("hildon-fm", "sfil_ib_opening_not_allowed")); + _FM("sfil_ib_opening_not_allowed")); return 0; } } else @@ -2387,7 +2388,7 @@ modest_msg_edit_window_attach_file_one (ModestMsgEditWindow *window, if (stream == NULL) { - modest_platform_information_banner (NULL, NULL, dgettext("hildon-fm", "sfil_ib_opening_not_allowed")); + modest_platform_information_banner (NULL, NULL, _FM("sfil_ib_opening_not_allowed")); g_object_unref (mime_part); gnome_vfs_file_info_unref (info); @@ -3312,8 +3313,7 @@ subject_field_insert_text (GtkEditable *editable, if (result_len + old_length > 1000) { hildon_banner_show_information (GTK_WIDGET (window), NULL, - dgettext("hildon-common-strings", - "ckdg_ib_maximum_characters_reached")); + _CS("ckdg_ib_maximum_characters_reached")); } g_string_free (result, TRUE); } @@ -3419,7 +3419,7 @@ modest_msg_edit_window_find_toolbar_search (GtkWidget *widget, g_free (priv->last_search); priv->last_search = NULL; /* Information banner about empty search */ - hildon_banner_show_information (NULL, NULL, dgettext ("hildon-common-strings", "ecdg_ib_find_rep_enter_text")); + hildon_banner_show_information (NULL, NULL, _CS("ecdg_ib_find_rep_enter_text")); return; } @@ -3435,14 +3435,14 @@ modest_msg_edit_window_find_toolbar_search (GtkWidget *widget, result = gtk_text_iter_forward_search_insensitive (&selection_end, current_search, &match_start, &match_end); if (!result) - hildon_banner_show_information (NULL, NULL, dgettext ("hildon-libs", "ckct_ib_find_search_complete")); + hildon_banner_show_information (NULL, NULL, _HL("ckct_ib_find_search_complete")); } else { GtkTextIter buffer_start; gtk_text_buffer_get_start_iter (priv->text_buffer, &buffer_start); result = gtk_text_iter_forward_search_insensitive (&buffer_start, current_search, &match_start, &match_end); if (!result) - hildon_banner_show_information (NULL, NULL, dgettext ("hildon-libs", "ckct_ib_find_no_matches")); + hildon_banner_show_information (NULL, NULL, _HL("ckct_ib_find_no_matches")); } /* Mark as selected the string found in search */ diff --git a/src/hildon2/modest-msg-view-window.c b/src/hildon2/modest-msg-view-window.c index 3769a74..4a0f792 100644 --- a/src/hildon2/modest-msg-view-window.c +++ b/src/hildon2/modest-msg-view-window.c @@ -1443,7 +1443,7 @@ modest_msg_view_window_find_toolbar_search (GtkWidget *widget, if ((current_search == NULL) || (strcmp (current_search, "") == 0)) { g_free (current_search); - hildon_banner_show_information (NULL, NULL, dgettext("hildon-common-strings", "ecdg_ib_find_rep_enter_text")); + hildon_banner_show_information (NULL, NULL, _CS("ecdg_ib_find_rep_enter_text")); return; } @@ -1454,7 +1454,8 @@ modest_msg_view_window_find_toolbar_search (GtkWidget *widget, result = modest_isearch_view_search (MODEST_ISEARCH_VIEW (priv->msg_view), priv->last_search); if (!result) { - hildon_banner_show_information (NULL, NULL, dgettext("hildon-libs", "ckct_ib_find_no_matches")); + hildon_banner_show_information (NULL, NULL, + _HL("ckct_ib_find_no_matches")); g_free (priv->last_search); priv->last_search = NULL; } else { @@ -1463,7 +1464,8 @@ modest_msg_view_window_find_toolbar_search (GtkWidget *widget, } } else { if (!modest_isearch_view_search_next (MODEST_ISEARCH_VIEW (priv->msg_view))) { - hildon_banner_show_information (NULL, NULL, dgettext("hildon-libs", "ckct_ib_find_search_complete")); + hildon_banner_show_information (NULL, NULL, + _HL("ckct_ib_find_search_complete")); g_free (priv->last_search); priv->last_search = NULL; } else { @@ -1516,7 +1518,8 @@ modest_msg_view_window_zoom_plus (ModestWindow *window) zoom_level = modest_zoomable_get_zoom (MODEST_ZOOMABLE (priv->msg_view)); if (zoom_level >= 2.0) { - hildon_banner_show_information (NULL, NULL, dgettext("hildon-common-strings", "ckct_ib_max_zoom_level_reached")); + hildon_banner_show_information (NULL, NULL, + _CS("ckct_ib_max_zoom_level_reached")); return FALSE; } else if (zoom_level >= 1.5) { zoom_level = 2.0; @@ -1556,7 +1559,8 @@ modest_msg_view_window_zoom_minus (ModestWindow *window) zoom_level = modest_zoomable_get_zoom (MODEST_ZOOMABLE (priv->msg_view)); if (zoom_level <= 0.5) { - hildon_banner_show_information (NULL, NULL, dgettext("hildon-common-strings", "ckct_ib_min_zoom_level_reached")); + hildon_banner_show_information (NULL, NULL, + _CS("ckct_ib_min_zoom_level_reached")); return FALSE; } else if (zoom_level <= 0.8) { zoom_level = 0.5; @@ -2615,8 +2619,8 @@ idle_save_mime_part_show_result (SaveMimePartInfo *info) if (info->result == GNOME_VFS_OK) { hildon_banner_show_information (NULL, NULL, _CS("sfil_ib_saved")); } else if (info->result == GNOME_VFS_ERROR_NO_SPACE) { - hildon_banner_show_information (NULL, NULL, dgettext("ke-recv", - "cerm_device_memory_full")); + hildon_banner_show_information (NULL, NULL, + _KR("cerm_device_memory_full")); } else { hildon_banner_show_information (NULL, NULL, _("mail_ib_file_operation_failed")); } @@ -2709,7 +2713,7 @@ save_attachments_response (GtkDialog *dialog, if (!modest_utils_folder_writable (chooser_uri)) { hildon_banner_show_information - (NULL, NULL, dgettext("hildon-fm", "sfil_ib_readonly_location")); + (NULL, NULL, _FM("sfil_ib_readonly_location")); } else { TnyIterator *iter; @@ -2721,7 +2725,7 @@ save_attachments_response (GtkDialog *dialog, !tny_mime_part_is_purged (mime_part) && (tny_mime_part_get_filename (mime_part) != NULL)) { SaveMimePartPair *pair; - + pair = g_slice_new0 (SaveMimePartPair); if (tny_list_get_length (mime_parts) > 1) { diff --git a/src/hildon2/modest-platform.c b/src/hildon2/modest-platform.c index 0167cac..c0690cf 100644 --- a/src/hildon2/modest-platform.c +++ b/src/hildon2/modest-platform.c @@ -2342,7 +2342,7 @@ modest_platform_check_memory_low (ModestWindow *win, if (win && lowmem && visuals) modest_platform_run_information_dialog ( GTK_WINDOW(win), - dgettext("ke-recv","memr_ib_operation_disabled"), + _KR("memr_ib_operation_disabled"), TRUE); if (lowmem) diff --git a/src/modest-text-utils.h b/src/modest-text-utils.h index 9826348..22f94d8 100644 --- a/src/modest-text-utils.h +++ b/src/modest-text-utils.h @@ -44,6 +44,7 @@ #define _HL(str) dgettext("hildon-libs",str) #define _MD(str) dgettext("maemo-af-desktop",str) #define _AB(str) dgettext("osso-addressbook",str) +#define _KR(str) dgettext("ke-recv",str) /* Forbidden char arrays */ extern const gchar account_title_forbidden_chars[]; -- 1.7.9.5