Best way for manage language switch

Discussion in 'iOS Programming' started by ildandi, Dec 9, 2012.

  1. ildandi macrumors newbie

    Joined:
    Nov 7, 2012
    #1
    What do you think about storyboard?? I'm asking this because I've an app created for 2 languages.... so I've to storyboard files (1 for each language), every time that I've to change a button position, change view structure or UI I've to change 2 files (for apply same changes in both files). Is this right?? What do you think about this solution for manage and app created for 2,3,4.... languages

    Thanks
     
  2. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #2
    What we do, is have our own localisation system, you just have to manually set the label text's in the code like.

    Code:
    someLabel.text = ICLocalizedString(@"1.tada_label",@""); 
    This Localized system takes care (Apple has one to, but it wasn't perfect for us) of the loading from .strings file etc depending on what language is setted up.
     
  3. ildandi thread starter macrumors newbie

    Joined:
    Nov 7, 2012
    #3
    Thanks for your reply, but do you do this using Storyboard? So having N differents file for N language?? Or using XID?

    Could I apply your solution to my N storyboard without have to change all SB for every single layout change (button position,etc...)

    Thanks
     
  4. jnoxx macrumors 65816

    jnoxx

    Joined:
    Dec 29, 2010
    Location:
    Aartselaar // Antwerp // Belgium
    #4
    I have never used Storyboards in my life.
    What we use are IBOutlets, and have a method in our controller like
    Code:
    - (void) addTranslations
    {
    self.label = ICLocalizedString(@"",@"");
    self.otherlabel...
    }
    
    A collegue of mine made an blog post about it, not sure if it's advertising, but it's just relative for this topic.
    Click me
     

Share This Page