WeblateOrg / WeblateOrg/weblate

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

Open
#13,256 1 comment 0 reactions 0 assignees View on GitHub
enhancement Waiting for: Demand
Dominant language
Python
Stars
6.1k
Forks
1.4k
Avg merge
9h 53m
Merged PRs (30d)
395

Description

### 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

- [X] I've read and searched [the documentation](https://docs.weblate.org/).
- [X] 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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.