1

I'm making an accessible Dutch language website. As a rule variable names in code are in English because not all programmers are Dutch natives. Do any of the attributes of input fields have to be in Dutch to be usable by a Dutch screenreader and compliant with WCAG?

Below is an example of a labelled radio-group:

<fieldset>
    <legend>Geef neerslag door:</legend>
    <div class="form-div" id="rainfall">
        <input type="radio" id="no-rain" name="rainfall" value="none" />
        <label for="no-rain">geen neerslag vandaag</label><br/>
        <input type="radio" id="catsndogs" name="rainfall" value="catsndogs"/>
        <label for="catsndogs">regen regen regen</label><br/>
    </div>
 </fieldset>
1

No, attribute values for things like IDs etc. can be anything you want them to be, even cryptic thinks like a1 or xA8453jkfdj-0fjd.

As for attributes themselves, only English ones exist, you couldn't change value="something" to waarde="iets" as it wouldn't be valid. (I used Google translate so the Dutch may not make any sense but you get the idea!)

As long as every label, value, aria-label, etc. has a value that is in Dutch, the site will be perfectly accessible.

Just remember to set your lang attribute on the HTML element!

2
  • Just to understand this completely: value, at least in case of inputs, is what is send to the server. So if that is only handled by software, then value too should be in English, right? Or are you saying that the value of the radio-buttons should also be in Dutch?
    – Ivana
    Nov 3 '20 at 15:06
  • Well the value on a text input is whatever text is within in it so could be set on page load, that is why I mentioned that. For radio button values those can be whatever, sorry if that was confusing. Basically values that people say the direct result of changing it. Nov 3 '20 at 15:23
1

I am not sure whether I am answering this question or not but I think this is not the right way for doing things in internationalization scenario.

I will suggest to have one i18n file for all pages like below:

some_prefix_rainfall_legend=Geef neerslag door:
some_prefix_rainfall_none=geen neerslag vandaag
some_prefix_rainfall_catsndogs=regen regen regen

And use following code to render the UI:

<fieldset>
    <legend>${some_prefix_rainfall_legend}</legend>
    <div class="form-div" id="rainfall">
        <input type="radio" id="no-rain" name="rainfall" value="none" />
        <label for="no-rain">${some_prefix_rainfall_none}</label><br/>
        <input type="radio" id="catsndogs" name="rainfall" value="catsndogs"/>
        <label for="catsndogs">${some_prefix_rainfall_catsndogs}</label><br/>
</div>
</fieldset>

I haven't provided example for language specific code but this should be the idea so that :

  1. Labels can be translated to any other language without code change in future.
  2. For all developers, it is easy and fast to code with English(universal) variables and one should not have language problem while giving labels.

Thanks.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.