Localizing strings in cfg file

Post questions, comments and feedback to our 3Dconnexion Windows Development Team.

Moderator: Moderators

Post Reply
PeteJ
Posts: 11
Joined: Tue Apr 26, 2016 6:35 am

Localizing strings in cfg file

Post by PeteJ » Wed May 11, 2016 5:34 am

I have created some new macros which I will ship in my XML cfg file. These macros have names (in English). eg
<ButtonAction Type="App">
<ID>MACRO hide unhide</ID>
<Name>Hide unhide</Name>
</ButtonAction>

What other files do I have to ship or modify to make these English names appear in different languages?

jwick
Moderator
Moderator
Posts: 2563
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Localizing strings in cfg file

Post by jwick » Wed May 11, 2016 5:51 am

Sorry. I have not implemented that yet. I'm torn between having you put all the languages in your cfg file (easy to ship) or put them in separate files like we do it (easy to update). I'll probably go with the former. For now you just have one language.

PeteJ
Posts: 11
Joined: Tue Apr 26, 2016 6:35 am

Re: Localizing strings in cfg file

Post by PeteJ » Wed May 11, 2016 5:56 am

could you have sub folders off the 'cfg' folder for each language eg 'de-de', and in there is an XML file of the same name as the apps XML cfg file which contains the localized strings
ie
"C:\Program Files\3Dconnexion\3DxWare\3DxWinCore64\Cfg" contains MyApp.xml which is the cfg for my application
"C:\Program Files\3Dconnexion\3DxWare\3DxWinCore64\Cfg\de-de" contains MyApp.xml which contains the German (German) localized strings for my configuration.

etc

jwick
Moderator
Moderator
Posts: 2563
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Localizing strings in cfg file

Post by jwick » Wed May 11, 2016 6:18 am

That was my first approach but in %PROGRAMDATA% because ISV installers don't have write access to ProgramFiles. I found though that my Cfg authors wouldn't update the ancillary files.

So it will probably be the elements from our Language files (PF/Cfg/en-US.xml/LocalizationTables/StringTable & MacroTable) placed in your cfg file. I have a syntax problem because I didn't put the LocaleName inside a LocalizationTable container. It is hanging in space inside the outer tableS container. I have to fix that up.

So it will probably be:

Code: Select all

<AppCfg>
....
<LocalizationTables>
  <LocalizationTable default="true">
     <LocaleName>en-US</LocaleName>
     <StringTable>...
     <MacroTable...
  </LocalizationTable>
  <LocalizationTable>
     <LocaleName/>
     <StringTable>...
     <MacroTable...
  </LocalizationTable>
...
</LocalizationTables>
...
</AppCfg>

But I should mention that there is a better way of getting things localized. You probably don't care about having all the languages you support available. You probably only care that the customer's current language settings are used. You probably have all these strings inside your application. We have an API that allows you to export your strings at run-time. It also allows you to export all your commands in a structured / hierarchical way to our GUI so they show up with the tree structure your customers are used to.

This is our so called Action Interface API.

If you only have a few hard-coded commands to support, it probably isn't worth doing. But if, in particular, you have different modes of your application (e.g, part, drafting, assembly modes), each mode will have different relevant commands. In that case, it is probably worth doing. And when you add commands, they automatically get shown to the 3D mouse user.

PeteJ
Posts: 11
Joined: Tue Apr 26, 2016 6:35 am

Re: Localizing strings in cfg file

Post by PeteJ » Wed May 11, 2016 6:38 am

Currently I have a dozen or so strings - so not really a problem.

But you now have me intrigued by being able to have different sets of commands depending on the state of the application. Where can I find out more about the 'Action Interface API' ?

jwick
Moderator
Moderator
Posts: 2563
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Localizing strings in cfg file

Post by jwick » Wed May 11, 2016 7:10 am

The SDK has an actions_settings_sample demo.
It is being extended to also use your command icons. It can show them in the GUI and on the SpaceMouse Enterprise LCD.

PeteJ
Posts: 11
Joined: Tue Apr 26, 2016 6:35 am

Re: Localizing strings in cfg file

Post by PeteJ » Wed May 11, 2016 7:52 am

can the API be used when using 'raw input' ?

jwick
Moderator
Moderator
Posts: 2563
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Localizing strings in cfg file

Post by jwick » Wed May 11, 2016 8:02 am

In principle yes. You could have a Raw Input connection and a 3Dx API connection. The action_interface is part of the 3Dx API. But the driver does not currently allow you to have two different protocols for the same application (I don't know which one to talk/listen on).

Why are you using Raw Input? It's a fine API, in general, but it does not have any support for all these other things we are doing.

PeteJ
Posts: 11
Joined: Tue Apr 26, 2016 6:35 am

Re: Localizing strings in cfg file

Post by PeteJ » Wed May 11, 2016 8:07 am

Our application is a 'managed' C# front end, and an 'unmanaged' C++ back end. Currently the spaceball input is being captured in the C# as raw input.

jwick
Moderator
Moderator
Posts: 2563
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Localizing strings in cfg file

Post by jwick » Wed May 11, 2016 8:12 am

You can call the 3Dx API from C#. We have a marshalling layer sample.
It's up to you.
If you are interested, contact the api support email.

Post Reply