Globalization Questions
-
- Posts: 33
- Joined: Sun Jul 02, 2006 6:06 pm
- Location: New Zealand
Globalization Questions
I have looked over the Globalized Report sample but still have a few questions.
Firstly how to actually make the report localizable. From the sample I'm assuming you give the text a name in the GlobalizedName property. And that will get loaded by the GlobalizationManager - if this is the case this is fine.
My first question is I can't find where the different flags get loaded in the sample. Where / how are the flags loaded with the localized flag?
My second question is what is the 'GlobalizationStrings' property and how is it used?
Thanks
Firstly how to actually make the report localizable. From the sample I'm assuming you give the text a name in the GlobalizedName property. And that will get loaded by the GlobalizationManager - if this is the case this is fine.
My first question is I can't find where the different flags get loaded in the sample. Where / how are the flags loaded with the localized flag?
My second question is what is the 'GlobalizationStrings' property and how is it used?
Thanks
Globalization Questions
1. You need override method GetImageGlobalizedNames:I have looked over the Globalized Report sample but still have a few questions.
Firstly how to actually make the report localizable. From the sample I'm assuming you give the text a name in the GlobalizedName property. And that will get loaded by the GlobalizationManager - if this is the case this is fine.
My first question is I can't find where the different flags get loaded in the sample. Where / how are the flags loaded with the localized flag?
Code: Select all
public string[] GetImageGlobalizedNames()
{
return new string[]
{
"Flag"
};
}
2. You need override method GetObject:
Code: Select all
public object GetObject(string name)
{
return nativeManager.GetObject(name, Culture);
}
This is second way for localizing report. You can specify translation of all words in report with special editor.My second question is what is the 'GlobalizationStrings' property and how is it used?
Thank you.
-
- Posts: 33
- Joined: Sun Jul 02, 2006 6:06 pm
- Location: New Zealand
Globalization Questions
We have implemented Globalization using GlobalizationManager.cs from your Globalization example.
We have a Globalization class which is just a copy of the same class from the Globalization example
Then in the constructor of our report we have
This work but has 2 problems for us. It works by actually loading the values we want from the resx file and updates the report accordingly.
The first problem (not really a problem) is that we noticed it loads the values twice. Once when the GlobalizationManager is created, and again when the report is shown - is this normal and expected?
The second problem is that we are using a culture invariant resx file. We have 'strings.en.resx'. Our culture is 'en-NZ', so we'd expect that the 'strings.en.resx' file is loaded, but instead the default 'strings.resx' file is loaded. Are we doing something wrong?
Thanks
We have a Globalization class which is just a copy of the same class from the Globalization example
Code: Select all
public class GlobalizationManager : IStiGlobalizationManager
Code: Select all
report.AutoLocalizeReportOnRun = true;
//Set globalization
reportFile.GlobalizationManager = new GlobalizationManager("FPH.PerfMax.Globals.LocalStrings", CultureInfo.CurrentCulture);
The first problem (not really a problem) is that we noticed it loads the values twice. Once when the GlobalizationManager is created, and again when the report is shown - is this normal and expected?
The second problem is that we are using a culture invariant resx file. We have 'strings.en.resx'. Our culture is 'en-NZ', so we'd expect that the 'strings.en.resx' file is loaded, but instead the default 'strings.resx' file is loaded. Are we doing something wrong?
Thanks
Globalization Questions
That s normal.The first problem (not really a problem) is that we noticed it loads the values twice. Once when the GlobalizationManager is created, and again when the report is shown - is this normal and expected?
With Globalization manager you can use any method for localizing. Class "GlobalizationManager" is only sample. Using of resx file is sample too. You can use any way for returning correct string for provided string key.The second problem is that we are using a culture invariant resx file. We have 'strings.en.resx'. Our culture is 'en-NZ', so we'd expect that the 'strings.en.resx' file is loaded, but instead the default 'strings.resx' file is loaded. Are we doing something wrong?
Thank you.
-
- Posts: 33
- Joined: Sun Jul 02, 2006 6:06 pm
- Location: New Zealand
Globalization Questions
We are currently using a resx file for localizing our application (GUI, Forms, etc), so using the same resx file for the report is the best choice for us. We use a ResouceManager to load the resx file based on an invariant culture. So we have a 'strings.en.resx', a 'strings.fr.resx', and a 'strings.de.resx' files. If we are in 'en-NZ' culture, we would expect the ResourceManager to load the 'strings.en.resx' file, which it does. However when we create a GlobalizationManager for the report with the same resx files using the 'en-NZ' culture, it always seems to want to load the 'strings.en-NZ.resx' file or the 'strings.resx' file. Is it possible to have it load the invariant resx file? For example, we want it to load the 'stirngs.en.resx' file for all the 'en-XX' cultures.Vital wrote:
With Globalization manager you can use any method for localizing. Class "GlobalizationManager" is only sample. Using of resx file is sample too. You can use any way for returning correct string for provided string key.
Thank you.
Globalization Questions
Please use small method:
Thank you.
Code: Select all
public CultureInfo GetCulture(string cultureName)
{
if (cultureName.Length > 2)cultureName = cultureName.Substring(0, 2);
return new CultureInfo(cultureName);
}