Provide a way to specify the user's preferred languages
The systemLanguage
attribute can be used, for example, in a <switch>
, to select between elements that should only be shown depending on the user's language preferences.
Currently librsvg considers "the user's language preferences" to come from the environment; on Unix this is the LANG
and LC_MESSAGES
environment variables. There's no other way to specify different language preferences.
However, the web world has moved to using BCP47 language tags. With a special syntax, these get used in the Accept-Languages
HTTP header. It would be nice if an SVG rendering service that uses librsvg could pass on the user's Accept-Languages
down to librsvg.
We need something like rsvg_handle_set_accept_languages(handle, accept_languages_list)
. There are already Rust crates that can parse that HTTP header, including its weights for each specific language.