Skip to content
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

CDATA support in Android #4320

Closed
nijel opened this issue Apr 18, 2021 · 4 comments · Fixed by #5145
Closed

CDATA support in Android #4320

nijel opened this issue Apr 18, 2021 · 4 comments · Fixed by #5145
Assignees

Comments

@nijel
Copy link
Member

nijel commented Apr 18, 2021

Right now the Android strings format does not deal with CDATA. This breaks quotes as it applies unquoting to it's content.

See WeblateOrg/weblate#1211 (comment) for more details.

See https://lxml.de/api.html#cdata for LXML documentation on the topic.

@rwrx
Copy link

rwrx commented Aug 24, 2023

Hello @nijel unfortunately we do have the same problem with Android XML strings which does contain HTML markup. For example we do have this XML string:

<string name="dialog_storage_permission_info" formatted="false"><Data><![CDATA[
    <html><head>
      <style type=\"text/css\">
        body { margin: 0px; }
      </style></head><body>
      <div style=\"background-color: transparent; color: %1$s; padding: %2$dpx;\">
        <p>This app requires <strong>permission to access all files</strong> on the storage.</p>
        <p>This permission <strong>allows</strong> this app to <strong>open</strong> and <strong>save</strong> files <strong>anywhere</strong> on the <strong>storage</strong>.</p>
        <p>This app <strong>only access files</strong> you are <strong>opening</strong> or <strong>saving</strong>.</p>
        <p>It does <strong>NOT access</strong> any other <strong>files</strong> on the <strong>storage</strong>.</p>
      </div>
    </body></html>
    ]]></Data>
</string>

And in Weblate it is shown this way:

screenshot

Which is very hard for translator to translate. Do you have some news for this issue? We would very appreciate if it will be possible to show these kinds of strings as they are raw XML or HTML.

Thank you a lot for creating Weblate, it is a great tool for translations.

@rwrx
Copy link

rwrx commented Nov 8, 2023

@nijel If I could ask, are there some bounties for implementing or fixing this specific issue? We will give bounty for this issue as it is very important for us.

@nijel
Copy link
Member Author

nijel commented Nov 9, 2023

@rwrx There is no generic bounty tool on this repo (if you have some recommendation on this, please let me know). You can reach out Weblate team at care@weblate.org if you are interested in funding a feature.

@rwrx
Copy link

rwrx commented Nov 9, 2023

@nijel Thank you a lot. I have written an e-mail.

@nijel nijel self-assigned this Dec 20, 2023
nijel added a commit to nijel/translate that referenced this issue Dec 20, 2023
Preserve CDATA in round-trip and expose that to translators.

Fixes translate#4320
nijel added a commit to nijel/translate that referenced this issue Dec 20, 2023
Preserve CDATA in round-trip and expose that to translators.

Fixes translate#4320
nijel added a commit that referenced this issue Dec 20, 2023
Preserve CDATA in round-trip and expose that to translators.

Fixes #4320
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants