MapWindow Developer Team : MapWindow Discussion Forum
First let me introduce myself. I'm Paul, 30 years, live in The Netherlands and work at The Soilcompany (www.soilcompany.com). For more than 10 years I try to program some application. First started with C and MDL (Microstation Development Language, Microstation is like AutoCad).
Pages: Previous123
Current Page: 3 of 3
Re: Internationalization, languages, and such
Posted by: pmeems ()
Date: August 16, 2006 08:34AM

Still no response.

I've been investigating some more and I think the best solution is to add a new class. In this class a static function getString will be placed which gets the string from the resourcefile in the correct language.

This week I won't have the time to work on this, but without any response I'll try this solution next week.

If somebodyelse with more experience in .NET is willing to create the class don't hesitate to do so ;)

--
Paul


--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: Internationalization, languages, and such
Posted by: ForestChen ()
Date: August 16, 2006 10:21AM

Hi Paul,
I did some experiments on VS2005 and figured out the following:

>> * How can I check if the resourcefiles have all the strings? I now I can do it by >> hand.
>> * How can I prevent VS2005 of regenerating the resourcefiles?

Sometimes VS2005 does strange things on resourcce files, especially when the resource file is generated by vs2003. Currently the only way I know to check this is to make sure all the tags in English also reside in your language, and all of them have a correspoinding content for the translated string.

>> * If something is altered in a form, due to a bug or enhancement are all resource >> strings added by hand gone? This would explain why I had to translate some
>> forms again last week I already had done last year.

I havent' figured out the pattern yet. If the resource file is gernerated by vs2003, and used by vs2005, you get a 50% chance to lose the manual changes. I don't know whether it is a bug or compatibility issue of vs2005 or not.

Options: ReplyQuote
Re: Internationalization, languages, and such
Posted by: pmeems ()
Date: August 17, 2006 08:14AM

Forest,

I have already figured out that it is 'by design' that after changing the form using the designer the resourcefile are regenerated.
So to keep the manual changes an additional resource file is needed.
As I mentioned it my previous post the best way is to create a new static/shared class (named MW_forms.vb) with a accompaning resourcefile MW_forms.resx.
In this resource file all manuel entries of all forms should be put.

I haven't tried it yet and I'm going to be a lot out of the office this and next week so I haven't got the time to try it either.

If you would take a look at it if it works, that would be great.


--
Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: Internationalization, languages, and such
Posted by: ForestChen ()
Date: August 17, 2006 08:41AM

Paul,
I will give it a shoot and see what happens.

Thanks,
Forest.

Options: ReplyQuote
Re: Internationalization, languages, and such
Posted by: ForestChen ()
Date: August 17, 2006 03:53PM

Paul,
I have tried your approach and I think it is doable, but another simple way might be just gernerating and editing new resource files using VS2005's FormDesigner. This will make sure all your change won't be lost.
And the way to use FormDesigner to genenerate/edit resource files is the same as which is in vs2003, you can referece the internationlization manual document for detials

Thanks,
Forest.

Options: ReplyQuote
Re: Internationalization, languages, and such
Posted by: pmeems ()
Date: August 21, 2006 03:25AM

Forest,

I think we don't understand each other. So I've done a test and (luckally) found the same problems.
Would you please do the same steps so we get on the same line?

First create a new form (using VS2005) Add new item -> Windows form. Name this form 'frmTestLocalize.vb'
On this form just put one very wide button, name this button btnTest and put as Text 'On this button localized text will be put'

Go the the properties of the form and set Localizable to True, keep the language on 'Default'. Save the form.

Now go back the the language and change as you will, I've used Dutch of course.
Using the property window change the title of the form into else: "Dit is de Nederlandse versie" and change the text of the button to: "Hier komt de Nederlandse tekst". Save the form.
3 files have been created now:
frmTestLocalize.vb
frmTestLocalize.resx (default language)
frmTestLocalize.nl.resx (translated)

Go the the form designer dubble click on the button and a function will be created:
btnTest_Click.
Change it to:
Private Sub btnTest_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnTest.Click
  Dim sMsg As String = resources.GetString("msgTest.Text")
  MsgBox(sMsg)
End Sub
Add in the declaration area of the form:
Private resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmTestLocalize))

Open rmTestLocalize.resx in Notepad and add the following lines at the end but in the root-node:
<data name="msgTest.Text" xml:space="preserve">
  <value>This is the English message</value>
</data>
Open the translated resourcefile, in my case it is frmTestLocalize.nl.resx and also add the following lines at the end but in the root-node:
<data name="msgTest.Text" xml:space="preserve">
  <value>Dit is het Nederlandse bericht</value>
</data>

When you would run this form and click on the button the text would be shown in the messagebox according to your language settings. In my case "Dit is het Nederlandse bericht" would be put.

So far so good.

But when I change something on the form in the formdesigner, for instance I resize the form and save it again. The resourcefile is regenerated and the added string: msgTest.Text is vanished.
So set the language of the form, in my case Dutch. Resize the form. Save the form.
Open frmTestLocalize.nl.resx in Notepad and look for msgTest.Text. Nothing is found.
Run the form, push the button and an empty messagebox is shown, because the resourcefile is found but the string isn't.

So this is the problem. And to solve this I've mentioned to add a new class with a resourcefile which would hold all manual resourcestrings like msgTest.Text not the strings for the forms or the buttons.

As I understand it right from your post before last you've created this class. But it's not yet added to the repository.
I hope you will after reading this post ;)

--
Paul


--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: Internationalization, languages, and such
Posted by: ForestChen ()
Date: August 21, 2006 11:26AM

Hi Paul,
Now I see what the problem is, sorry for the misunderstanding:)
Acututally that is a normal behavior of VS2005. A resource file dedicated for a form only serves the items on the form, any manual change would be lost because each time you change the form (e.g. resize it), the resource files would be regenerated. There are two ways to solve this problem:

1. Put som hidden labels on the form and let them hold the strings you want to localize. --- this works fine but looks a little bit dirty:)
2. Add a resource file to the project manually instead of letting the form designer generate one for you. By doing so you get a resource file that is not assoicated with any form or class. You can access this resource file by using the resource manager like this:
ResourceManager resourceManager = new ResourceManager ("SomeNameSpace.SomeResources", GetType ().Assembly);
Remember to name the resource file as "SomeResources.xxx.resx" and put it under the name space "SomeNameSpace". here the "xxx" represents the local language, in your case is "nl". By doing so, you don't have to create an extra class to associate the resource file with, and make the logic of your code a little bit cleaner.

Hope that helps.

Thanks,
Forest.

Options: ReplyQuote
Re: Internationalization, languages, and such
Posted by: pmeems ()
Date: August 22, 2006 12:18AM

Forest,

Good to read we're on the same line now ;)

I've tried your solution creating a new resourcefile last week, but I can't get it to work. Ik keep getting an error about the Manifest, probably because I don't use the correct namespace.
When I was looking for a solution I found the option to create a new class so the resource file would be easier to find.

If you would create a working resourcefile I'll put all the strings in it and create a translated Dutch version of it.

--
Paul


--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: Internationalization, languages, and such
Posted by: ForestChen ()
Date: August 22, 2006 11:53AM

Paul,

I have created a sample project for you:
[chenlailin.googlepages.com]
Please pay attention to the relationship between the resource file names, namespace and the first parameter in new ResrouceManager(). It is quite tricky:)

Hope that helps.

thanks,
Forest

Options: ReplyQuote
Re: Internationalization, languages, and such
Posted by: wahono ()
Date: September 06, 2006 04:38AM

Hi all...

I'd like to localized the language of MW into Bahasa Indonesia. I use VS 05, but I really new to this environment. I've downloaded the source... but when I open the solution, it has 2 error messages:
- 'Resources' is not a member of 'My' (file: frmErrorDialog-NoSend.vb; line:101), and
- Name 'Global' is not declared (file: frmErrorDialog.vb ; line: 131)

Anyone can help me?

Options: ReplyQuote
Re: Internationalization, languages, and such
Posted by: cmichaelis ()
Date: September 06, 2006 09:41AM

Hi there

Both of the lines that you mentioned are generated by the Visual Studio 2005 form designer, so it's very odd they're bringing up errors on your machine! What happens if you view the form and change something? It should regenerate all of that code.

Forest may have more input on this, internationalization isn't my specialty :)

Thanks
--Chris

Options: ReplyQuote
Re: Internationalization, languages, and such
Posted by: danames ()
Date: September 06, 2006 10:47AM

May I suggest that you take the alternate simplified appraoch to internationalization? In this approach, you simply need to edit the XML resource files to include your language, and then send those to Mr. Forest Chen who will recompile the source code with your resource files. There is a discussion of the approach here: [www.mapwindow.org]. - Dan

Options: ReplyQuote
Re: Internationalization, languages, and such
Posted by: tiggalot ()
Date: March 07, 2007 09:11AM

Today my boss asked me o translate MapWindow into german. I´ve already translated most of the static text in the forms and now I´ve got a little problem... Most of the forms are dimensiones for english text but the german translation needs more space to keep the text understandable. Is there a way to keep the size changes of the form to fit the german text without having to change it for everyone else or will I have to rewrite it to fit into the forms?

Furthermore when I compile and run MapWindow in the upper menu everything starts with mnu (mnuFile, mnuEdit ...). What is it I´ve forgotten?
Edit: Ok, this was because I forgot to copy some strings into my resx file so it was my own stupidity ^^

PS: Sorry for my bad english but the cold I´ve caught and the overtime today make it difficult to write normal sentences ^^



Edited 1 time(s). Last edit at 03/08/2007 02:42AM by tiggalot.

Options: ReplyQuote
Re: Internationalization, languages, and such
Posted by: pmeems ()
Date: March 10, 2007 02:15PM

Tiggalot,

If you want to alter the dimensions as well, you need to open the solution in VS2005.
Next you go to the form you want to edit and set the language to German. Because you've already translated the text you'll see the German text on the form. Now you can alter the dimensions of the buttons, labels, etc. and those dimensions will go in the German resource file.
You can check by setting the langauage of the form back to English.

Hope it helps neighbor (I'm, from the Netherlands)

Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: Internationalization, languages, and such
Posted by: tiggalot ()
Date: March 19, 2007 04:00AM

Thank you Paul for your help.

I´ve already translated and resized working in VS2005 so I hope everything will work fine ^^

Hope I didn´t forget something in the package I´ve sent Dan earlier today :)

Thomas


Edit:
After the harddisk of the notebook I´ve been working on decided to commit suicide I´ve had to start over a little. I´m glad that the files I´ve sent were alreadyd implemented in the SVN Repository so I didn´t need to ask you to send me a copy ^^

Well now here´s the reason I´m writing. I´ve tried to localize the integrated plugins like the atribute table editor. The static form part is already done but I´ve got some problems with the atribute table editor. Most of the menu buttons (like insertion of field, queries etc.) don´t react when cliking on them.

Further I tried to edit the code as descripted in the localizaton guide so I could change some values but now wherever I´ve changed the Text into a variable there is the variable name instead of the text I´ve written in the ressource file.



Edited 1 time(s). Last edit at 03/22/2007 09:44AM by tiggalot.

Options: ReplyQuote
Re: Internationalization, languages, and such
Posted by: jirikadlec2 ()
Date: February 01, 2008 04:30AM

Dear MapWindow team,
To fix the bug "missing text in dialog box" experienced by some international MapWindow users (bug #676), I had to make some
small changes in the MapWindow source code and the resource files. The reason for the changes is explained in [www.mapwindow.org] and
[bugs.mapwindow.org]

Here is the list of changes:

1) created a new resource file (GlobalResource.resx). This file
contains the texts for dynamically created messages and dialog
boxes and should be placed in the root directory of MapWindow
(MapWindow4dev/MapWindow/)

2) Extracted the texts of dynamically created messages, dialog
boxes and dynamic menu items from the form resource files and moved
them to the newly created resource file (GlobalResource.resx, GlobalResource.zh-CHS.resx,...). Did this for all languages where
a translation exists.

3) Changed the declaration of ResourceManager in the form constructor to
Private resources As System.Resources.ResourceManager = New System.Resources.ResourceManager("MapWindow.GlobalResource", System.Reflection.Assembly.GetExecutingAssembly())
so that ResourceManager searches for the translated strings in the new file GlobalResource.resx.

4) Changed instructions in the translation manual (languages.doc) for translating dynamically created messages and dialog box texts in MapWindow. GlobalResource.zh-CHS.resx)

It was necessary to move the dynamic messages from the form resource files to a separate resource file, because after some changes in the form design view are made by MapWindow developers, the form default resource file (for example frmMain.resx) is overwritten by Visual Studio.NET and some users see missing texts in message and dialog boxes.

Now I'm working with my colleagues on the Czech translation of Mapwindow, it's getting ready and will be finished soon!

Best regards,

Jiří­ Kadlec
Department of Physical Geography
Charles university Prague
Czech Republic

web: [grafy.plaveniny.cz]

Options: ReplyQuote
Re: Internationalization, languages, and such
Posted by: pmeems ()
Date: September 15, 2008 12:21AM

More and more people are translating MapWindow into their preferred language.
That's a good development.
For all those newbies the steps to translate:

Download all code from SVN.
Go to C:\dev\MapWindow4Dev (if you have downloaded the source code to C:\dev).
And start with opening MapWindow.sln.
Next open a form. The sequence isn't important. In the property field of the form you set the language to the language you want. Check that Localizable is set to True!
Because it's a new language the text on the form remains English but the new resource files have been made.
Now you can change the text on the form and replace it with the new translation. You can even change the controls a bit if the new text doesn't fit.
When you're done you can run the application and check the translation. When you're satisfied send the resx files to me or Chris M. and we'll add them to the repository.
If you've enjoyed it, you could also translate the core plug-in. They are MWPluginsCS.sln and MWPluginsVB.sln

Hope it helps.

Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: Internationalization, languages, and such
Posted by: mlt ()
Date: January 24, 2010 09:47PM

Should RTF_HEADER (from frmPlugins.vb of MapWindow project) go to resources instead of being a constant? Since RTF is not "wide-character" compatible, one should be able to specify his/her own codepage and language in RTF to show plugin detail fields in other languages than English.

Options: ReplyQuote
Re: Internationalization, languages, and such
Posted by: pmeems ()
Date: January 25, 2010 02:28PM

That's a good point. Could you submit it to Mantis?

I've seen several good suggestions by you. It seems you know what you're talking about.
Have you already added yourself to the MW Team page?

If so I can request SVN commmit rights for you.

Thanks,

Paul

--
Don't forget to read the new documentation: www.mapwindow.org/documentation/mapwingis4.8
Join us Google+: MapWindow GIS Google+ Community
Join the MapWindow Group on LinkedIn! LinkedIn - MapWindow Group

Download the latest beta installer at:
tinyurl.com/mwMonthly 32-Bit
tinyurl.com/mwMonthlyx64 64-Bit
Follow me on Twitter MapWindow_nl to read when a new installer is published.

---
Paul Meems
The Netherlands
[www.bontepaarden.nl]
Release manager, configuration manager and
forum moderator of MapWindow GIS

Owner of MapWindow.nl - Support for
Dutch speaking users: www.mapwindow.nl

*******
Everything I say or write is my personal opinion and
not the opinion of the company I work for.
*******
View my profile on LinkedIn

Options: ReplyQuote
Re: Internationalization, languages, and such
Posted by: fskrotzki ()
Date: June 21, 2010 12:26PM

Ok I'm missing something for testing a plugin with multiple languages...

I have it currently for English and Chines-Simplified. I understand the resources and naming for my plugin. It compiles, etc...

Running Windows 7 64 bit using 4.7.5 32 bit All set to English. Plugin works fine. If I go into the settings, select Chinese, enable user override, exit and restart MapWindow shows Chinese. but my Plugin is still showing only English.

What am I missing that tells my Plugin to use Chinese as the program has it selected over the default of English?

Ok Never mind. somehow when I created the Chinese resources it also selected Chinese as the neutral language and caused the problem.



Edited 1 time(s). Last edit at 06/21/2010 01:46PM by fskrotzki.

Options: ReplyQuote
Pages: Previous123
Current Page: 3 of 3


Sorry, only registered users may post in this forum.





Banner Exchange




GISCP.com




Send us your banner logo (160x120) for the space above, and add this MapWindow banner ad to your site:

Just paste this text in your page: