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

Add support for read only state in exporters #4902

Open
adriandiazgar opened this issue Nov 23, 2020 · 4 comments
Open

Add support for read only state in exporters #4902

adriandiazgar opened this issue Nov 23, 2020 · 4 comments
Labels
backlog This is not on the Weblate roadmap for now. Can be prioritized by sponsorship. enhancement Adding or requesting a new feature.

Comments

@adriandiazgar
Copy link

Describe the bug

When a string.xml for Android is uploaded to weblate, it considers the "translatable" attribute of the node and it makes the unit "read-only" which is OK.

The problem comes when downloading the file that doesn't contain the "translatable" attribute anymore which leads to being translatable again if the downloaded file is uploaded again.

To Reproduce the bug

Description should look similar to this:

Steps to reproduce the behavior:

  1. Upload file to an Android project like
<?xml version="1.0" encoding="utf-8"?>
<resources>
       <string name="app_name" translatable="false">this should be read only</string>
</resources>
  1. Navigate to the project and click on download file
    the content will look like
<?xml version="1.0" encoding="utf-8"?>
<resources>
       <string name="app_name">this should be read only</string>
</resources>

Expected behavior

Keep the read-only attribute after download it from weblate like:

<?xml version="1.0" encoding="utf-8"?>
<resources>
       <string name="app_name" translatable="false">this should be read only</string>
</resources>
@nijel
Copy link
Member

nijel commented Nov 23, 2020

I guess that you are downloading converted file instead of taking original. Is there any good reason for that?

The converters do not currently support flagging read only strings.

@nijel nijel changed the title Android translatable not exported Add support for read only state in exporters Nov 23, 2020
@nijel nijel added backlog This is not on the Weblate roadmap for now. Can be prioritized by sponsorship. enhancement Adding or requesting a new feature. labels Nov 23, 2020
@github-actions
Copy link

This issue has been added to the backlog. It is not scheduled on the Weblate roadmap, but it eventually might be implemented. In case you need this feature soon, please consider helping or push it by funding the development.

@adriandiazgar
Copy link
Author

Thanks for the quick response

Oh, I see @nijel yeah, it makes sense, I was downloading a converted version of it without thinking about downloading the original file.

But this brings me to wonder why there is a conversion step when the original file is Android and the requested file type is Android, would it make more sense to download directly the original file if the requested format is the same?

@nijel
Copy link
Member

nijel commented Nov 23, 2020

There is no additional logic in place = it gives you whatever you've requested. It still might make sense in some situations because the exported files can contain additional data such as comments or suggestions which are (for good reasons) not present in the original files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog This is not on the Weblate roadmap for now. Can be prioritized by sponsorship. enhancement Adding or requesting a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants