1

When Localizing a storyboard in Xcode 6 the created storyboard.strings file contains everything in the storyboard even though many of the elements already have IBOutlets that will populate the elements at runtime (such as UILabels in UITableViewCells). eg:

/* Class = "UILabel"; text = "Cuisine "; ObjectID = "Leo-99-CcC"; */
"Leo-99-CcC.text" = "Cuisine ";

/* Class = "UILabel"; text = "Comments:"; ObjectID = "SY6-eR-QpE"; */
"SY6-eR-QpE.text" = "Comments:";
  1. Is there a way I can define which elements should be localized and which ones should be ignored?

  2. Is there a way I can make those comments more infomative. The above example give very little context for the translator to work with when compared to the incode version using NSLocalizedString(@"key", @"Clear comment for translator about context"). I guess I could add a more descriptive place holder text in the storyboard editor but this doesn't feel like the right solution when working with AutoLayout constraints etc.

Dallas Johnson
  • 1,546
  • 10
  • 13

1 Answers1

0

I have found a bit of a hacky way to filter out elements that you don't want localized in Storyboards but then it make storyboards a bit more difficult to use. If you delete the text in a UILabel (for example) when the XLif is exported it will not contain that UI element. This works for labels in a UITableViewcell which will populated at runtime but then makes styling and constraint layout difficult thereafter.

Dallas Johnson
  • 1,546
  • 10
  • 13