E-mail List Archives

Re: Bilingual Button

for

From: Chaals McCathie Nevile
Date: Sep 29, 2015 11:09AM


On Tue, 29 Sep 2015 21:29:03 +0500, Chaals McCathie Nevile
< <EMAIL REMOVED> > wrote:

> On Tue, 29 Sep 2015 20:59:42 +0500, Moore,Michael (Accessibility) (HHSC)
> < <EMAIL REMOVED> > wrote:
>
>> We have a web application that presents bilingual forms
[snip]
>> ... I do not believe that there is a valid method for properly
>> indicating two separate languages within the same button. Example:
>> <input type="submit" value="Submit/Guardar" />. So is it possible to
>> create a single button that will have correct language attributes for
>> two languages?
>
> Nope. Not unless you use the switch element in SVG, and I am not sure if
> you can do it even then - especially in practice.

I did a very simplistic bit of testing. On at least Yandex browser and
Vivaldi - so probably other Chromium-based browsers, and on Friefox and
Safari the following seems to work:

<html>
...
<body>
...
<svg>
<switch>
<!-- tests for language support -->
<foreignObject width="100" height="50" y="70" systemLanguage="zh">
<button>Voici des mots en français</button>
</foreignObject>
<foreignObject width="100" height="50" y="70" systemLanguage="es">
<button>Palabras castellanas</button>
</foreignObject>
<foreignObject width="100" height="50" y="70" systemLanguage="en">
<button>english words</button>
</foreignObject>
</switch>
</svg>
...

Although Firefox seems to take any systemLanguage that matches *a*
supported language, whereas Yandex matches the user's preferred language.
Some bugs to be filed…

…and be aware that even if you do the systemLanguage detection, you may
find that many users who speak spanish are using an english setup - this
is why many browsers ignore the system's language for practical purposes
if they get a hint from some other information.

cheers

--
Charles McCathie Nevile - web standards - CTO Office, Yandex
<EMAIL REMOVED> - - - Find more at http://yandex.com