How to get "Plugins" menu name in other language?

How to get "Plugins" menu name in other language?

Postby wikii » Thu Dec 25, 2014 2:39 am

In Sketchup English version , "Plugins" menu name is just "Plugins".
But in Sketchup Chinese version, "Plugins" menu name always change.
How to get the name of Plugins menu in ruby?
Thanks!

wikii
0

wikii 
PluginStore Author
PluginStore Author
 

Re: How to get "Plugins" menu name in other language?

Postby driven » Thu Dec 25, 2014 3:18 am

you could try and use a global call used by one of the SU plugins like webtexture...
Code: Select all
$wt_strings.GetString("Plugins")


that should return the localised string...

john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: How to get "Plugins" menu name in other language?

Postby wikii » Thu Dec 25, 2014 4:34 am

Thank you!

Do you mean that I need to make a translation book?
but when a new version Sketchup released, I must update it.

Has a thorough solution?
0

wikii 
PluginStore Author
PluginStore Author
 

Re: How to get "Plugins" menu name in other language?

Postby thomthom » Sat Dec 27, 2014 7:23 pm

wikii wrote:In Sketchup English version , "Plugins" menu name is just "Plugins".
But in Sketchup Chinese version, "Plugins" menu name always change.
How to get the name of Plugins menu in ruby?
Thanks!

wikii

The "Plugins" menu was renamed to "Extensions" in SU2015.
Has the Chinese version of SketchUp changed on other versions than SU2015?

What are you trying to do?
UI.menu("Plugins") should always work regardless of version and language.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: How to get "Plugins" menu name in other language?

Postby wikii » Thu Jan 01, 2015 1:20 am

thomthom wrote:
wikii wrote:In Sketchup English version , "Plugins" menu name is just "Plugins".
But in Sketchup Chinese version, "Plugins" menu name always change.
How to get the name of Plugins menu in ruby?
Thanks!

wikii

The "Plugins" menu was renamed to "Extensions" in SU2015.
Has the Chinese version of SketchUp changed on other versions than SU2015?

What are you trying to do?
UI.menu("Plugins") should always work regardless of version and language.


I have writen a ruby to shortcuts ,so I need the exact name of plugins menu.
0

wikii 
PluginStore Author
PluginStore Author
 

Re: How to get "Plugins" menu name in other language?

Postby Dan Rathbun » Mon Jan 12, 2015 9:44 pm

driven wrote:you could try and use a global call used by one of the SU plugins like webtexture...
Code: Select all
$wt_strings.GetString("Plugins")

that should return the localised string...

It will not. Because that string is not in the file used by the webtextures extension.

I checked most of the normal trimble extensions, and none of them have the strings "Plugins" nor "Extensions".

On PC, menu name strings are in a string table, in the resources, that are bundled into the executable file.

The display names are not exposed to the Ruby API Sketchup::Menu class.
1
    I'm not here much anymore. But a PM will fire email notifications.
    User avatar
    Dan Rathbun 
    PluginStore Author
    PluginStore Author
     

    Re: How to get "Plugins" menu name in other language?

    Postby driven » Mon Jan 12, 2015 10:33 pm

    Dan Rathbun wrote:...
    It will not. Because that string is not in the file used by the webtextures extension...


    your right it's buried in "Localizable.strings" on a mac...
    I tested by renaming and now have "Plugins" back in v2015 menu bar...

    be nice to have easy access for 'user guides' etc...

    john
    0
    learn from the mistakes of others, you may not live long enough to make them all yourself...

    driven 
    PluginStore Author
    PluginStore Author
     

    Re: How to get "Plugins" menu name in other language?

    Postby wikii » Thu Nov 30, 2017 9:29 am

    thomthom wrote:
    wikii wrote:In Sketchup English version , "Plugins" menu name is just "Plugins".
    But in Sketchup Chinese version, "Plugins" menu name always change.
    How to get the name of Plugins menu in ruby?
    Thanks!

    wikii

    The "Plugins" menu was renamed to "Extensions" in SU2015.
    Has the Chinese version of SketchUp changed on other versions than SU2015?

    What are you trying to do?
    UI.menu("Plugins") should always work regardless of version and language.


    I want to set shortcuts to some plugins.
    So, I need to know the display name of Plugins menu.
    0

    wikii 
    PluginStore Author
    PluginStore Author
     

    Re: How to get "Plugins" menu name in other language?

    Postby Dan Rathbun » Sat Dec 02, 2017 1:30 am

    You are attempting to write directly to the SketchUp registry hive whilst SketchUp itself is open ?

    IF SO, Do you expect SketchUp to be able to handle this ?
    Usually SketchUp overwrites any changes any code makes while SketchUp is open.
    Generally, This is NOT a safe scenario.
    0
      I'm not here much anymore. But a PM will fire email notifications.
      User avatar
      Dan Rathbun 
      PluginStore Author
      PluginStore Author
       

      Re: How to get "Plugins" menu name in other language?

      Postby TIG » Sat Dec 02, 2017 4:55 pm

      It's also a bad idea to set shortcuts anyway [even if you could do it effectively !] - the user might be angry at you when you overwrite their own shortcuts with yours !

      You can instruct the user of your tool how to add their own shortcuts, but don't force them - you are meant to be their friend, not their master.

      If you want the user to press certain keys to do certain things in your Tool, then you are pretty much limited to Ctrl, Alt, Shift and Tab, or say numbers 0-9 followed by other characters which can be parsed off from the user's typed text input - so "1:3" can be read in as a slope of "1 in 3", or "1left" gives "left" when leading numerals are stripped off...
      All other keys can potentially be already assigned to other tools and actions by the user, so pressing "L" for left is unlikely to work as that will likely invoke the "Line" tool - and it's including key-combos like Ctrl+Shift+V [typically for Edit>PasteInPlace]. So that's kind of use in your Tool is essentially a bad idea...
      1
      TIG
      User avatar
      TIG 
      Global Moderator
       

      SketchUcation One-Liner Adverts

      by Ad Machine » 5 minutes ago



      Ad Machine 
      Robot
       



       

      Return to Developers' Forum

      Who is online

      Users browsing this forum: No registered users and 15 guests

      Visit our sponsors: