How to translate 'Ctrl' to "Strg' for German localization?

G

Guest

My .NET application is using shortcut keys Ctrl+P etc. When I localize my
form into German, I want the shortcut to be shown as 'Strg+P' just as other
localized applications do (e.g. Internet Explorer).

How can I make this localization happen?

Thank you!
 
G

Guest

I should add that the shortcut key is part of the standard .NET menu control.
I can't find the 'Ctrl' string in the default .resx file, so I can't provide
a German translation for it myself.

Note that the application is fully localized, and all application strings
(from the .resx files) are shown in German.
 
H

Herfried K. Wagner [MVP]

Per Hellberg said:
My .NET application is using shortcut keys Ctrl+P etc. When I localize my
form into German, I want the shortcut to be shown as 'Strg+P' just as
other
localized applications do (e.g. Internet Explorer).

\\\
Imports System.ComponentModel
Imports System.Windows.Forms
..
..
..
Dim sc As Shortcut
For Each sc In [Enum].GetValues(GetType(Shortcut))
Me.ComboBox1.Items.Add( _
TypeDescriptor.GetConverter( _
GetType(Keys) _
).ConvertToString(CType(sc, Keys)) _
)
Next sc
///

Keywords: shortcut, menu, menu item, localized, language.
 
G

Guest

Thanks!

This seems to give my application the translated strings.

But I don't display the shortcut keys in the menu myself. I have used the
menu properties to specify the shortcut key, and when the application is run,
Windows (or .NET??) shows the shortcut key as part of the menu, like "Ctrl+P".

So what I'm looking for is not merely to get the translations, but to have
Windows/.NET automatically show "Strg+P" when the thread's UI culture is
German.

Thanks!

Herfried K. Wagner said:
Per Hellberg said:
My .NET application is using shortcut keys Ctrl+P etc. When I localize my
form into German, I want the shortcut to be shown as 'Strg+P' just as
other
localized applications do (e.g. Internet Explorer).

\\\
Imports System.ComponentModel
Imports System.Windows.Forms
..
..
..
Dim sc As Shortcut
For Each sc In [Enum].GetValues(GetType(Shortcut))
Me.ComboBox1.Items.Add( _
TypeDescriptor.GetConverter( _
GetType(Keys) _
).ConvertToString(CType(sc, Keys)) _
)
Next sc
///

Keywords: shortcut, menu, menu item, localized, language.
 
H

Herfried K. Wagner [MVP]

Per Hellberg said:
So what I'm looking for is not merely to get the translations, but to have
Windows/.NET automatically show "Strg+P" when the thread's UI culture is
German.

Did you test the application on a system with the .NET Framework + German
language pack installed?
 
G

Guest

I created a small test application using the US version of .NET. I then ran
it in a machine running Windows XP with MLP installed for German. My own text
translations then show up in German, as does all Windows applications. But
the shortcut still is shown as "Ctrl+P".

I looked at Internet Explorer, and it changes its menu shortcut keys from
Ctrl to Strg as soon as I set the UI language to German (and log back on).

In addition, our application is being translated by a team in German, so I
assume they are actually working on a "real" German Windows system.

But I don't know if we have installed any special German language pack for
..NET -- is there such a thing?

Thanks!
 
G

Guest

Thank you!!!

After my response, I went to MSDN and found the German language pack for
..NET. I installed it and my problem has been fixed!

It seems that, for whatever reason, even our German translators have not
installed the language pack. Perhaps this isn't automatically done when .NET
is installed.

Again, thanks so much for your quick help!
 
H

Herfried K. Wagner [MVP]

Per Hellberg said:
After my response, I went to MSDN and found the German language pack for
.NET. I installed it and my problem has been fixed!

I am glad to hear that you were able to solve the problem.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top