Language pack resources aren't used

P

Peter Gibbons

Hello,

I have a localized german Windows XP SP3 with .Net 3.5 SP1 and german
and french language packs for the Framework installed.

When I use the following code the DisplayName information for the ga-ie
culture I get the NativeName instead of the localized ones for the
CurrentUICultures I have previously set, except for de-de.

MsgBox(System.Threading.Thread.CurrentThread.CurrentUICulture.Name)
System.Threading.Thread.CurrentThread.CurrentUICulture = New
System.Globalization.CultureInfo("de-de")
MsgBox(System.Threading.Thread.CurrentThread.CurrentUICulture.Name
& ": " & (New System.Globalization.CultureInfo("ga-ie")).DisplayName)
MsgBox(System.Threading.Thread.CurrentThread.CurrentUICulture.Name
& ": " & (New System.Globalization.CultureInfo("en-ie")).DisplayName)
System.Threading.Thread.CurrentThread.CurrentUICulture = New
System.Globalization.CultureInfo("fr-fr")
MsgBox(System.Threading.Thread.CurrentThread.CurrentUICulture.Name
& ": " & (New System.Globalization.CultureInfo("ga-ie")).DisplayName)
MsgBox(System.Threading.Thread.CurrentThread.CurrentUICulture.Name
& ": " & (New System.Globalization.CultureInfo("en-ie")).DisplayName)
System.Threading.Thread.CurrentThread.CurrentUICulture = New
System.Globalization.CultureInfo("en-us")
MsgBox(System.Threading.Thread.CurrentThread.CurrentUICulture.Name
& ": " & (New System.Globalization.CultureInfo("ga-ie")).DisplayName)
MsgBox(System.Threading.Thread.CurrentThread.CurrentUICulture.Name
& ": " & (New System.Globalization.CultureInfo("en-ie")).DisplayName)

I've also tested with the Windows 7 RC + all operating system language
packs installed and I only get the correct localized DisplayNames for
the CurrentUICulture that is the current users default.

For example, when I install the spanish and japanese Windows 7 language
packs I have to set the whole user profile to spanish or japanese to get
the localized DisplayNames.
How can I retrieve the localiued DisplayNames without changing the
system/user profile?

It shouldn't matter what system (XP/Vista/7/x86/x64) you use to
reproduce this but you should have at least 2 languages for .Net
installed. Either through a .Net language pack (like
http://www.microsoft.com/downloads/...FamilyID=8489ed13-b831-4855-96f7-dd35e4c02a20)
or with Vista and obove an operating system MUI pack.


Kind regards,

Peter
 
C

Cor Ligthert[MVP]

Peter,

I don't know if it matters but I always use "NL-nl" or things like that
(first in uppercase and second in lowercase)

Cor
 
C

Cor Ligthert[MVP]

You are right,

I always make this mistake, did you try it or are you only assuming?

Cor
 
P

Peter Gibbons

Hi Cor,

you can see that casing doesn't matter by stepping into the framework
code. It's at the beginning of the CultureInfo constructor.
Any other ideas about the wrong DisplayNames? Did you try my example code?


Regards,

Peter
 
C

Cor Ligthert[MVP]

Hi Peter,

I have tried it, since short I have installed an English OS on my computer,
I see now the same behaviour as you told.
As far as I remembered it me when I was using a Dutch OS it was going right
to English.

I have reported this on Connect.

Cor
 
M

Michael Williams

I have tried it, since short I have installed an
English OS on my computer . . .

Well it couldn't have been a Micro$oft Windows OS because Micro$oft do not
produce an English version of Windows, although they do rip off their
English customers by charging them extra for what they pretend is an English
version. The nearest you can get is an American version ;-)

Mike
 
P

Peter Gibbons

Hi Cor,

I've found your report on connect:
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=438933
--
This results in an English UI.
I was not able to install the Dutch Language pack on my computer.
It simply does nothing.

This is the result of an envoy from a message in a newsgroup from an
Microsoft Customer

