1

I am trying to add pluralizable localization to my Xcode project, using Xcode 11.2.1

I followed the steps in this tutorial: https://medium.com/@vitaliikuznetsov/plurals-localization-using-stringsdict-in-ios-a910aab8c28c , which is a pretty basic instruction on how these things work. Mine, however, did not work, SO, I tried the following:

0) Actually running the tutorial code to make sure it works on my copy of Xcode. It does.

1) Copying the example Localizable.stringsdict from the tutorial into my program, and using the keys from said tutorial in my calls, in case I had made a bad Localizable.stringsdict or was calling it wrong. This failed.

2) Creating the Localizable.stringsdict as a property list, as some older questions suggested, instead of a Stringsdict file when creating it new, and copying the known 'good xml' of the example plist into it. This failed.

3) I tried removing all localized content from the project, and re-adding the strings file and the stringsdict file. Now it can't find either of them.

Clearly I must be missing some configuration, some step, some way of saying HEY XCODE LOCALIZE THESE. When I look at the 'Localizations' tab in the Project, there is only 1 file localized, for "Base"

Tom Schulz
  • 612
  • 6
  • 23

3 Answers3

1

Yesterday, I succeeded to localize Swift App using this tutorial. Please try to follow this tutorial. Thanks

KpStar
  • 122
  • 7
  • This tutorial is 4 Xcodes old, and he mentions right at the top that this stuff changes slightly every version. I'll still give it a read though, thanks. – Tom Schulz Dec 03 '19 at 21:52
  • This tutorial did not work for me. It doesn't talk about the .stringsdict method required for pluralizated localization stated in the question – psilencer Jul 08 '22 at 21:45
1

Number 4 was the clue here. My project has a lot of targets. Add your stringsdict file to the targets it needs to be added to. Derp. I added the dict file to the proper target and everything works fine.

Always check the obvious stuff first.

Tom Schulz
  • 612
  • 6
  • 23
0

Open your localized stringdict file, then in the right inspector click on Identity and Type you will see localization block with a button, click on it and project will recognize your file now

unferna
  • 105
  • 1
  • 2