Demo code for c4d.GeGetLanguage in Documentation

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.

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

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