Skip to content

Latest commit

 

History

History
79 lines (56 loc) · 3.01 KB

i18n-l10n.md

File metadata and controls

79 lines (56 loc) · 3.01 KB

L10n and I18n

Localization and Internationalization

Localization

  • Short: l10n
  • Adaptation of software to meet the language, cultural and other requirements of a specific target market (a locale)
  • Examples:
    • Numeric, date and time formats
    • Use of currency
    • Keyboard usage
    • Collation and sorting
    • Symbols, icons and colors
    • Varying legal requirements

Internationalization aka Globalization

  • Short: i18n
  • Enables easy localization for target audiences that vary in culture, region, or language
  • Software design and development practices
  • Examples:
    • Enable Unicode
    • No UI constants in code
    • Support for bidirectional text
    • Support for non-Latin typographic features
    • Support local, regional, language, or culturally related preferences
    • Separating localizable elements from source code or content

.NET Best Practices for Globalization

  • Read details in Microsoft docs
  • Use Unicode internally
    • C# string is always Unicode
    • In SQL Server, use nchar and nvarchar
  • Use helper classes in System.Globalization
  • Use Thread's CurrentCulture and CurrentUICulture for formatting and retrieving resources
  • Do not assume ASCII data, use encoding classes in System.Text instead
  • Test on international operating system versions, using international data

Calendar

<!--#include file="i18n-l10n/0005-basics/Calendar.csx" -->

CultureInfo

<!--#include file="i18n-l10n/0005-basics/CultureInfo.csx" -->

Sample for ASP.NET Core

Code walkthrough for L10n sample on GitHub

Further Readings