-
-
Notifications
You must be signed in to change notification settings - Fork 955
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
Support explanation attribute for Android string resources #11351
Comments
Have you tested that native Android tools (such as lint) won't have problems with additional attributes? |
Yes. I've checked:
|
Sounds good, we're already supporting |
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. |
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: