Resource File
-
Hei, For multilingual application we have to use a new separate resource file for each form. So in this way we cannot reuse our translation that we have done in any other form. My question: Is there any way by with we can use a single global language resource file at all forms? In this way we may be able to resue our translations. Thanks
Syed Shahid Hussain
-
Hei, For multilingual application we have to use a new separate resource file for each form. So in this way we cannot reuse our translation that we have done in any other form. My question: Is there any way by with we can use a single global language resource file at all forms? In this way we may be able to resue our translations. Thanks
Syed Shahid Hussain
Why not bind to the default resource file instead and then localize that?
-
Why not bind to the default resource file instead and then localize that?
because it repeats the translation...
Syed Shahid Hussain
-
Hei, For multilingual application we have to use a new separate resource file for each form. So in this way we cannot reuse our translation that we have done in any other form. My question: Is there any way by with we can use a single global language resource file at all forms? In this way we may be able to resue our translations. Thanks
Syed Shahid Hussain
I don't understand exactly what you mean. Is it that you want to have one single big resource file for all your forms instead of one file per form, so that you can re-use e.g. the translation of the OK and Cancel buttons in many places? Well, it is possible. But then you must do a lot of the assignment of the localized text manually, something like
label1.Text = ResourceManager.GetString("Form1_label1_Text");
That can be automated, with automatically generated resource names. But if it is the translation which you want to re-use, that automatization won't help. You could extend all text containing elements with an extra property holding the resource name (thus allowing you to re-use the resource), but that will also take a lot of manual work before. Then you could get to somelabel1.Text = ResourceManager.GetString(label1.ResourceName);
which can be easily made more generic, with enumerating all components on a form etc. -
I don't understand exactly what you mean. Is it that you want to have one single big resource file for all your forms instead of one file per form, so that you can re-use e.g. the translation of the OK and Cancel buttons in many places? Well, it is possible. But then you must do a lot of the assignment of the localized text manually, something like
label1.Text = ResourceManager.GetString("Form1_label1_Text");
That can be automated, with automatically generated resource names. But if it is the translation which you want to re-use, that automatization won't help. You could extend all text containing elements with an extra property holding the resource name (thus allowing you to re-use the resource), but that will also take a lot of manual work before. Then you could get to somelabel1.Text = ResourceManager.GetString(label1.ResourceName);
which can be easily made more generic, with enumerating all components on a form etc.Thanks but i think in this way i'll wast much time. So the auto process thaat is waht i'm doing is fine i think....!!! Thanks after all...
Syed Shahid Hussain