WeblateOrg / WeblateOrg/weblate

<xliff:g> placeholder tag in Android string xml does not seem to be supported

Open
#7,473 4 comments 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

https://developer.android.com/guide/topics/resources/localization#mark-message-parts

> #### Mark message parts that should not be translated
>
> Often strings contain text that should not be translated into other languages. Common examples might be a piece of code, a placeholder for a value, a special symbol, or a name. As you prepare your strings for translation, look for and mark text that should remain as-is, without translation, so that the translator doesn't change it.
>
> To mark text that should not be translated, use an placeholder tag. Here is an example tag that ensures the text "%1$s" isn't changed during translation (otherwise it could break the message):
>
>
> ```xml
>
> %1$s until holiday
>
> ```

I followed the document to add xliff tags to my strings.xml, however in weblate, it displays the tag directly.

Android string XML:
https://github.com/RikkaApps/WADB/commit/21aa666e25fff327692563766904d1ca69eb22b1

```xml

The translation is contributed by %1$s.

This software is open source (%1$s) under %2$s.
```

Weblate project for this issue:
https://hosted.weblate.org/translate/wadb/application/zh_Hans/?checksum=f73c41765043693f

### I already tried

- [X] I've read and searched [the documentation](https://docs.weblate.org/).
- [X] I've searched for similar issues in this repository.

### Steps to reproduce the behavior

1. Add some xliff tags for Android string xml
2. Check weblate
3. See the "error"

### Expected behavior

Weblate displays xliff tags as some sort of comment instead of displaying the tag directly.

### Screenshots

image

### Exception traceback

_No response_

### How do you run Weblate?

weblate.org service

### Weblate versions

_No response_

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