Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2013-03-08 19:34:23 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-03-08 19:34:23 +0400
commit589a73a43fd6d5f3e0e693117d91d150ca67de11 (patch)
tree482eb4ba00730d14b4736c406f359ccce54bce0d /source/blender/blenfont
parentf9b50facd7b02e5348266ad7ef1c604c4ed4d5ad (diff)
Fix to BLF_pgettext, which was returning "" when passed NULL msgid... Never noticed any problem, but it looks it could produce strange UI issues (like deactivated buttons), and it was not consistent anyway!
Thanks to S. Lockal for spotting the issue and providing a patch.
Diffstat (limited to 'source/blender/blenfont')
-rw-r--r--source/blender/blenfont/intern/blf_translation.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/blenfont/intern/blf_translation.c b/source/blender/blenfont/intern/blf_translation.c
index 750f310fade..f7ad5c07d50 100644
--- a/source/blender/blenfont/intern/blf_translation.c
+++ b/source/blender/blenfont/intern/blf_translation.c
@@ -90,9 +90,9 @@ void BLF_free_unifont(void)
const char *BLF_pgettext(const char *msgctxt, const char *msgid)
{
#ifdef WITH_INTERNATIONAL
- if (msgid && msgid[0]) {
- const char *ret;
+ const char *ret = msgid;
+ if (msgid && msgid[0]) {
/*if (msgctxt && !strcmp(msgctxt, BLF_I18NCONTEXT_DEFAULT_BPY_INTERN)) { */
if (msgctxt && msgctxt[0] == BLF_I18NCONTEXT_DEFAULT_BPY[0]) {
/* BLF_I18NCONTEXT_DEFAULT_BPY context is reserved and considered the same as default NULL one. */
@@ -105,10 +105,9 @@ const char *BLF_pgettext(const char *msgctxt, const char *msgid)
if (ret == msgid) {
ret = BPY_app_translations_py_pgettext(msgctxt, msgid);
}
-
- return ret;
}
- return "";
+
+ return ret;
#else
(void)msgctxt;
return msgid;