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
    • Recent
    • Tags
    • Users
    • Login

    Localisation according to language [SOLVED]

    Scheduled Pinned Locked Moved PYTHON Development
    9 Posts 0 Posters 714 Views
    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.
    • H Offline
      Helper
      last edited by

      On 07/01/2015 at 21:00, xxxxxxxx wrote:

      Hi,

      I have a cinema 4d plugin in python language in which I have used various static texts and menus. In the pyp file I have mentioned them in English but I want them to be changed to the language according to the language being used in cinema. How can I do that ?

      Thanks 
      Nishant

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 07/01/2015 at 23:54, xxxxxxxx wrote:

        Don't hard-code your strings in the plugin, use resource files. Then you only have to create individual string files for each language supported and Cinema will take care of using the right one (providing you organise the resource correctly).

        Steve

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 08/01/2015 at 02:58, xxxxxxxx wrote:

          Hi,

          Can you give an example on how to use resource file ? I can not find it anywhere in the documentation

          Thanks
          Nishant

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

            On 08/01/2015 at 03:29, xxxxxxxx wrote:

            Hi,
            the resource files are described in the GUI section of the C++ SDK docs. There are no differences for Python.
            See here:
            SDK Docs R15: User Interface[URL-REMOVED]


            [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

              On 08/01/2015 at 05:03, xxxxxxxx wrote:

              I am creating a GeDialog window, and cannot use resource files. For that I need to check what Interface Language user is using.
              How to do that?

              Thanks.

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

                On 08/01/2015 at 05:18, xxxxxxxx wrote:

                Tomas,
                I don't understand, why creating a GeDialog window keeps you from using resource strings?
                Are you building the GeDialog dynamically? Then you can still use the GeResource class to load your strings. I don't think, this will be more work, than doing the entire localization yourself manually.

                1 Reply Last reply Reply Quote 0
                • H Offline
                  Helper
                  last edited by

                  On 08/01/2015 at 05:26, xxxxxxxx wrote:

                  Well, I'd rather not use resource string, as this code will be shared publicly. And in order to prevent script from crashing, I was hoping to implement localisation right in the code.

                  So main thing for me is left to catch what Interface Language user is running, and depending on that I would show appropriate string.

                  1 Reply Last reply Reply Quote 0
                  • H Offline
                    Helper
                    last edited by

                    On 08/01/2015 at 06:39, xxxxxxxx wrote:

                    As Sebastian pointed out to me, you can use GeGetLanguage()[URL-REMOVED].


                    [URL-REMOVED] @maxon: This section contained a non-resolving link which has been removed.

                    1 Reply Last reply Reply Quote 0
                    • H Offline
                      Helper
                      last edited by

                      On 08/01/2015 at 23:15, xxxxxxxx wrote:

                      Yes indeed, GeGetLanguage() works as a charm.
                      Thanks Andreas.

                      1 Reply Last reply Reply Quote 0
                      • First post
                        Last post