I deleted the Localizations in Xcode, then I cannot add any Localizations back

后端 未结 6 1507
陌清茗
陌清茗 2021-01-30 13:54

I deleted the Localizations of the project from the project\'s info by mistake. Both the storyboard and the related language were removed.

I got back the storyboard from

6条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-30 14:47

    I've followed a similar approach of @user2070775 reply.

    Firstyl when you delete Storyboard and Launchscreen to use your own creation or code programmatically, on Localization you might get similar following empty screen.

    Then firstly you should know the language code for example to use French localization its fr etc

    With project folder in the Project Navigator you must add New Group -> {LANGUAGE_CODE}.lproj. And then you should add New File -> Strings File -> Localizable.strings. In the @user2070775 answer, also InfoPlist.strings file has added so I added too for now.

    In the Localizable.strings file you can add = pairs for string to localizated.

    Our pair is "this-is-key" = "and-this-is-value-for-spesific-language-on-localizable-string"; for now.

    HINT: In key-value pair, when I did not put the semicolon, the XCode gives error for this situation.

    Until now, the following project scheme, must the result of you have.

    Additionally, when you looked at the Project -> Info -> Localizations the French or etc. language must be added like in the following image.

    TESTING

    Basically you can get the results of the what've you done

    The remaining part can be set from the Simulator. You must change the simulator language, for this answer the correct one is French.

    Go to Settings -> General -> Language & Region -> French and run the project again.

提交回复
热议问题