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.


    Month name in local language

    Pythonista
    2
    6
    2420
    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.
    • cvp
      cvp last edited by

      I use matplotlib.dates.DateFormatter('%b') to display months names, hoping see them in my mother language.
      But my code displays them in English.
      Thus after searching, I've found the code
      locale.set_locale(locale.LC_ALL, 'fr_FR')
      print locale.nl_langinfo(locale.LC_MON1)

      But that does not give me the hoped French "janvier" instead of the English "January"...
      Thanks to help me

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

        Does this do it?

        import calendar
        print([x for x in calendar.month_name])
        

        EDIT: On second thought, perhaps locale.setlocale(locale.LC_ALL, 'fr_FR') is a no-op in Pythonista.

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

          No, the code prints the months names in English.

          locale.set_locale(locale.LC_ALL, 'fr_FR') is refused but I found it in Python general help (perhaps not for IOS, I agree)

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

            https://forum.omz-software.com/topic/608/locale-currency-doesn-t-work

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

              Thanks for your so quick answer.
              The problem seems to be 2 years old, thus no hope.
              Not vital.. (Belgium has more important problems actually)

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

                Resolved:

                ax.set_xticklabels(('...names of months in local language'))

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