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

Mapping of Weblate read-only and "translatable" attribute in Android XML is inconsistent #13256

Open
2 tasks done
JustSwiftIt opened this issue Dec 11, 2024 · 1 comment
Open
2 tasks done
Labels
enhancement Adding or requesting a new feature.

Comments

@JustSwiftIt
Copy link

JustSwiftIt commented Dec 11, 2024

Describe the issue

The current mapping between Android's translatable attribute and the read-only state in Weblate seems inconsistent.

Android strings that were originally translatable="false":

The string is shown as read-only but the Tools dropdown still shows the menu item "Mark as read-only". This menu item can be toggled on and off, but does not seem to change anything . There seems to be no way to ever remove the read-only flag through Weblate.

Android strings that were originally translatable (i.e. did not have a translatable attribute)

For these strings, read-only can be turned on in Weblate. With PR #12697, this results in translatable="false" in the string resource in the repository. However, this happens only if the string has also been modified in Weblate prior to turning on read-only. And once that happens, there seems to be no way to ever remove that translatable="false" attribute anymore through Weblate.

I already tried

  • I've read and searched the documentation.
  • I've searched for similar filed issues in this repository.

Steps to reproduce the behavior

  1. Have an Android string resource with at least one string marked as translatable="false" and one without translatable attribute.
  2. Create a component that uses this file.
  3. Attempt to turn read-only off or on on those strings.

Expected behavior

Turning off read-only via Weblate...

  • is possible on strings that were translatable="false" in the original XML (and the Tools menu correctly reflects the current state).
  • results in removal of the translatable="false" attribute in the XML.

Turning on read-only via Weblate...

  • results in translatable="false" in the XML.

In all cases, a commit should be created for the change of read-only, even if the string is not otherwise modified.

Screenshots

Screenshot when translatable was false on import

Exception traceback

No response

How do you run Weblate?

Docker container

Weblate versions

5.8.4 / 5.9-dev

Weblate deploy checks

No response

Additional context

No response

@nijel
Copy link
Member

nijel commented Dec 13, 2024

As most formats do not support this state, Weblate tracks it internally by read-only flag. This is what the Tools menu toggles. Later 5e11486 introduced support for writing this state out, but it was not really written in way that it would allow removing the flag.

@nijel nijel added the enhancement Adding or requesting a new feature. label Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Adding or requesting a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants