sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    LanguageHandler question

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 556 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.
    • Didier BurD Offline
      Didier Bur
      last edited by

      Hi all,
      Why is this not working ?

      $tStrings = LanguageHandler.new("Components.strings")
      

      And this is working:

      $tStrings = LanguageHandler.new("sandbox.strings")
      

      😲
      All other ".strings" files work, except this one. All are at the correct location.
      The message I get is the following:

      @unknownuser said:

      Error: #<NoMethodError: C:/PROGRA~1/Google/GOOGLE~4/Tools/LangHandler.rb:72:in ParseLangFile': private method gsub!' called for nil:NilClass>

      In LanguageHandler.rb, the line 72 is:

      	keyvalue[1].gsub!(";", "")
      

      So keyvalue[1] seems to be nil, but in reverse exploring the code, I can't see what's wrong with the file.
      All usual functions of this file work OK: components names are in french in the component browser and so on...
      Any idea someone ?
      Attached in the french components.strings file if you want to try it.


      Put it in your Resources/local_name folder
      (make a backup of yours first)

      DB

      1 Reply Last reply Reply Quote 0
      • Al HartA Offline
        Al Hart
        last edited by

        Try adding these 3 lines to the Langhandler.rb code.
        (The last 3 on the left)

             
                                   #pull out the key
                                        keyvalue = entryString.split("\"=\"")
        $keyvalue = keyvalue
        $entryString = entryString
        printf("'%s' '%s' '%s'\n", entryString, keyvalue[0], keyvalue[1])
        
        

        This will print out how it splits the entryString.

        and the two $variables let you examine whatever the last values were when it failed.

        It turns out that it fails on the line: "-- Runtime --" = "-- Durée d'exécution --";

        and the reason it fails, it because it is looking for: "=", and this line has: " = "
        (spaces around the equals signs.)

        Al Hart

        http:wiki.renderplus.comimageseefRender_plus_colored30x30%29.PNG
        IRender nXt from Render Plus

        1 Reply Last reply Reply Quote 0
        • Didier BurD Offline
          Didier Bur
          last edited by

          Yep, that's it !

          @unknownuser said:

          the reason it fails, it because it is looking for: "=", and this line has: " = "

          Thanks Al. I was thinking that the strip method didn't care of spaces, and it does in fact.

          Since components.strings is the stock file that is installed with the french package of GSU: 👎 to SU Team 😉

          DB

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement