Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Language support (Feature request) #4923

Closed
webjohan opened this issue Sep 19, 2016 · 3 comments
Closed

Language support (Feature request) #4923

webjohan opened this issue Sep 19, 2016 · 3 comments

Comments

@webjohan
Copy link

Language support would be nice to have. And when looking at "Accessibility improvements #3210" this opens the perfect opportunity for this.
Work with WCAG requires title and alt attributes. All these text strings needs to be added. Why not put all these text strings in a common file and make additions for language?

@mourner
Copy link
Member

mourner commented Sep 22, 2016

Can you be more specific?

@webjohan
Copy link
Author

First a small correction. WCAG does not need title AND alt attributes. There are several techniques to pass WCAG validation.

But I'll give you an example.

Go to:
http://leafletjs.com/

On the first page there is a map with a pin and a small "popup" window. In the upper right corner there is a close button "X". To make that close button WCAG compliant you'd need to add (something like) a aria-label attribute (or title attribute).
Lets say that aria-label="Close" will be good enough for this. That text string can be added to the code in two ways, hard coded or via a variabel defined in a language.js file.
If you have a multi language site you'd want to have the option to have German, Swedish or . Something like this example: getTranslatedString("leaflet.close.button", "en-uk") or getTranslatedString("leaflet.close.button", leaflet.lang) (leaflet.lang being global and easily changeable on the fly, if a user changes language)

If work with "Accessibility improvements #3210" is going to be done. This would be an perfect opportunity to implement multi language support as well.

@mourner
Copy link
Member

mourner commented Jul 27, 2018

Currently the convention for this is passing text as options of a particular class. Examples with zoom control: https://leafletjs.com/reference-1.3.2.html#control-zoom

We have no plans to introduce a more sophisticated i18n system to keep things simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants