How do you handle translation of text with markup?

前端 未结 6 1370
既然无缘
既然无缘 2020-12-23 10:04

I\'m developing multi-language support for our web app. We\'re using Django\'s helpers around the gettext library. Everything has been surprisingly easy, except for the ques

6条回答
  •  别那么骄傲
    2020-12-23 10:30

    Disclaimer: I am not experienced in internationalization of software myself.

    1. I don't think this would be good in any case - just introduces too much coupling …
    2. As long as you keep formatting sparse in the parts which need to be translated, this could be okay. Giving translators the possibility to give special words importance (by either making them a link or probably using emphasis sounds like a good idea. However, those translations with (X)HTML possibly cannot be used anywhere else easily.
    3. This sounds like unnecessary work to me …

    If it were me, I think I would go with the second approach, but I would put the URI into a formatting parameter, so that this can be changed without having to change all those translations.

    Please log in to continue.
    

    You should keep in mind that you may need to teach your translators a basic knowledge of (X)HTML if you go with this approach, so that they do not screw up your markup and so that they know what to expect from that text they write. Anyhow, this additional knowledge might lead to a better semantic markup, because, as mentioned above, texts could be translated and annotated with (X)HTML to reflect local writing style.

提交回复
热议问题