I’d like to change the language selected from the dropdown component from ‘español’ to ‘Español’. It automatically comes as lowercase but one of my Latino coworkers enlightened me after I presented a project which includes that component and said that it should be capitalized. But it wont just let me edit it, I have to do some sort of property change in the scripting portion of that component
Interestingly, español
(lowercased) is how Java’s built in locale information suggests Spanish should be rendered in Spanish; we're relying on this Java method under the hood.
What might be the easiest thing to do would be to create your own dropdown list/combobox and just ignored the language selector entirely. You can use system.util.setLocale
to switch the client locale from a property change script yourself.
Consider running a quick search on the web for if español should be capitalized to save yourself some coding time.
That’s an orthographic rule.
Spanish orthography has names of languages written in lowercase as you observed. Java’s Local.getDisplayLanguage
returns the correct orthography and translation for the locale.
So the French language returned for locale Spain would be “francés”, German as “Französisch”, and English as “French”.
However other orthographic rules overrides this. Spanish orthography capitalizes only the first letter in titles, so “francés” would need to be modified to “Francés” as shown below. In other words, you can’t just accept the output as is even within orthography.
When it comes to UI, that’s governed by style guides, with the aim of consistency. Some sites have dropdown items all in lowercase, some have everything in uppercase eg.
Here’s some screenshots for the word “Español” as they appear for various locale:
Locale: Spain
Ubuntu
Spanish Government:
https://administracion.gob.es/
Local: US
Gmail:
Google Maps: Note the 4 languages of Spain are listed with different cases as: Español, catalá, euskara, galego
, compare this with the Government site of Spain above.