mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
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>
This commit is contained in:
parent
2d69d4a5ef
commit
193d20c479
14 changed files with 184 additions and 182 deletions
8
file.c
8
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue