Internalization for Spanish
Internalization is a big word, so I will use i18n for this article. If you are reading this, you understand English. But a lot of people in the world doesn't speak this language. I'm writing this to motivate you to translate your amazing apps, so more people could use them. I'm a native speaker in Spanish, so I will tell you about my experience.
If you want to write your app for another language, I recommend you to save the Strings in a file, so you can change this easily and access them later. I will share with you a few tips.
Dates
If you are from the United States of America (USA), you use the format Month - Day - Year. To be honest, this could be confusing for other countries, because we use Day - Month - Year. Just consider telling what format are you using.
Example of date birth
Fecha nacimiento:
<input type="date" name="cumpleanios" step="1" min="2013-01-01" max="2013-12-31" value="2013-01-01">
Names
In the USA, you are asked a middle name and surname. But in other countries when we talk Spanish, we can have two names, but not always and it's not the same than a middle name. My name is only Karina. Also, we use two surnames, the first from our father and the second from our mother. We need two surnames. They are called "Apellidos".
Example of form for name.
<p>Nombre: <input type="text" name="nombre" placeholder="Nombre"></p>
<p>Apellidos: <input type="text" name="apellidos" size="40" placeholder="Apellidos"></p>
URL
We have accents and ñ. Unfortunately, you can't use them in URLs. Example, year in Spanish is "Año", but because you can't use the ñ, you could replace for "Ano". Don't. This translates to asshole. You will have to use another word for your URL. If you need to use some word with ñ, replace it with ni. Using my example, Año to Anios instead of Anos.
GOOD
www.karinarobledo.me/anios
BAD
www.karinarobledo.me/anos
Words meaning different things in different countries
There's a lot of countries that speak Spanish, but even we speak the same language, we have differences in our language. One word could be a bad word in one country and a common word in other. One example is "Tortillera", in Spain means lesbian, while in Mexico means a person who makes tortillas. Just be careful.
Well, this it's the end. I hope it helps you to understand the differences in another language. In the past, I had to make changes in an enormous file, but now there's more support for configuration in other languages. As a developer, I'm thankful.
Top comments (25)
Now in Spain you can choose the order of first and second surnames for your sons from father and mother first surname. Then you should use
Primer Apellido
andSegundo Apellido
insteadApellido Materno
andApellido Paterno
. Also to respect lgtbi sons :)I find its just easier to say "Nombres" and "Apellidos"
You can never know these days how many people have.
It depends :)
In Spain a lot of databases store first and second surname into differents columns.
On frontend forms, first surname is required and second is optional.
On regular communications we use name and first surname for greeting.
yeah.. but I just wouldn't complicate my software. Sometimes I even just have a single "Full name" if I don't need to separate.
there are scenarios where I want to know your maternal/paternal heritage, but in general I don't care. I just want to know how to show your name on the screen.
Yes, but a lot of times is not your software, is only the software that you code ;)
Oh, cool! In Mexico, I'm not sure if we have that. They should do this in all the countries. I wish my government did this too.
Muy buen post y tips 😊 fue muy graciosa la explicación de "Tortillera".
¡Gracias! No sabía que habían personas que hablan Español aquí 😃
🇲🇽🤘🏼
Creo que algunos hehe, también me acabo de dar cuenta 😆
¡Buen artículo! On the subject of names:
Apparently, developers get names wrong alot. I recently saw this on Twitter; had to re-think my validations:
Edit: oh, and in fact, while in the subject of Spanish, there is this great Cuban musician named X Alfonso. First name X. How cool is that? Let's not exclude him from our apps either:
Yes! My friend name is Teresita del Niño Jesús, too long for apps.
Thank you!
Recently I watched this video youtube.com/watch?v=0j74jcxSunY it explains the issues with i18n pretty well!
Oooh, Computerphile featuring Tom Scott! I approve this message!
By the way, you can make embedded videos visible on Dev.to! Just put this in the editor and replace VIDEO_ID with the.. you know, video ID:
{% youtube VIDEO_ID %}
You can do that with more than YouTube embeds, too! Check out their short editor guide for more goodies.
Wow, thank you! didn't know you could do that :D
Thank you for sharing that video!
Hi Karina.
Good to know how its handled in Spanish. I wrote a blog post dev.to/sanketmaru/whitespaces-are-... on similar lines on how Angular handles i18n and some gotchas like whitespaces , names. Do check it out
Thank you! I'll check it out
Hi Karina, great article and very helpful to anyone interested in i18n for our beautiful language!
Also a trouble saver is setting the proper character encoding in the database to avoid problems with the spanish accented letters (áéíóúü) and the ñ.
For MySQL I'd reccomend utf8mb4_unicode_ci, since it's the only one that guarantees full UTF character coverage (even for emojis!). There's a great article about that here: mathiasbynens.be/notes/mysql-utf8mb4
Muy bueno amiga.
¡Gracias Carlos!
Muy buen articulo.
¡Muchas gracias!
Thank you Yuma!
¡Muy buen post! i18n siempre ha sido un tema muy interesante para mi.
Keep 'em coming!