Bug 503071 - Application direction changes to right to left even if theres
2008-05-20 14:27:34 Tim Janik <timj@imendio.com> * reverted recent unapproved changes by Yair Hershkovitz, regarding: Bug 503071 - Application direction changes to right to left even if theres no translation. svn path=/trunk/; revision=20116
This commit is contained in:
committed by
Tim Janik
parent
e58fcc1eb7
commit
4d1892710f
@ -755,10 +755,13 @@ start_element (GMarkupParseContext *context,
|
||||
element_name);
|
||||
}
|
||||
|
||||
/* This function is taken from gettext.h
|
||||
* GNU gettext uses '\004' to separate context and msgid in .mo files.
|
||||
*/
|
||||
static const char *
|
||||
_g_dpgettext (const char *domain,
|
||||
const char *msgctxt,
|
||||
const char *msgid)
|
||||
dpgettext (const char *domain,
|
||||
const char *msgctxt,
|
||||
const char *msgid)
|
||||
{
|
||||
size_t msgctxt_len = strlen (msgctxt) + 1;
|
||||
size_t msgid_len = strlen (msgid) + 1;
|
||||
@ -768,10 +771,22 @@ _g_dpgettext (const char *domain,
|
||||
msg_ctxt_id = g_alloca (msgctxt_len + msgid_len);
|
||||
|
||||
memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1);
|
||||
msg_ctxt_id[msgctxt_len - 1] = '|';
|
||||
msg_ctxt_id[msgctxt_len - 1] = '\004';
|
||||
memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len);
|
||||
|
||||
return g_dpgettext (domain, msg_ctxt_id, 0);
|
||||
translation = dgettext (domain, msg_ctxt_id);
|
||||
|
||||
if (translation == msg_ctxt_id)
|
||||
{
|
||||
/* try the old way of doing message contexts, too */
|
||||
msg_ctxt_id[msgctxt_len - 1] = '|';
|
||||
translation = dgettext (domain, msg_ctxt_id);
|
||||
|
||||
if (translation == msg_ctxt_id)
|
||||
return msgid;
|
||||
}
|
||||
|
||||
return translation;
|
||||
}
|
||||
|
||||
gchar *
|
||||
@ -782,9 +797,9 @@ _gtk_builder_parser_translate (const gchar *domain,
|
||||
const char *s;
|
||||
|
||||
if (context)
|
||||
s = _g_dpgettext (domain, context, text);
|
||||
s = dpgettext (domain, context, text);
|
||||
else
|
||||
s = g_dgettext (domain, text);
|
||||
s = dgettext (domain, text);
|
||||
|
||||
return g_strdup (s);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user