1

My storyboard has localization of Chinese(Simplified).

Initially, when the .strings file was generated, it contains every text of title/labels that I input on every scene. Like this:

/* Class = "UINavigationItem"; title = "灯光窗帘"; ObjectID = "03c-Su-3Ya"; */ "03c-Su-3Ya.title" = "灯光窗帘";

/* Class = "UIButton"; normalTitle = "Button"; ObjectID = "1dN-RP-fnm"; */ "1dN-RP-fnm.normalTitle" = "Button";

/* Class = "UIButton"; normalTitle = "写入"; ObjectID = "1yV-zN-VyH"; */ "1yV-zN-VyH.normalTitle" = "写入";

/* Class = "UIButton"; normalTitle = "通风"; ObjectID = "26S-O2-95j"; */ "26S-O2-95j.normalTitle" = "通风";

But when I add new view controllers and new texts into it. I notice that the .strings file is not updated automatically. Do I have to generate this file every time? Or there is a way to refresh its contents?

Please help. Thanks in advance!

JLT
  • 3,052
  • 9
  • 39
  • 86
  • Possible duplicate of [Is it possible to update a localized storyboard's strings?](http://stackoverflow.com/questions/15094259/is-it-possible-to-update-a-localized-storyboards-strings) – Jeehut Feb 14 '16 at 23:29

1 Answers1

5

Yes. This is one of the million limitations of Xcode. I generally only do this localization as the last thing I do for an application.

As you add new elements, Xcode will not add these new elements to the localization file. You have to do it manually.

Duck
  • 34,902
  • 47
  • 248
  • 470
  • aww, ok then. Thanks. – JLT Sep 06 '15 at 15:13
  • It is not entirely true that you need to do this manually. There are scripts that do this for you, some of them aren't working any more, but here's a solution that I created and hosted on GitHub as a project: http://stackoverflow.com/a/35398661/3451975 – Jeehut Feb 16 '16 at 23:45
  • Thanks but I doubt this script will scan and put back all strings on different tables and inside the localization of xibs and storyboards. Unfortunately Apple designs Xcode like Microsoft did with Vista. – Duck Feb 17 '16 at 01:47
  • The project I created does exactly that - it scans and puts back all strings inside the localization of xibs and storyboards. I agree that Apple misses to design some parts of XCode correctly but that shouldn't stop you from trying out solutions that try to fill some of the gaps. Just give it a try, it works like a charm for me and many others. ;) – Jeehut Mar 16 '16 at 07:27