3

I pressed the Localize... button on my storyboard to generate a strings file so that the storyboard may be localized into other languages. In one the strings file that corresponds to a storyboard, I see something like this:

"orz-58-mzb.text" = "We are always looking for bright, energetic individuals to represent us.";

I'm wondering if I can change the key field orz-58-mzb.text to something with more meaning such as faq.answer.23.text so that it can be used in other platforms like Android? I noticed in the Storyboard editor, the Object ID cannot be changed (see screenshot). Is there any other way to change the key?

Xcode screenshot of Object ID

ninjaneer
  • 6,951
  • 8
  • 60
  • 104
  • 1
    Actually you can change it. Just open the storyboard as source code, find the object and look for the parameter id="". But careful not to duplicate it in the same storyboard. – GeneCode Apr 06 '17 at 03:14

1 Answers1

2

There's no way to change the key, but you can add a comment in the Notes field on that same UI. That string gets passed on to the translator via the generated Xliff, and is the best way to communicate meaning behind the string you want translated.

wakachamo
  • 1,723
  • 1
  • 12
  • 18
  • Thanks, however I ended up manually localizing all UI strings in the code so that when I do use the genstrings tool, it'll create a meaningful key. – ninjaneer Jan 17 '16 at 10:20
  • Manually localizing is apparently what many devvers end up doing, but it often requires a huge amount of boilerplate code and results in huge amounts of clutter. However, it *is* possible to change Object IDs by manually editing the storyboard/xib xml. Also not recommendable as it requires a lot of manual labour and maintenance. – Mark Dec 20 '19 at 16:01