What does I18N safe mean?

InternationalizationTerminology

Internationalization Problem Overview


I came across a comment in some code referring to said code being "I18N safe".

What does this refer to?

Internationalization Solutions


Solution 1 - Internationalization

I + (some 18 characters) + N = InternationalizatioN

I18N safe means that steps were taken during design and development that will facilitate Localization (L10N) at a later point.

Solution 2 - Internationalization

This is most often referred to a code or construct ready for I18N - i.e easily supported by common I18N techniques. For instance, the following is ready:

printf(loadResourceString("Result is %s"), result);

while the following is not:

printf("Result is " + result);

because the word order may vary in different languages. Unicode support, international date-time formatting and the like also qualify.

EDIT: added loadResourceString to make an example close to real life.

Solution 3 - Internationalization

i18n means internationalization => i (18 letters) n. Code that's marked as i18n safe would be code that correctly handles non-ASCII character data (e.g. Unicode).

Solution 4 - Internationalization

Internationalization. The derivation of it is "the letter I, eighteen letters, the letter N".

Solution 5 - Internationalization

I18N stands for Internationalization.

Solution 6 - Internationalization

enter image description here

its a numeronym for Internationalization.

Different from Acronym, numeronym is a number based word (eg 411 = information, k9 = canine);

In code, this will normally be a folder title, that It generally refers to code that will work in international environments - with different locale, keyboard, character sets etc. ... "

Read more about it here: http://www.i18nguy.com/origini18n.html

Solution 7 - Internationalization

i18n is a shorthand for "internationalization". This was coined at DEC and actually uses lowercase i and n.

As a sidenote: L10n stands for "localization" and uses capital L to distinguish it from the lowercase i.

Solution 8 - Internationalization

Without any additional information, I would guess that it means the code handles text as UTF8 and is locale-aware. See this Wikipedia article for more information.

Can you be a bit more specific?

Solution 9 - Internationalization

I18N stands for Internationalization.

In a nutshell: I18N safe code means that it uses some kind of a lookup table for texts on the UI. For this you have to support non-ASCII encodings. This might seem to be easy, but there are some gotchas.

Solution 10 - Internationalization

i18n-safe is a vague concept. It generally refers to code that will work in international environments - with different locale, keyboard, character sets etc. True i18n-safe code is hard to write.

It means that code cannot rely on:

>sizeof (char) == 1

because that character could be a UTF-32 4-byte character, or a UTF-16 2-byte character, and occupy multiple bytes.

It means that code cannot rely on the length of a string equalling the number of bytes in a string. It means that code cannot rely on zero bytes in a string indicating a nul terminator. It means that code cannot simply assume ASCII encoding of text files, strings, and inputs.

Solution 11 - Internationalization

"I18N safe" coding means the code that doesn't introduce I18N bugs. I18N is a numeronym for Internationalization, where there are 18 characters between I and N.

There are multiple categories of issues related to i18n such as: Culture Format: Date Time formats(DD/MM/YY in UK and MM/DD/YY in US ), number formats, Timezone, Measuring units change from culture to culture. The data must be accepted, processed and displayed in the right format for the right culture/locale. International Characters Support: All the characters from all the different languages should be accepted, processed and displayed correctly. Localizability: The translatable strings should not be hard code. They should be externalized in resource files.

"I18N Safe" coding means that none of the above issue is introduced by the way the code is written.

Solution 12 - Internationalization

i18n deals with

  • moving hard coded strings out of the code (not all should be by the way) so they can be localized/translated (localization == L10n), as others have pointed out, and also deals with
  • locale sensitive method, such as --methods dealing with text handling (how many words in a Japanese text is far obvious:), order/collation in different languages/writing systems, --dealing with date/time (the simplest example is showing am/pm for the US, 24 h clocks for France for instance, going to more complex calendars for specific countries), --dealing with arabic or hebrew (orientation of UI, of text, etc.), --encoding as others have pointed out --database issues it's a fairly comprehensive angle. Just dealing with "String externalization" is far from enough.

Some (software) languages are better than others in helping developers write i18n code (meaning code which will run on different locales), but it remains a software engineering responsibility.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionLawrence JohnstonView Question on Stackoverflow
Solution 1 - InternationalizationcdonnerView Answer on Stackoverflow
Solution 2 - InternationalizationMichael PliskinView Answer on Stackoverflow
Solution 3 - InternationalizationRob KView Answer on Stackoverflow
Solution 4 - InternationalizationchaosView Answer on Stackoverflow
Solution 5 - InternationalizationScottView Answer on Stackoverflow
Solution 6 - InternationalizationGelView Answer on Stackoverflow
Solution 7 - InternationalizationAnton GogolevView Answer on Stackoverflow
Solution 8 - InternationalizationCal JacobsonView Answer on Stackoverflow
Solution 9 - InternationalizationKovBalView Answer on Stackoverflow
Solution 10 - InternationalizationPaul BeckinghamView Answer on Stackoverflow
Solution 11 - InternationalizationRyota KanekoView Answer on Stackoverflow
Solution 12 - InternationalizationOlivier LiboubanView Answer on Stackoverflow