Support explanation attribute for Android string resources #11351
Labels
backlog
This is not on the Weblate roadmap for now. Can be prioritized by sponsorship.
enhancement
Adding or requesting a new feature.
help wanted
Extra attention is needed.
Describe the problem
As far as I can tell -- based on reading https://docs.weblate.org/en/latest/formats.html#format-explanation and https://docs.weblate.org/en/latest/formats.html#format-description -- there's no clear mechanism for adding an explanation for a string's usage to Android string resources.
Describe the solution you would like
Since Android string resources are XML you could define a Weblate specific namespace for Weblate-supported attributes. Then Android string resources could declare this namespace and add Weblate-specific attributes for each string.
For example:
Describe alternatives you have considered
Adding a comment to the string, e.g.,
is quite fragile; for example, if Android string resources are moved between different Android project modules it's easy for the comments that are "attached" to the string to get lost.
Since XML provides a standardised mechanism for additional metadata to be attached to elements it seems sensible to use that mechanism, instead of inventing new ad-hoc approaches.
Screenshots
No response
Additional context
This is prompted by noticing translation mistakes in my project. For example, I have a string that looks like this in the source language:
The comment's to provide additional context to translators for the contents of the two placeholders (exactly what I'd use the explanation for).
In practice I've seen translators inadvertently corrupt this, so for example the translation becomes:
(i.e., the comment markers are stripped and the comment becomes visible text in the app's UI)
The text was updated successfully, but these errors were encountered: