omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    dialogs.date_dialog() Problem

    Pythonista
    dialogs 1.6 bug international
    5
    7
    5720
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Phuket2
      Phuket2 last edited by

      @omz, not sure what's going on here. But if you call dialogs.date_dialog(), I am getting another language for the month names. I looked at the dialogs.py file, but I can't see the problem. Either, I missed it or it's deeper in your code. I am setup on Australian for my locale in settings

      1 Reply Last reply Reply Quote 0
      • Phuket2
        Phuket2 last edited by

        Oh, not a random Language, looks a little like Danish, but guessing it German. Would make it difficult for you to see it as a problem.

        1 Reply Last reply Reply Quote 0
        • blmacbeth
          blmacbeth last edited by blmacbeth

          @Phuket2 @omz I think I found the problem. After doing some digging into the DatePicker class in the ui module… just look:

          >>> from objc_util import *
          >>> import ui
          >>> date_picker = ui.DatePicker(frame=(0,0,500,500))
          >>> date_picker_pntr = ObjCInstance(date_picker)
          >>> date_picker_pntr.locale()
          <__NSCFLocale: <__NSCFLocale: 0x17698f70>>
          >>> local = date_picker_pntr.locale()
          >>> local.localeIdentifier()
          <__NSCFString: de_DE> ## -> German (Germany)
          

          I'm guessing it's German since @omz lives in Berlin. Just needs to change the locale.

          B

          EDIT: as an added bonus, here is a workaround until it gets fixed (I'm from the US, but you can look up your locale code)

          #coding: utf-8
          import ui
          from objc_util import *
          
          NSLocale = ObjCClass('NSLocale')
          us_locale = NSLocale.alloc().initWithLocaleIdentifier_(ns('en_US'))
          
          date_picker = ui.DatePicker(frame=(0,0,500,500))
          date_picker_pntr = ObjCInstance(date_picker)
          date_picker_pntr.setLocale_(us_locale)
          
          date_picker.present('sheet')
          

          Enjoy. Play around with removing the locale or changing it.

          Phuket2 1 Reply Last reply Reply Quote 0
          • ccc
            ccc last edited by

            Pythonista's own locale module did not work last time I checked it out.

            1 Reply Last reply Reply Quote 0
            • Phuket2
              Phuket2 @blmacbeth last edited by

              @blmacbeth , thanks for the info. It's was more just about reporting the problem. Just a tricky one to see when on the same local all the time I guess

              1 Reply Last reply Reply Quote 0
              • Webmaster4o
                Webmaster4o last edited by

                This also affects form_dialog with a url field; the button that should say .com says .de.

                1 Reply Last reply Reply Quote 0
                • omz
                  omz last edited by

                  Thanks! I think I wouldn't have noticed this myself because a German date picker looks pretty normal to me...

                  The reason is a workaround for a bug in the iOS simulator – I'm faking a German locale because for some reason, the keyboard language can't be changed otherwise. This obviously should never have been in the version that's built for actual devices...

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post
                  Powered by NodeBB Forums | Contributors