Author Topic: Working with registry in different languages  (Read 2988 times)

0 Members and 1 Guest are viewing this topic.

Peter2

  • Swamp Rat
  • Posts: 653
Working with registry in different languages
« on: July 08, 2015, 06:12:48 AM »
Modifying the registry (e.g. for Profiles) has the challenge of different languages. Here is a value from my German AutoCAD - you see the mixture of English and German:

Code - Auto/Visual Lisp: [Select]
  1. Windows Registry Editor Version 5.00
  2.  
  3. [HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R19.0\ACAD-B001:407\Profiles\Peter\Dialogs\Datei wählen]
  4. "PreviewVisible"=dword:00000001
  5.  

Who has experience in this topic? How to handle the different keys in different languages? Is it possible to use only English and it will work in all other languages? Or not?

Thanks
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

kpblc

  • Bull Frog
  • Posts: 396
Re: Working with registry in different languages
« Reply #1 on: July 08, 2015, 07:05:10 AM »
use (vlax-product-key) function to get "Software\Autodesk\AutoCAD\RXX.X\ACAD-YYYY:ZZZ" value
Sorry for my English.

Peter2

  • Swamp Rat
  • Posts: 653
Re: Working with registry in different languages
« Reply #2 on: July 08, 2015, 08:54:07 AM »
But how this will help if I have
- "Datei wählen" in German
- "Select file" (File select?) in English
- "Selectionez fichier" in French?
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

ChrisCarlson

  • Guest
Re: Working with registry in different languages
« Reply #3 on: July 08, 2015, 09:00:04 AM »
So you want prompts based on local language?

ChrisCarlson

  • Guest
Re: Working with registry in different languages
« Reply #4 on: July 08, 2015, 09:03:57 AM »
You could incorporate Google Translate and send each prompt into the translator as English and print with the translation?

kpblc

  • Bull Frog
  • Posts: 396
Re: Working with registry in different languages
« Reply #5 on: July 08, 2015, 09:43:12 AM »
It seems very strange. I use two localizes: russian and english. Dialogs subhives have same names - LayerManager, DrawingSettingsDialog and so on. Because of this (i hope) all you have to do is to get correct registry hive and profile name.
Sorry for my English.

Peter2

  • Swamp Rat
  • Posts: 653
Re: Working with registry in different languages
« Reply #6 on: July 08, 2015, 09:47:01 AM »
The registry-key I posted above is ...

a) a current "project" to set the preview-window in file-open-dialogue
(If there is an existing solution - hints are welcome).

b) a good example for the problem.

"How to create a Lisp which ...
a) switch the key "PreviewVisible" between 0 and 1
b) works in current AutoCAD-version (2012 - 2016)
c) and in "all" languages?


to a) Simple vl-registry-write. No problem.

to b) I have to loop through versions and profiles and ....
That should be no problem; snippets are here in the Swamp

to c) How to know / to find / to select language-dependent keys like "Datei wählen"? To solve it for one language is clear, but how to solve it for "all" languages?

...Dialogs subhives have same names - ....
Really every key? I have a few keys (see above) which are in German; the greatest part is in English.
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Working with registry in different languages
« Reply #7 on: July 08, 2015, 10:24:22 AM »
How about using
Code - Auto/Visual Lisp: [Select]
  1. (setenv "PreviewVisible" "0")

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Peter2

  • Swamp Rat
  • Posts: 653
Re: Working with registry in different languages
« Reply #8 on: July 08, 2015, 01:28:52 PM »
How about using
Code - Auto/Visual Lisp: [Select]
  1. (setenv "PreviewVisible" "0")
Thanks. Sounds great and can be set, but ...

a) it has no effects. Neither after restart of AutoCAD.
b) the second question (language depending keys) is still unsolved.
Peter

AutoCAD Map 3D 2023 German (so some technical terms will be badly retranslated to English)
BricsCAD V23

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Working with registry in different languages
« Reply #9 on: July 08, 2015, 01:55:51 PM »
If you're only dealing with 3 languages, why not just use a conditional statement using (getvar 'locale) ?

Code - Auto/Visual Lisp: [Select]
  1. (strcat "HKEY_CURRENT_USER\\"
  2.         (vlax-product-key)
  3.         "\\Profiles\\"
  4.         (getvar 'cprofile)
  5.         "\\Dialogs\\"
  6.         (cond ((= "ENU" (getvar 'locale)) "Select File")
  7.               ((= "DE" (getvar 'locale)) "Datei wählen")
  8.               ((= "FR" (getvar 'locale)) "Selectionez fichier")
  9.               ("")
  10.         )
  11. )
« Last Edit: July 08, 2015, 02:14:36 PM by ronjonp »

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Working with registry in different languages
« Reply #10 on: July 09, 2015, 04:30:41 AM »
How about using
Code - Auto/Visual Lisp: [Select]
  1. (setenv "PreviewVisible" "0")
Thanks. Sounds great and can be set, but ...

a) it has no effects. Neither after restart of AutoCAD.
For BricsCAD I have found that changing BricsCAD registry settings during a CAD session is not effective. The program reads settings at startup, and it is obviously 'aware' of changes made using setvar etc. But it does not reread the registry during a CAD session. And when the program closes it writes the settings it has stored back to the registry. This means, indeed, that registry changes made through Lisp do not have any effect and are lost when the program closes.