Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Demo code for c4d.GeGetLanguage in Documentation

    Scheduled Pinned Locked Moved Bugs
    s24sdk
    3 Posts 2 Posters 784 Views 2 Watching
    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.
    • ? Offline
      A Former User
      last edited by A Former User

      Hello,
      I was trying to find a way to determine the default language of Cinema 4D. In the documentation for c4d.GeGetLanguage, there is some example code, but it looks incomplete:

      lang = GeGetLanguage(index)
      if lang==None: return
      
      index+=1
      # str, str, bool
      print(lang["extensions"], lang["name"], lang["default_language"])
      

      The code mentions iterating until the function returns None, but I think it would be much clearer with something like this:

      def get_default_language():
          index=0
          while True:
              lang = c4d.GeGetLanguage(index)
              if lang==None: return
              if lang["default_language"]:
                  # str, str, bool
                  print(lang["extensions"], lang["name"], lang["default_language"])
              index+=1
      

      Thanks.

      1 Reply Last reply Reply Quote 0
      • ferdinandF Offline
        ferdinand
        last edited by ferdinand

        Hello @blastframe,

        thank you for reaching out to us and thank you for taking the time for pointing this out. We agree with your sentiment and will update the code example to one similar to yours in an upcoming revision of the SDK documentation.

        Thank you for your help,
        Ferdinand

        MAXON SDK Specialist
        developers.maxon.net

        1 Reply Last reply Reply Quote 0
        • ferdinandF Offline
          ferdinand
          last edited by

          Hello @blastframe,

          thank you again for reporting this 🙂 But can we close this or are there any remaining issues? The thread has been added to the fixed issues pool, see tag in the first posting. This is how we track documenation and API updates that are the result of a forum thread. When this issue has been fixed, we will post here and remove the tag. So, closing this thread does not mean that we will ignore the issue.

          Cheers,
          Ferdinand

          MAXON SDK Specialist
          developers.maxon.net

          1 Reply Last reply Reply Quote 0
          • maxonM maxon moved this topic from Cinema 4D SDK on
          • First post
            Last post