Skip to content

Use more sensible default keyboard for es_US

Georges Basile Stavracas Neto requested to merge gbsneto/es-us-intl into master

This is fairly edge casey, but at Endless we've been shipping laptops to native Spanish speakers in the US, and these laptops have the standard US keyboard. To be able to meaningfully write in the Spanish language, it is necessary for the keyboard to treat special keys as dead keys. There is a locale to represent Spanish-speaking US, 'es_US', but sadly we don't pick a sensible keyboard for this locale, because:

  • 'default_input_sources' does not list es_US, so no curated keyboard is returned by gnome_get_input_source_from_locale()

  • Passing 'es_US' to gnome_xkb_info_get_layouts_for_language() returns us various combinations of {'es', 'latam'} x {'colemak', 'nodeadkeys', ...}

  • gnome_xkb_info_get_layouts_for_country() lists a bunch of 'latam' derived keymaps.

None of these options actually return us the (likely) most appropriate layout, 'us+intl', which is the US keyboard but special characters are dead keys, which in turn allows Spanish speakers to write characters such as ñ.

Hardcode 'es_US' in 'default_input_sources' to be 'us+intl'.

Merge request reports