What is a correct approach to using strong/em tags when localising strings?

前端 未结 4 1903
Happy的楠姐
Happy的楠姐 2021-01-12 18:41

I know some languages emphasise words differently to English, e.g. via changing word endings rather than stressing words with inflection of the voice.

If you are lo

相关标签:
4条回答
  • 2021-01-12 19:15

    Interesting question! The only thing I can add is that strong and em tags are only useful for SEO if the search engines connect those tags with the content on your site.

    I'd recommend using these tags only if there's an actual reason (for emphasis, say) rather than hoping to gain SEO benefit from bolding or italicizing keywords.

    0 讨论(0)
  • 2021-01-12 19:26

    For individual words, I would leave the markup tags in the translation strings for the reasons outlined in comments above. If emphasising blocks of text, whole sentences, numerals, etc, I'd put it in the template if possible as it's not really something that would need to be be messed with by the translation.

    A good idea might be to flag in the template the you have done this using comments. You will also need some reliable process for getting all the translation files changed if you decide to alter the emphasis ever (which you inevitably will). This is a pain, so I tend to avoid adding emphasis to individual words wherever possible :)

    0 讨论(0)
  • 2021-01-12 19:32

    Mark-up is there to convey meaning a whole, and so long as the meaning is conveyed, you have succeeded in your mark-up. So in a language where stress emphasis is conveyed in the text, using tags to signal the emphasis is redundant and optional.

    Inline level markup, much more so than block level markup, may need to be radically different in different languages. In a good translation, the text should be marked up from scratch in each language.

    0 讨论(0)
  • 2021-01-12 19:36

    For screen readers, it comes down to what language you are talking about. JAWS for example, you can download voice files. If it isn't listed, then they have to have to choose another language or find alternative means. The key thing is for you to set the lang attribute correctly.

    0 讨论(0)
提交回复
热议问题