4

Sometimes, the app contains a lot of texts and the Localizable.strings seems to be flooding with too much strings that makes me hard to find the right string to edit(even if I added comments for the strings).

I would like to create multiple .strings and set each .strings file to corresponding features or set of storyboards for the app.

I tried changing the file name of Localizable.strings to other names like TestOnly.strings but Xcode doesn't seem to read every .strings file available and I can't find the a single setting under build settings that tells Xcode to read strings under Localizable.strings. Is this default and unchangeable?

Please take note that I am not asking on how to localize strings to support different languages. What I want is like for example my Localizable.strings contains

"test_string" = "This is a test"; "test_string2" = "Another test";

then I want "test_string2" to be placed in another .strings file like OtherLocalizable.strings which can still be recognized by Xcode.

I hope you guys get my point.

JLT
  • 3,052
  • 9
  • 39
  • 86
  • @KiritModi Hi, I already know this and this isn't what I need. Please reread my question if you wish to. – JLT Apr 27 '17 at 03:09

1 Answers1

6

In Xcode, File -> New -> File... , scroll to Resource group, select String File

Create Strings File

Localize

Strings File in project

Read your string by NSLocalizedStringFromTable(@"yourString", @"File", nil)

tomfriwel
  • 2,575
  • 3
  • 20
  • 47
  • Hi, thank you for the effort. But you misunderstood me. I did not ask how to localize strings to different languages. I already know how to do that. I guess I should edit my question... – JLT Apr 27 '17 at 04:04
  • 2
    Hi, sorry I did not read your answer carefully. This is exactly what I need – JLT Apr 27 '17 at 04:15