Questions tagged [internationalization]

Internationalization(i18n : representing "internationalisation" as "i" followed by 18 more letters, followed by "n") is the process of planning and implementing products and services so that they can easily be adapted to specific local languages and cultures, a process called localization. The internationalization process is sometimes called translation or localization enablement.

This is a matter not only of changing the language which the software presents (e.g. in its user interface), but of changing the date format, the orientation of the text, the numeric format, and other aspects of its behavior to reflect the culture.

11657 questions
36
votes
3 answers

Use another I18n key in an I18n interpolation

This might be I18n-ception but lets say I have an en.yml file as below en: my_var: Foo my_message: "This is a message where I'd like to interpolate I18n's %{my_var}" Is there a way to indicate to I18n that %{my_var} should be the my_var key in…
Aaron
  • 13,349
  • 11
  • 66
  • 105
36
votes
4 answers

Translation in .yml with optional parameter

I want to make a translation my_translation with an optional parameter. For example: > I18n.t('my_translation') => "This is my translation" > I18n.t('my_translation', parameter: 1) => "This is my translation with an optional parameter which value is…
Bishma Stornelli
  • 2,539
  • 4
  • 22
  • 30
35
votes
16 answers

Android: Get missing translations for strings-resources

In Android, you can specify the texts in the default locale in res/values/strings.xml. Additional translations can be added for new languages in res/values-it/strings.xml (for Italian for example). If a string is not translated, the fallback-default…
theomega
  • 31,591
  • 21
  • 89
  • 127
35
votes
3 answers

String concatenation containing Arabic and Western characters

I'm trying to concatenate several strings containing both arabic and western characters (mixed in the same string). The problem is that the result is a String that is, most likely, semantically correct, but different from what I want to obtain,…
Carlos Ferreira
  • 565
  • 1
  • 8
  • 15
35
votes
4 answers

How can I create an .mo file for Wordpress

I have some .po files for Wordpress and i want to create .mo files. How can i do this?
Peter
  • 683
  • 2
  • 9
  • 13
35
votes
7 answers

Non-English texts in Stripe possible?

Successfully integrating Stripe into my online shop, I completely failed to get information on whether/how to configure Stripe to return error messages in German instead of English. So my question is: Is there a way to have localized error messages…
35
votes
4 answers

Alternatives to gettext?

Are there any general localization/translation alternatives to gettext? Open source or proprietary doesn't matter. When I say alternative to gettext, I mean a library for internationalization, with a localization backend of sorts. The reason I'm…
Tor Valamo
  • 33,261
  • 11
  • 73
  • 81
34
votes
4 answers

Localizing Dynamic Plural Noun messages (e.g. "5 Items Processed") on iPhone using Objective-C

In my current app, I have code that displays a message, e.g. "5 Items Processed." To keep the phrase grammatically correct, i.e. whether or not it should be "5 Item" or "5 Items," I use the following code: int numItems = 5; NSString *myString =…
Jason
  • 14,517
  • 25
  • 92
  • 153
34
votes
3 answers

Angular: How to get the current locale at runtime when using AOT

I am compiling my project with: ng serve --aot --i18nFile=client/locale/messages.fr.xlf --i18nFormat=xlf --locale=fr How can I access the locale ID at runtime? I want to show/hide elements based on the locale. PS. I do realise that using JIT…
williamsandonz
  • 15,864
  • 23
  • 100
  • 186
34
votes
3 answers

Django templates: Best practice for translating text block with HTML in it

In Django templates, how would I translate a block that contains HTML? For example: {% trans "Please" %} {% trans "log in" %} {% trans "in order to use MyApplicationName."…
AndiDog
  • 68,631
  • 21
  • 159
  • 205
34
votes
8 answers

Why do people use plain english as translation placeholders?

This may be a stupid question, but here goes. I've seen several projects using some translation library (e.g. gettext) working with plain english placeholders. So for example: _("Please enter your name"); instead of abstract placeholders (which has…
Pekka
  • 442,112
  • 142
  • 972
  • 1,088
34
votes
5 answers

Ruby on Rails 3, incompatible character encodings: UTF-8 and ASCII-8BIT with i18n

I've got some troubles with the couple Rails 3.0.1, Ruby 1.9.2 and my website localization. The problem is quite simple, i've got something like that in a view : f.input :zip_code, :label => I18n.t('labels.zip_code') and a es.yml file : es: …
34
votes
1 answer

I18n::InvalidLocale: :en is not a valid locale

I am trying to use I18n.transliterate to "normalize" some text with accented characters so I can analyze and compare it with different languages. However, when using this method the following error pops out I18n::InvalidLocale: :en is not a valid…
dabadaba
  • 9,064
  • 21
  • 85
  • 155
34
votes
2 answers

Chrome timeZone option to Date.toLocaleString()

I have recently discovered that there is a new extension to JavaScript. This adds several features to the Date object in the toLocaleString, toLocaleDateString and toLocaleTimeString functions. Reference here. I am particularly interested in the…
34
votes
2 answers

Same string with different translation

I have one string that can be translated in varius part of my code in two different way. Now if Use django-admin makemessages -l it I get in django.po this: #: pingapi/ping.py:17 pingapi/nots.py:10 msgid "may" msgstr "maggio" But I would want two…
beddamadre
  • 1,583
  • 2
  • 19
  • 40