Add ICU syntax highlighting with XML
Describe the issue
In icu-message-format docs, there are useful icu-flags mentioned, but there is no explanation on how to use it.
I've tried icu-message-format,icu-flags:xml

but that didn't seem to work (icu syntax got highlighted, but XML tags didn't):

I already tried
- [X] I've read and searched the documentation.
- [X] I've searched for similar issues in this repository.
Steps to reproduce the behavior
–
Expected behavior
No response
Screenshots
No response
Exception traceback
No response
How do you run Weblate?
Docker container
Weblate versions
4.13.1
Weblate deploy checks
No response
Additional context
No response
Now I found this doc page from which it seems that icu-message-format,icu-flags:xml is truly correct.
However, it still doesn't work. Did I misunderstand something?
Ok, there are two problems:
- code blocks in docs are probably broken, because in source file on github, I can see the example (search for
icu-message-format, icu-flags:xml:-plural_selectors) -
icu-flags:xmldoes not work or does something else than I expect. Shouldn't it highlight HTML/XML tags in ICU syntax (like above)?
I think the xml flag has no effect on UI highlighting, it affects the check only. The documentation for check is here: https://docs.weblate.org/en/weblate-4.13.1/user/checks.html#check-icu-message-format
@nijel Thanks for response. But icu-message-format does UI highlighting, doesn't it? How do I recognize which check does and which one doesn't?
I found the docs, but as I mentioned above, the .. code-block::text is not transformed, it's removed, see:
Yes, it does, but there is no highlighting available for ICU+XML in PrismJS we use, thus the XML flag has no effect here. Once the highlighting would be available, it can be easily enabled in Weblate here:
https://github.com/WeblateOrg/weblate/blob/6b1083389871916a6c4cb9e26f1823c9250b5cdb/weblate/trans/models/unit.py#L1414-L1428
The docs should be fixed by 6b1083389871916a6c4cb9e26f1823c9250b5cdb, thanks for spotting.
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.