DEV Community

Karina
Karina

Posted on

Tips of i18n for Spanish

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)

Collapse
 
lito profile image
Lito

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 and Segundo Apellido instead Apellido Materno and Apellido Paterno. Also to respect lgtbi sons :)

Collapse
 
aminmansuri profile image
hidden_dude

I find its just easier to say "Nombres" and "Apellidos"

You can never know these days how many people have.

Collapse
 
lito profile image
Lito

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.

Thread Thread
 
aminmansuri profile image
hidden_dude

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.

Thread Thread
 
lito profile image
Lito

Yes, but a lot of times is not your software, is only the software that you code ;)

Collapse
 
robledokari profile image
Karina

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.

Collapse
 
hangouh profile image
Hugo Hernández Valdez

Muy buen post y tips 😊 fue muy graciosa la explicación de "Tortillera".

Collapse
 
robledokari profile image
Karina

¡Gracias! No sabía que habían personas que hablan Español aquí 😃

Collapse
 
david_ojeda profile image
David Ojeda

🇲🇽🤘🏼

Collapse
 
hangouh profile image
Hugo Hernández Valdez

Creo que algunos hehe, también me acabo de dar cuenta 😆

Collapse
 
ulitroyo profile image
Uli Troyo • Edited

¡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:

Collapse
 
robledokari profile image
Karina

Yes! My friend name is Teresita del Niño Jesús, too long for apps.

Thank you!

Collapse
 
andres profile image
Andrés Pérez

Recently I watched this video youtube.com/watch?v=0j74jcxSunY it explains the issues with i18n pretty well!

Collapse
 
ulitroyo profile image
Uli Troyo

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.

Collapse
 
andres profile image
Andrés Pérez

Wow, thank you! didn't know you could do that :D

Collapse
 
robledokari profile image
Karina

Thank you for sharing that video!

Collapse
 
sanketmaru profile image
Sanket Maru

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

Collapse
 
robledokari profile image
Karina

Thank you! I'll check it out

Collapse
 
koas profile image
Koas

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

Collapse
 
juancarlospaco profile image
Juan Carlos

Muy bueno amiga.

Collapse
 
robledokari profile image
Karina

¡Gracias Carlos!

Collapse
 
salcidogrijalva profile image
Salcido Grijalva

Muy buen articulo.

Collapse
 
robledokari profile image
Karina

¡Muchas gracias!

Collapse
 
robledokari profile image
Karina

Thank you Yuma!

Collapse
 
david_ojeda profile image
David Ojeda

¡Muy buen post! i18n siempre ha sido un tema muy interesante para mi.

Keep 'em coming!