scelis / twine

Twine is a command line tool for managing your strings and their translations.
Other
840 stars 151 forks source link

gs "translation" is added when doing consume-all-localization-files #250

Closed alejandrodau closed 6 years ago

alejandrodau commented 6 years ago

On twine 1.0.3 on ubuntu xenial, if I have a twine.txt file like:

[[Uncategorized]]
    [some_text]
        en = this is some text
        es = un texto
    [another_text]
        en = this is another text

If I run:

mkdir outdir
cp twine.txt twine.txt.old
twine generate-all-localization-files twine.txt ./outdir -i untranslated -f gettext -r
twine consume-all-localization-files twine.txt ./outdir  -f gettext
diff -u twine.txt.old twine.txt

I get:

--- twine.txt.old   2018-05-30 19:37:15.016963295 +0000
+++ twine.txt   2018-05-30 19:41:32.079776386 +0000
@@ -4,3 +4,4 @@
        es = un texto
    [another_text]
        en = this is another text
+       gs = this is another text

(a line for the "gs" language is added in the line that lacks "es" translation, when I expected the twine.txt to remain unchanged)

sebastianludwig commented 6 years ago

I've opened a PR fixing the issue.

Edit: Oh, and thanks for the great and detailed bug report! :-)