gtk3/gtk3-bnc129753-localize-font-style-name.patch

71 lines
3.0 KiB
Diff
Raw Normal View History

Index: gtk+-3.1.90/gtk/gtkfontbutton.c
===================================================================
--- gtk+-3.1.90.orig/gtk/gtkfontbutton.c
+++ gtk+-3.1.90/gtk/gtkfontbutton.c
@@ -1175,7 +1175,7 @@ gtk_font_button_update_font_info (GtkFon
{
family_style = g_strdup_printf ("%s %s",
pango_font_family_get_name (priv->font_family),
- pango_font_face_get_face_name (priv->font_face));
+ _(pango_font_face_get_face_name (priv->font_face)));
}
Index: gtk+-3.1.90/gtk/gtkfontchooserwidget.c
===================================================================
--- gtk+-3.1.90.orig/gtk/gtkfontchooserwidget.c
+++ gtk+-3.1.90/gtk/gtkfontchooserwidget.c
@@ -767,7 +767,7 @@ populate_list (GtkFontChooserWidget *fon
gchar *font_desc;
pango_desc = pango_font_face_describe (faces[j]);
- face_name = pango_font_face_get_face_name (faces[j]);
+ face_name = _(pango_font_face_get_face_name (faces[j]));
font_desc = pango_font_description_to_string (pango_desc);
family_and_face = g_strconcat (fam_name, " ", face_name, NULL);
Index: gtk+-3.1.90/gtk/gtkfontsel.c
===================================================================
--- gtk+-3.1.90.orig/gtk/gtkfontsel.c
+++ gtk+-3.1.90/gtk/gtkfontsel.c
@@ -126,6 +126,21 @@ struct _GtkFontSelectionDialogPrivate
#define DEFAULT_FONT_NAME "Sans 10"
+/* These are the commonly used font styles, listed here only for
+ translations. */
+#define FONT_STYLE_ULTRA_LIGHT N_("Ultra-Light")
+#define FONT_STYLE_LIGHT N_("Light")
+#define FONT_STYLE_MEDIUM N_("Medium")
+#define FONT_STYLE_NORMAL N_("Normal")
+#define FONT_STYLE_REGULAR N_("Regular")
+#define FONT_STYLE_ITALIC N_("Italic")
+#define FONT_STYLE_OBLIQUE N_("Oblique")
+#define FONT_STYLE_SEMI_BOLD N_("Semi-Bold")
+#define FONT_STYLE_BOLD N_("Bold")
+#define FONT_STYLE_ULTRA_BOLD N_("Ultra-Bold")
+#define FONT_STYLE_HEAVY N_("Heavy")
+#define FONT_STYLE_BOLD_ITALIC N_("Bold Italic")
+
/* This is the initial and maximum height of the preview entry (it expands
when large font sizes are selected). Initial height is also the minimum. */
#define INITIAL_PREVIEW_HEIGHT 44
@@ -982,7 +997,7 @@ gtk_font_selection_show_available_styles
for (i=0; i < n_faces; i++)
{
GtkTreeIter iter;
- const gchar *str = pango_font_face_get_face_name (faces[i]);
+ const gchar *str = _(pango_font_face_get_face_name (faces[i]));
gtk_list_store_append (model, &iter);
gtk_list_store_set (model, &iter,
@@ -1016,7 +1031,7 @@ gtk_font_selection_show_available_styles
if (match_face)
{
#ifdef INCLUDE_FONT_ENTRIES
- const gchar *str = pango_font_face_get_face_name (priv->face);
+ const gchar *str = _(pango_font_face_get_face_name (priv->face));
gtk_entry_set_text (GTK_ENTRY (priv->font_style_entry), str);
#endif