Alexandre Julliard : wrc: Increase the font size when translating a dialog to a language that needs a larger font .
Alexandre Julliard
julliard at winehq.org
Mon Oct 31 12:49:04 CDT 2011
Module: wine
Branch: master
Commit: 1eeaa874b35d60413a378b430a3093ceee75ab71
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1eeaa874b35d60413a378b430a3093ceee75ab71
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Oct 31 11:28:52 2011 +0100
wrc: Increase the font size when translating a dialog to a language that needs a larger font.
---
tools/wrc/po.c | 14 +++++++++-----
1 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/tools/wrc/po.c b/tools/wrc/po.c
index d93c1b7..1882d78 100644
--- a/tools/wrc/po.c
+++ b/tools/wrc/po.c
@@ -64,6 +64,11 @@ static int is_rtl_language( const language_t *lan )
return lan->id == LANG_ARABIC || lan->id == LANG_HEBREW || lan->id == LANG_PERSIAN;
}
+static int uses_larger_font( const language_t *lan )
+{
+ return lan->id == LANG_CHINESE || lan->id == LANG_JAPANESE || lan->id == LANG_KOREAN;
+}
+
static version_t *get_dup_version( language_t *lang )
{
/* English "translations" take precedence over the original rc contents */
@@ -659,7 +664,6 @@ static void add_pot_dialog( po_file_t po, const resource_t *res )
const dialog_t *dlg = res->res.dlg;
if (dlg->title) add_po_string( po, dlg->title, NULL, NULL );
- if (dlg->font) add_po_string( po, dlg->font->name, NULL, NULL );
add_pot_dialog_controls( po, dlg->controls );
}
@@ -703,6 +707,7 @@ static void compare_dialogs( const dialog_t *english_dlg, const dialog_t *dlg )
font = convert_msgid_ascii( dlg->font->name, 0 );
size = dlg->font->size;
}
+ if (uses_larger_font( dlg->lvc.language )) english_size++;
if (!english_font || !font || strcasecmp( english_font, font ) || english_size != size)
warning( "%s: dialog %s doesn't have the same font (%s %u vs %s %u)\n",
@@ -757,8 +762,6 @@ static void add_po_dialog( const resource_t *english, const resource_t *res )
if (english_dlg->title && dlg->title)
add_po_string( po, english_dlg->title, dlg->title, dlg->lvc.language );
- if (english_dlg->font && dlg->font)
- add_po_string( po, english_dlg->font->name, dlg->font->name, dlg->lvc.language );
add_po_dialog_controls( po, english_dlg->controls, dlg->controls, dlg->lvc.language );
}
@@ -1079,8 +1082,9 @@ static void translate_dialog( dialog_t *dlg, dialog_t *new, int *found )
if (dlg->font)
{
new->font = xmalloc( sizeof(*dlg->font) );
- new->font = dlg->font;
- new->font->name = translate_string( dlg->font->name, found );
+ *new->font = *dlg->font;
+ if (uses_larger_font( new->lvc.language )) new->font->size++;
+ new->font->name = convert_string( dlg->font->name, str_unicode, 1252 );
}
new->controls = translate_controls( dlg->controls, found );
}
More information about the wine-cvs
mailing list