Moving localization folders in Xcode 4

前端 未结 4 1400
情书的邮戳
情书的邮戳 2021-01-06 20:41

I\'ve recently upgraded from Xcode 3 to Xcode 4.2, and migrated an existing iOS apps to use this new version. This app is localized, and I now want to add another language.

相关标签:
4条回答
  • 2021-01-06 21:14

    The file structure on disk is mostly irrelevant in Xcode. Just move the directory in Finder, then in Xcode you can either: (a) remove the fr.lproj directory and re-add it, or (b) select the red entry, open the right-hand (properties) panel, and near the top you should see the path. Change the path to the new location and it'll go back to black.

    0 讨论(0)
  • 2021-01-06 21:15

    Found the solution. It's not pretty, but it works.

    Here's what I did:

    1. View the contents of the .xcodeproj folder in Finder
    2. Edit the project.pbxproj file
    3. Search for .lproj within the file
    4. Change the path = section to include the Resources part of the path.
    5. Save, then restart Xcode

    This smoothed everything over, and allowed the Localization to reside in the Resources subdirectory.

    0 讨论(0)
  • 2021-01-06 21:26

    Here's a way how to solve it w/o editing .pbxproj file (Xcode 4.6.3):

    1. select localization parent file (Localizable.strings)
    2. Utility pane > Identity and Type > under Location (Relative to Group) choose path icon and set required new location for localization files
    3. Finder > move all your en.lproj, fr.lproj, etc subfolders to that chosen folder

    UPD: doesn't work in Xcode 8 :(

    0 讨论(0)
  • 2021-01-06 21:33

    This way works on Xcode 5.1 also (Greek example):

    1. Create Resources/el.lproj folder within Localizable.strings file in Finder
    2. Open your project file in Xcode and right-click on Resource folder
    3. Click on "Add File to..." context menu item
    4. Select Localizable.strings file from Resources/el.lproj folder -> OK. Greek Localizable.strings automatically will be added to Localizable.strings files.

    You can use the same way to add localization for xib files.

    0 讨论(0)
提交回复
热议问题