summaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-09 22:48:35 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-09 22:51:59 -0700
commit193d20c479d597db307ac5e206b74b26c2f97ba9 (patch)
treeb9f55e5acbacb4d397edb022cf8a37ef4654efbf /file.c
parent2d69d4a5ef5f2d3e777d77380732c333151fe949 (diff)
downloadsubsurface-193d20c479d597db307ac5e206b74b26c2f97ba9.tar.gz
Next step towards working translations
This may seem like a really odd change - but with this change the Qt tools can correctly parse the C files (and qt-gui.cpp) and get the context for the translatable strings right. It's not super-pretty (I'll admit that _("string literal") is much easier on the eye than translate("gettextFromC", "string literal") ) but I think this will be the price of success. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'file.c')
-rw-r--r--file.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/file.c b/file.c
index 130568245..a4b90129a 100644
--- a/file.c
+++ b/file.c
@@ -103,9 +103,9 @@ static int try_to_xslt_open_csv(const char *filename, struct memblock *mem, char
if (readfile(filename, mem) < 0) {
if (error) {
- int len = strlen(tr("Failed to read '%s'")) + strlen(filename);
+ int len = strlen(translate("gettextFromC","Failed to read '%s'")) + strlen(filename);
*error = malloc(len);
- snprintf(*error, len, tr("Failed to read '%s'"), filename);
+ snprintf(*error, len, translate("gettextFromC","Failed to read '%s'"), filename);
}
return 1;
@@ -300,9 +300,9 @@ void parse_file(const char *filename, char **error)
return;
if (error) {
- int len = strlen(tr("Failed to read '%s'")) + strlen(filename);
+ int len = strlen(translate("gettextFromC","Failed to read '%s'")) + strlen(filename);
*error = malloc(len);
- snprintf(*error, len, tr("Failed to read '%s'"), filename);
+ snprintf(*error, len, translate("gettextFromC","Failed to read '%s'"), filename);
}
return;