GO FURTHER, FASTER: Try the Swift Career Accelerator today! >>

SOLVED: Ultimate Portfolio > i18n and l10n - trying Xcode 15+ approach

Forums > Articles

Edit: I found my issue. I'd been copy-pasting in the source edit view and left "new" in the JSON for each string when it should have been marked "translated".

Hi, I'm following the lessons on the Ultimate Portfolio app series and working through adding i18n setup for the initial strings. Since the way described in the video is legacy, and genstrings doesn't seem to add anything to the file, I went for creating a strings catalogue instead.

This seems to work for some of the strings but I still seem to get warnings for all the strings that they aren't specified in the localizable bundle not found in table Localizable of bundle CFBundle.

I may have missed some config or setup perhaps as many of the strings still show uppercase even through I'm pretty sure they're set up to render? If it helps, I've pushed my latest changes to the repo here: https://github.com/donovanh/ultimateportfolio

Thanks for any suggestions, Donovan

   

Hello,

I looked at your app and only see one translation file (English). When I look at the settings in Xcode, only English is included. So I think you need to add another language.

Here you will find the settings for Localizations:

Tap on project name at the top of the navigation, then Project UltimatePortfolio, Info tab, there you will find Localization, add a language.

I usually then choose Export Localizations... which is in the Product menu. (Send the translation file to a translation agency or colleague.) Try opening the file yourself and translate a single line or two. Then select Import Localizations... is in the Product menu. You will now see the files in the navigation menu on the left in Xcode, you can try translating directly in Xcode, by selecting the Localizable-file. (I am using Xcode 16.)

You can test what I write in another smaller project to see how smooth it is…

Please check back, so I know how it goes for you!

1      

Thanks Martin. The issue though is that the English strings in the localization strings catalogue aren't loading. I can tell by selecting "Show non-localized strings" in the Run... settings (Option + Product menu, select Run...).

The strings show up as uppercase and I get warnings that the strings aren't found in the bundle. That seems to suggest those English strings aren't loading.

   

Oh never mind! I worked it out. I had updated the catalogue file in JSON and marked a bunch of translations as new instead of translated.

I had:

"Title" : {
      "localizations" : {
        "en" : {
          "stringUnit" : {
            "state" : "new",
            "value" : "Title"
          }
        }
      }
    },

Which needed updated to:

"Title" : {
      "localizations" : {
        "en" : {
          "stringUnit" : {
            "state" : "translated",
            "value" : "Title"
          }
        }
      }
    },

1      

Hacking with Swift is sponsored by RevenueCat.

SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's all new Paywall Editor allow you to remotely configure your paywall view without any code changes or app updates.

Click to save your free spot now

Sponsor Hacking with Swift and reach the world's largest Swift community!

Reply to this topic…

You need to create an account or log in to reply.

All interactions here are governed by our code of conduct.

 
Unknown user

You are not logged in

Log in or create account
 

Link copied to your pasteboard.