CurrentThread.CurrentCulture = New System.Globalization.CultureInfo("nl-NL")
CurrentThread.CurrentUICulture = New
System.Globalization.CultureInfo("nl-NL")
MessageBox.Show(CurrentThread.CurrentCulture.DisplayName, "In
Dutch it is Ja and Nee", MessageBoxButtons.YesNo)
--
But you've missed my point. You experience problems installing .Net
language packs on Vista unless you have the equivalent MUI pack
installed. FYI: If you install the redistributable/full .Net 3.5SP1
package
(http://www.microsoft.com/downloads/...2F-5D1A-413D-8319-81DA479AB0D7&displaylang=en)
it automatically tries to download the language pack related to the
current MUI during install if you do not specify /LANG:ENU as a
parameter to the setup. Installation time heavily increases and .Net 3.5
without SP1 even crashed when setup isn't able to download the language
pack. So it isn't what anyone would expect from a "redistributable/full"
package. But that is not the problem I have.

There are also some other issues with .Net language packs:
' Why .NET Framework 2.0 language packs will not install correctly
on Windows Vista:
http://blogs.msdn.com/astebner/arch...l-not-install-correctly-on-windows-vista.aspx
' (2) .NET 2.0 Langauge Packs Install Bug on Vista x86 [language
pack vista localization]:
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=248621
' Enumerating available localized language resources in .NET:
http://blogs.msdn.com/michkap/archive/2006/03/25/560838.aspx
' Right behavior, wrong scenario:
http://blogs.msdn.com/michkap/archive/2007/01/02/1396598.aspx
' The .NET Framework 3.0 redistributable language packs and the
..NET Framework 2.0 redistributable language packs are not designed for
use with Windows Vista-based computers:
http://support.microsoft.com/kb/928637


But back to my problem. I explain it again for Vista.
Lets say you have an english Vista with 2 _MUI_ packs installed. For
example french and dutch. Then you install .Net 3.5 SP1 while logged on
with a dutch MUI active. If you have internet access the dutch language
pack will be downloaded and installed during setup automatically.
Afterwards you install the french .Net language pack to give users that
log on using the french MUI the localized .Net ressources; especially
error messages and like in your example button labels.

If you now log on using the dutch MUI you get the correct localized
DisplayName for the ga-ie culture in dutch, but after changing the
CurrentUICulture to fr-fr you don't get the french localized DisplayName
for the ga-ie culture. Instead you get the NativeName.
MsgBox(System.Threading.Thread.CurrentThread.CurrentUICulture.Name)
MsgBox(System.Threading.Thread.CurrentThread.CurrentUICulture.Name
& ": " & (New System.Globalization.CultureInfo("ga-ie")).DisplayName)
System.Threading.Thread.CurrentThread.CurrentUICulture = New
System.Globalization.CultureInfo("fr-fr")
MsgBox(System.Threading.Thread.CurrentThread.CurrentUICulture.Name
& ": " & (New System.Globalization.CultureInfo("ga-ie")).DisplayName)

When you log on using the french MUI you get the localized french
DisplayName but not the dutch one.
MsgBox(System.Threading.Thread.CurrentThread.CurrentUICulture.Name)
MsgBox(System.Threading.Thread.CurrentThread.CurrentUICulture.Name
& ": " & (New System.Globalization.CultureInfo("ga-ie")).DisplayName)
System.Threading.Thread.CurrentThread.CurrentUICulture = New
System.Globalization.CultureInfo("nl-nl")
MsgBox(System.Threading.Thread.CurrentThread.CurrentUICulture.Name
& ": " & (New System.Globalization.CultureInfo("ga-ie")).DisplayName)

So how can I get the localized dutch DisplayName for the ga-ie culture
while logged on with a french MUI?

Installing the dutch Vista MUI + .Net languag packe + setting the
CurrentUICulture doesn't work.

This problem doesn't occur with all cultures. If you replace ga-ie by
en-ie in the example above the correct localized DisplayNames will be
retrieved.


Regards,

Peter
 
P

Peter Gibbons

Hello,

those cultures where you get the localized DisplayNames are
"FrameworkCultures" and those where you get the NativeNames are
"WindowsOnlyCultures".

Console.WriteLine(System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.AllCultures).Length
-
System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.FrameworkCultures).Length
-
System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.WindowsOnlyCultures).Length)

It seems like the Framework doesn't retrieve the localized DisplayNames
from the operating system's language packs.

I'm not sure whether this can be called a bug. At least it is a
"disability".


Regards,

Peter


Peter said:
Hi Cor,

I've found your report on connect:
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=438933

--
This results in an English UI.
I was not able to install the Dutch Language pack on my computer.
It simply does nothing.

This is the result of an envoy from a message in a newsgroup from an
Microsoft Customer

CurrentThread.CurrentCulture = New
System.Globalization.CultureInfo("nl-NL")
CurrentThread.CurrentUICulture = New
System.Globalization.CultureInfo("nl-NL")
MessageBox.Show(CurrentThread.CurrentCulture.DisplayName, "In
Dutch it is Ja and Nee", MessageBoxButtons.YesNo)
--
But you've missed my point. You experience problems installing .Net
language packs on Vista unless you have the equivalent MUI pack
installed. FYI: If you install the redistributable/full .Net 3.5SP1
package
(http://www.microsoft.com/downloads/...2F-5D1A-413D-8319-81DA479AB0D7&displaylang=en)
it automatically tries to download the language pack related to the
current MUI during install if you do not specify /LANG:ENU as a
parameter to the setup. Installation time heavily increases and .Net 3.5
without SP1 even crashed when setup isn't able to download the language
pack. So it isn't what anyone would expect from a "redistributable/full"
package. But that is not the problem I have.

There are also some other issues with .Net language packs:
' Why .NET Framework 2.0 language packs will not install correctly
on Windows Vista:
http://blogs.msdn.com/astebner/arch...l-not-install-correctly-on-windows-vista.aspx

' (2) .NET 2.0 Langauge Packs Install Bug on Vista x86 [language
pack vista localization]:
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=248621

' Enumerating available localized language resources in .NET:
http://blogs.msdn.com/michkap/archive/2006/03/25/560838.aspx
' Right behavior, wrong scenario:
http://blogs.msdn.com/michkap/archive/2007/01/02/1396598.aspx
' The .NET Framework 3.0 redistributable language packs and the .NET
Framework 2.0 redistributable language packs are not designed for use
with Windows Vista-based computers: http://support.microsoft.com/kb/928637


But back to my problem. I explain it again for Vista.
Lets say you have an english Vista with 2 _MUI_ packs installed. For
example french and dutch. Then you install .Net 3.5 SP1 while logged on
with a dutch MUI active. If you have internet access the dutch language
pack will be downloaded and installed during setup automatically.
Afterwards you install the french .Net language pack to give users that
log on using the french MUI the localized .Net ressources; especially
error messages and like in your example button labels.

If you now log on using the dutch MUI you get the correct localized
DisplayName for the ga-ie culture in dutch, but after changing the
CurrentUICulture to fr-fr you don't get the french localized DisplayName
for the ga-ie culture. Instead you get the NativeName.
MsgBox(System.Threading.Thread.CurrentThread.CurrentUICulture.Name)
MsgBox(System.Threading.Thread.CurrentThread.CurrentUICulture.Name &
": " & (New System.Globalization.CultureInfo("ga-ie")).DisplayName)
System.Threading.Thread.CurrentThread.CurrentUICulture = New
System.Globalization.CultureInfo("fr-fr")
MsgBox(System.Threading.Thread.CurrentThread.CurrentUICulture.Name &
": " & (New System.Globalization.CultureInfo("ga-ie")).DisplayName)

When you log on using the french MUI you get the localized french
DisplayName but not the dutch one.
MsgBox(System.Threading.Thread.CurrentThread.CurrentUICulture.Name)
MsgBox(System.Threading.Thread.CurrentThread.CurrentUICulture.Name &
": " & (New System.Globalization.CultureInfo("ga-ie")).DisplayName)
System.Threading.Thread.CurrentThread.CurrentUICulture = New
System.Globalization.CultureInfo("nl-nl")
MsgBox(System.Threading.Thread.CurrentThread.CurrentUICulture.Name &
": " & (New System.Globalization.CultureInfo("ga-ie")).DisplayName)

So how can I get the localized dutch DisplayName for the ga-ie culture
while logged on with a french MUI?

Installing the dutch Vista MUI + .Net languag packe + setting the
CurrentUICulture doesn't work.

This problem doesn't occur with all cultures. If you replace ga-ie by
en-ie in the example above the correct localized DisplayNames will be
retrieved.


Regards,

Peter
Hi Peter,

I have tried it, since short I have installed an English OS on my
computer, I see now the same behaviour as you told.
As far as I remembered it me when I was using a Dutch OS it was going
right to English.

I have reported this on Connect.

Cor
 

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