-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix, CI] Push to Transifex from master, fix multiline strings for xgettext #5238
Conversation
90221f9
to
ff336ec
Compare
It looks like you need a workflow for this context stuff. The docs don't really say so: https://circleci.com/docs/2.0/contexts/#creating-and-using-a-context But https://discuss.circleci.com/t/contexts-feedback/13908/12 So, annoying. :-) |
Curious fact: three new strings seem to have shown up: They look like they're actually typos: Line 924 in fbd331d
koreader/frontend/apps/cloudstorage/ftp.lua Line 155 in fbd331d
koreader/frontend/apps/cloudstorage/dropbox.lua Lines 128 to 129 in fbd331d
Edit: no scratch that, of course _"string" is a valid function invocation. Only the util one is a typo. |
Unfortunately so. xgettext apparently doesn't do koreader/koreader-misc@d72e711 Browsing through the xgettext test cases they don't actually properly test newlines. Perhaps it's really easy to patch. x-lua.c says things like this (but that's for multiline comments). I'll check some more tomorrow. /* Ignore leading spaces and tabs. */
if (buflen == 0 && (c == ' ' || c == '\t'))
continue; |
@poire-z I wrote this proof of concept patch for xgettext: diff --git a/gettext-tools/src/x-lua.c b/gettext-tools/src/x-lua.c
index 3a2296f36..1eed3dccc 100644
--- a/gettext-tools/src/x-lua.c
+++ b/gettext-tools/src/x-lua.c
@@ -740,6 +740,18 @@ phase3_get (token_ty *tp)
string_start ();
+ /* Ignore the first newline after '[[' because so does Lua. */
+ c = phase1_getc ();
+ if (c == '\\')
+ {
+ c = phase1_getc ();
+ if (c != 'n')
+ {
+ string_add ('\\');
+ string_add (c);
+ }
+ }
+
for (;;)
{
c = phase1_getc (); |
Kudos for following that ugly coding style :) |
You're right, there's something very wrong there. :-D |
But re-reading that snippet, you were indeed re-adding them if they were not |
I massively overthought the buffer. Apparently this suffices: diff --git a/gettext-tools/src/x-lua.c b/gettext-tools/src/x-lua.c
index 3a2296f36..262f688cc 100644
--- a/gettext-tools/src/x-lua.c
+++ b/gettext-tools/src/x-lua.c
@@ -740,6 +740,13 @@ phase3_get (token_ty *tp)
string_start ();
+ /* Ignore the first newline after '[[' because so does Lua. */
+ c = phase1_getc ();
+ if (c != '\n')
+ {
+ string_add (c);
+ }
+
for (;;)
{
c = phase1_getc (); _([[
only two newlines]])
_([[
tab two newlines]])
_([[
space two newlines]])
_([[just one line]])
|
Yes, I was missing something like an else condition in the above but I was too focused on my specific "should eat newline" scenario. :-) |
Anyway, I'll look into reporting the bug and hopefully the maintainer can rewrite it properly in less than a minute if necessary. From the README:
|
@poire-z Alright, I noticed another function. :-P diff --git a/gettext-tools/src/x-lua.c b/gettext-tools/src/x-lua.c
index 3a2296f36..e0dd99709 100644
--- a/gettext-tools/src/x-lua.c
+++ b/gettext-tools/src/x-lua.c
@@ -740,6 +740,13 @@ phase3_get (token_ty *tp)
string_start ();
+ /* Ignore the first newline after '[[' because so does Lua. */
+ c = phase1_getc ();
+ if (c != '\n')
+ {
+ phase1_ungetc (c);
+ }
+
for (;;)
{
c = phase1_getc (); That way the character is actually processed properly by the rest of the code; of course it shouldn't be just blindly added. |
Isn't there a |
This pattern seems to be more or less how the rest of the code does it, for example: else
{
/* Minus sign. */
phase1_ungetc (c);
return '-';
} Edit: anyhow, submitted |
See koreader/koreader#5238 (comment) Even if a fix is implemented upstream soon, it'd be years before we could use a precompiled binary anyway.
See koreader/koreader#5238 (comment) Even if a fix is implemented upstream soon, it'd be years before we could use a precompiled binary anyway.
Because let's face it, it just looks much better this way. Docker image update in koreader/virdevenv#43 Discussion in koreader#5238 (comment) and koreader#4524
Because let's face it, it just looks much better this way. Docker image update in koreader/virdevenv#43 Discussion in koreader#5238 (comment) and koreader#4524
Because let's face it, it just looks much better this way. Docker image update in koreader/virdevenv#43 Discussion in koreader#5238 (comment) and koreader#4524
) Because let's face it, it just looks much better this way. Docker image update in koreader/virdevenv#43 Discussion in #5238 (comment) and #4524
…reader#5242) Because let's face it, it just looks much better this way. Docker image update in koreader/virdevenv#43 Discussion in koreader#5238 (comment) and koreader#4524
Related to #5237