Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
M_Stolle Absent Member.
Absent Member.
1655 views

Change display language

Hello,

using latest .NET SDK with StarTeam 16. How do I set the output language? Right now it uses my System locale but I want the english output.

Thanks in advance

0 Likes
6 Replies
Micro Focus Expert
Micro Focus Expert

RE: Change display language

you change the output language to english using the JRE setting -Duser.language=en
0 Likes
M_Stolle Absent Member.
Absent Member.

RE: Change display language

Where?
0 Likes
Micro Focus Expert
Micro Focus Expert

RE: Change display language

oh sorry. i missed the part where you said .NET. I provided a response for java.

you need to change the assembly culture &/or neutral resource language.


You could compile your code using
[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en-US")]

there's are some old microsoft knowledgebase article on changing resource cultures here
msdn.microsoft.com/.../s9ckwb4b(v=vs.100).aspx
msdn.microsoft.com/.../system.globalization.cultureinfo.currentculture(v=vs.110).aspx

the sdk itself does not do anything special with regard to returning culture specific data.
it always defaults to the system culture specified for the assembly at runtime.
To get a different culture, you override the default.
0 Likes
M_Stolle Absent Member.
Absent Member.

RE: Change display language

[assembly: AssemblyCulture("")]
[assembly: NeutralResourcesLanguage("en-US")]

added to AssemblyInfo.cs but it has no effects on the StarTeam output locale. There is a StarTeam.Translations class, maybe I have to use this one?
0 Likes
Micro Focus Expert
Micro Focus Expert

RE: Change display language

>>There is a StarTeam.Translations class, maybe I have to use this one?
This will provide you with display name translations for properties against different locales (as long as they are supported).

see

/**
* Returns a copy of the display name translations for this property. Will
* return null for client calculated properties. When working against
* servers that do not support display name translations the returned
* Translations object will only have the default value set.
*
* @return a copy of the Display Name Translations
*/
public Translations Property::DisplayNameTranslations()


The more general problem of having the SDK surface all it's resources (including exceptions) in a specific supported language, which is not the System default culture, requires you to run the assembly in the context of that culture.
0 Likes
M_Stolle Absent Member.
Absent Member.

RE: Change display language

Adding

Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-US");
Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US");

to main thread helped

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.