4 Replies
      Latest reply on May 1, 2019 9:17 AM by Claude31
      Ishegg Level 1 Level 1 (0 points)

        Hello!

         

        I'm using Xcode 10.1 (10B61). I have localization set up in my projects with Localizable Strings, both for programatic strings and Storyboards/Xibs.

         

        Since setting this up I've run into a problem that I haven't been able to find anywhere else. When I build the app, be it for the simulator or a device, sometimes (randomly, I haven't been able to notice a pattern), the localization for Storyboards doesn't work, but the l10n for programatic strings does. It only works again after doing a clean build. Or, at least I thought so.

         

        The problem didn't seem to happen on TestFlight builds, until today. I deploy to the AppStore with Fastlane, and the lane I use cleans before building. Today a tester experienced the problem explained above after updating from TestFlight, so I decided to put an end to this for good.

         

        I've researched some other ways to do localization for Storyboards but I want to find out what's causing this.

         

        Anyone has run into this?

         

        Thanks beforehand.

        • Re: Storyboard localization is randomly ignored on builds
          KMT Level 9 Level 9 (14,835 points)

          Try 10.2 - I recall the 10.2 beta notes mentioning something about localization...

          • Re: Storyboard localization is randomly ignored on builds
            eskimo Apple Staff Apple Staff (12,075 points)

            When things don’t work, is that because the built app doesn’t include the right localised resources?  Or are all the localised resources present but are somehow not being used at runtime?

            To test this:

            1. Wait for the problem to happen.

            2. Save a copy of the broken built app.

            3. Do a clean build.

            4. Confirm that it fixes the problem.

            5. Save a copy of the working built app.

            6. Compare the apps from steps 2 and 5.

            Share and Enjoy

            Quinn “The Eskimo!”
            Apple Developer Relations, Developer Technical Support, Core OS/Hardware
            let myEmail = "eskimo" + "1" + "@apple.com"

            • Re: Storyboard localization is randomly ignored on builds
              Ishegg Level 1 Level 1 (0 points)

              Thanks KMT and eskimo. I've updated Xcode to 10.2. The problem seems to persist.

               

              The issue is random, and it happens with all the resources present at runtime. I'll definitely try comparing the 2 built apps, I hadn't thought of that.

               

              Thanks a bunch!

              • Re: Storyboard localization is randomly ignored on builds
                Claude31 Level 8 Level 8 (6,595 points)

                Did you solve your problem ? If yes, thanks to feedback how you solved and close the thread on your (correct) answer.

                 

                If not, hope this will help.

                When it occurs, does it affect all strings ?

                What are the languages you use as localization languages ?

                When it occurs, if you switch language, what do you get ? Correct strings or capitalized strings ?

                 

                I remember an old problem I had a bit similar.

                - it came from the fact that I had extraneous (don't ask me why) .strings files.

                 

                Could you check all the .strings files you have in project and see if they are at the right place ?

                 

                Another hint: a missing semi colon at the end of a resource in a .strings file causes problems for localizer.