9 Replies
      Latest reply on Feb 20, 2018 10:55 AM by Claude31
      Claude31 Level 8 Level 8 (7,815 points)

        In this app I have a view with 3 textFields or labels on which I have gesture recogniqzers.


        They work OK.


        I have localized the app for 2 more languages, and now, when I switxh language (inside the app), I get the following error:


        2018-02-16 00:19:34.951810+0100 Autonomie[1635:1007703] [Warning] WARNING: A Gesture recognizer (<UITapGestureRecognizer: 0x1757fd90; state = Possible; view = <UITextView 0x17b86600>; target= <(action=autonomieVersionViewTapped:, target=<Autonomie.StartViewController 0x1757f890>)>>) was setup in a storyboard/xib to be added to more than one view (-><UITextView: 0x17ba8000; frame = (60.5 50; 198 25); text = 'version 0.5 © AlphaNums 2...'; clipsToBounds = YES; hidden = YES; opaque = NO; autoresize = RM+BM; gestureRecognizers = <NSArray: 0x175e25d0>; layer = <CALayer: 0x175da320>; contentOffset: {0, 0}; contentSize: {198, 31}>) at a time, this was never allowed, and is now enforced. Beginning with iOS 9.0 it will be put in the first view it is loaded into.

        <UIButtonLabel: 0x176d3da0; frame = (160 18; 0 0); text = 'Calcular el rango …'; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x176d01c0>>

        <UIButtonLabel: 0x1765cc40; frame = (160 18; 0 0); text = 'Calculer autonomie …'; opaque = NO; userInteractionEnabled = NO; layer = <_UILabelLayer: 0x1765cda0>>


        And gestures do not work.


        If I switch back to the original language, everything OK.

        • Re: Localization and tap gesture
          KMT Level 9 Level 9 (15,395 points)

               > when I switxh language (inside the app),


          Why do it that way? Why not let the device do that for you?

            • Re: Localization and tap gesture
              Claude31 Level 8 Level 8 (7,815 points)

              I want to let user chage the language directly from the app (imagine I want to show to a foreign friend, I don't want to be force to change the phone setting).


              Anyway, I found the problem, not related to this : when I create a tapGestureRecognizer in IB, I get the warning.


              I created programmatically, problem gone.

                • Re: Localization and tap gesture
                  eskimo Apple Staff Apple Staff (12,675 points)

                  I want to let user chage the language directly from the app …

                  This is going to cause problems; see my response on your other thread.

                  Share and Enjoy

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

                    • Re: Localization and tap gesture
                      Claude31 Level 8 Level 8 (7,815 points)

                      Thanks Quinn, I will follow your advice and delete the language selection on the fly. Even though I found it a cool feature !

                      If you can answer this, could it nevertheless become a future IOS feature ?

                      And I will remove the label from the launch screen.

                        • Re: Localization and tap gesture
                          KMT Level 9 Level 9 (15,395 points)

                          Apple has enabled Internationalization to simplify for both the user and the dev. When you change the language inside your app, you also take responsibility for dates, currencies, etc. System UI elements are out of the dev's control, and risk not being in the same language as the one you allow inside your app.


                          If the dev enabled a language change at the app level, the user would then have a confusing experience, not knowing if your app, or Apple, or they made some mistake. I'd expect App Review to push back.


                          When a properly configured multi-language app is downloaded and installed from the store, all of that is done in a consistent manner. The dev is freed from needing to do the additional work themselves.




                            • Re: Localization and tap gesture
                              Claude31 Level 8 Level 8 (7,815 points)

                              I understand and the stabiliity question is a killer argument.


                              But if one restore the context each time app goes to background, or terminates, can't it be made safe in terms of user experience?


                              I will just give an example where it would bring value.


                              Imagine a situation where you work with a foreign friend ; you want to work on the same iPad ; it would be convenient to switch instantly the language, to make it easier for both to work together. Turning to system preferences is very tedious and takes time, not adapted to this situation.

                                • Re: Localization and tap gesture
                                  KMT Level 9 Level 9 (15,395 points)

                                  I'm sure there are rational examples that could serve a purpose in some cases. Your example would be handy with split-screen, I think.


                                  As always, for features you'd like promoted across the platform, an enhancement request via the bug reporter is in order, adding your report # to your thread for reference, thanks and good luck w/it.



                                    • Re: Localization and tap gesture
                                      Claude31 Level 8 Level 8 (7,815 points)

                                      File an improvement request :





                                      Allowing to change language setting from within an app


                                      Created on February 17 2018, 5:15 PM for iOS + SDK


                                      Update 20.2.2018 Marked as DUPLICATE OF 24056646 which is still open.

                                    • Re: Localization and tap gesture
                                      QuinceyMorris Level 8 Level 8 (6,050 points)

                                      I've been thinking about this over the past couple of days, and here's my take on it:


                                      Currently, handling language and region settings is a cooperative procedure between the OS and your app. It's not just that the OS tells your app to switch languages (or regions) when the user changes Settings. The actual UI mechanisms can change too, and those are implemented system-wide, outside your app. It's like two jigsaw puzzle pieces, one from the OS and one from your app, and you can't use a differently-shaped piece for just one of them. They won't fit together any more.


                                      This could theoretically be re-engineered so that the system piece moved into frameworks running in your app process, which would allow apps to switch languages on the fly (though with what general UI consequences is a bit hard to see). But for now, you have no reason to think there's anything you can safely do just within the app.


                                      For the larger question of user confusion, there can be apps where some kinds of language setting makes sense. For example, an app that translates phrases between languages might be set to translate between French and German on a device whose Settings are configured for Japanese. Or an app might show date formatting for other parts of the world.


                                      Any API where you can directly control the language or region settings (e.g. language for text, calendar/region for date formatting) already allows localized display of "other" languages or region conventions, but the overall UI is still the device default, and the app hasn't switched language/region in the full sense of a user changing Settings.