
Ask HN: How do you internationalize an app? - vanilla-almond
I recently watched this old video from Computerphile on internationalization: https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=0j74jcxSunY<p>It explains some of the complications of internationalization.<p>How do you handle different languages when you internationalize your app? Do you remove all strings from your code that might be displayed to the user and instead reference a separate language file containing all application text? Is this stored in a database? Or as a plain text file (e.g. XML)?<p>And how do you handle the common situation when sentences do not map one-to-one across languages due to plural or numeric rules? (Example: language A uses a sentence with a single form to express a message. Language B requires two or more forms of a sentence to convey the same meaning.)<p>If you have implemented internationalization before, any tips, advice (or war stories!) would be much appreciated.
======
dlivingston
It's going to depend on the platform, but this is a good tutorial for iOS
localization [0].

Effectively, it's going to look like:

    
    
      let alertTitle = NSLocalizedString("Welcome", comment: "")
      let alert = UIAlertController(title: alertTitle, message: alertMessage, preferredStyle: UIAlertControllerStyle.Alert)
    

and the localized .strings file will look like this [1],[2]:

    
    
      "Welcome" = "Bienvenido"
    

[0]: [https://medium.com/lean-localization/ios-localization-
tutori...](https://medium.com/lean-localization/ios-localization-
tutorial-938231f9f881)

[1]: [https://cdn-
images-1.medium.com/max/1600/1*EjF2SGh4kRQSnbmke...](https://cdn-
images-1.medium.com/max/1600/1*EjF2SGh4kRQSnbmke4BlRQ.png)

[2]:
[https://developer.apple.com/library/archive/documentation/Co...](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/LoadingResources/Strings/Strings.html)

