i have a website which is written in German language. Inside I have some words like Tag which should be spoken by screen reader in there native language. My Problem is that I don´t want for every word like "tag" use

<span lang="en">Tag</span>>

Is there a way to define this like a Dictionary for special words which should spoken in English?

有帮助吗?

解决方案

No, there is no other way to declare the language of individual words than wrapping each word in an element and setting the lang attribute on it. You might be able to generate such markup programmatically, but this depends on your data, the exact definition of how words should be marked up, and the technologies available.

On the other hand, speech browsers often ignore lang attributes or implement them oddly. Switching to a different language in the midst of a sentence might produce something disruptive. So do some testing to check whether the lang markup really helps, before spending time and effort on generating it.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top