scelis / twine

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

Generating Android Strings File and Consuming Deletes Parts of Strings #244

Closed danl3v closed 6 years ago

danl3v commented 6 years ago

If you're reporting a bug, please do the following:

Version 1.0.3

twine.txt

[[Header]]
    [S_Test]
        en = Hello <b>BOLD</b>
    [S_Test2]
        en = Hello <b>%@</b>

twine generate-localization-file twine.txt en.xml --format android

which generates ====>

<?xml version="1.0" encoding="utf-8"?>
<!-- Android Strings File -->
<!-- Generated by Twine 1.0.3 -->
<!-- Language: en -->
<resources>
    <!-- SECTION: Header -->
    <string name="S_Test">Hello <b>BOLD</b></string>
    <string name="S_Test2">Hello &lt;b>%s&lt;/b></string>
</resources>

Then run: twine consume-localization-file twine.txt en.xml

I expect to get the same file back, but I get this:

[[Header]]
    [S_Test]
        en = `Hello `
    [S_Test2]
        en = Hello <b>%@</b>

This impacts the ability to use these scripts to hand strings off to a loc team that consumes the android format and returns them in android format.

sebastianludwig commented 6 years ago

Hey danl3v, thank you very much for the very detailed bug report - a pleasure to fix these things 👍

I just submitted a PR fixing the issue. See #247 for details

danl3v commented 6 years ago

Thank you so much!

scelis commented 6 years ago

@danl3v Mind checking to see if this is now working for you in master? I'm happy to tag a new build if things seem better for you, now.

P.S. 👋

danl3v commented 6 years ago

Hey Seb. I will check this out. Currently on PTO but will see if we can upgrade when I return. How are things?? Hope you and he family are doing great

danl3v commented 6 years ago

@scelis Just tested and things seem to be working! A new tag would be awesome. Thank you!

danl3v commented 6 years ago

<3 @scelis