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).
Internationalization, languages, and such
Posted by: pmeems ()
Date: October 03, 2005 06:38AM

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).
Later with VB6 and VBA (meanly with MS Access).
Here at The Soilcompany I write mostly in VB6 and I'm trying to leard C#.

Before MapWindow became Open Source, we've bought a licence to use mapwingix.ocx to build a small application for our customers to view our mappings.
We create high-precision soilmaps for precision farming using Surfer (Golden Software).
Because Surfer cannot correctly convert their mappings (gridfiles) to shapefiles we've contacted Dan and ask him to build a tool for us to do this.
Together with Dan I've created a application which inputs a gridfile, a levelfile and a boundaryfile and outputs a correct shapefile.
This routine (grid2shape) is in VB6 and Dan will rebuild it to C# and place in the Open Source.
I will try to assist him with that.

Furthermore I will help Forest (Chen Lailin) to translate MapWindow into other languages like Dutch, German and French.

What we need is a robust application which will display our shapefiles and is easy to use and in Dutch. Our main costumers are farmers with little or no pc skills.

We use MapWindow ourselves to view our high-precision soilmaps with the allready available low-precision soilmaps. This process is currently very time consuming because I have a projectfile with all low-precision soilmaps in it with labels and it takes a long time before the project is loaded.
So I'll try to build in 'loading on demand' in MapWindow. Shapefiles which are not checked in the projectfile will not be loaded into MapWindow until it's checked. I think this will increase performance quite a lot.

I've got some other ideas I want to build in MapWindow but I will get to that when I've got the time to work on them.
A little peak:
* Identify on all visible layers with one click
* Extended print options, with drag'n'drop and free text, images, etc.

That's all for know.

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



Edited 2 time(s). Last edit at 10/03/2005 07:08PM by Dan Ames.

Re: Introduction
Posted by: Thomas ()
Date: October 03, 2005 08:55AM

Paul,

I am working too on translation of MapWindows, may be we can do something together.
We need the application in Portuguese and spanish language.
The translated strings are stored in a .resx file (xml format) and readed when opening MapWindow
If you are interested please let me know and I can send you the sample code.

Thomas

Re: Introduction
Posted by: pmeems ()
Date: October 03, 2005 09:17AM

Yes, Thomas.

I'm very interested. I allready thought mapWindow would use .resx files. But how about the error messages are they translated as well?

You can send the sample code to meems(at)soilcompany.nl

--
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

Re: Introduction
Posted by: ForestChen ()
Date: October 03, 2005 05:03PM


Hi Paul,

This is Forest Chen, I am currently working on the internationalization of MapWindow. The following URL is the draft document I have created for the internationalization process. Please feel free to leave me your comments on the docuemnt. You can modify the document directly and e-mail it to me and I will put it on the website.

Thank you very much for your excellent posts. It is great to have you in our team.


To Thomas,

Thank you very much for your interest, I will be very glad to hear your comments on the approach explained in the docuemnt. If you have any new ideas in dealing with the resource files, Please feel free to add them to the document and mail it to me. And it would be a great help if you can help us to deal with
Portuguese and Spanish language.


Sincerely yours,

Forest.



URL for the doc:
[www.mapwindow.com]

Re: Introduction
Posted by: danames ()
Date: October 03, 2005 06:59PM

To all... This is a very exciting topic for me. I have been anxious to get multiple language support in MapWindow for a few years now, and it looks like we finally have the right combination of ideas and people to make it work. Please take a look at the document from Forest that outlines the approach we'd like to follow for this. If anyone would like to suggest improvements to the approach, please just edit the document directly, using "track changes" and then send it to Forest and we'll re-post it on the website. Also, to any one who is casually monitoring this disucssion, if you are able to provide a translation, please let Forest or I know so that we can add you to the list.

Thanks!

Dan

P.S. I am moving part of this thread to it's own thread so that it will be easier for people interested in internationalization to find.

Re: Internationalization, languages, and such
Posted by: Azlan David ()
Date: October 04, 2005 08:18AM

Hi All,

Bahasa Malaysia/Indonesia, Chinese and Tagalog.

Cheers

Azlan

Re: Internationalization, languages, and such
Posted by: pmeems ()
Date: October 05, 2005 03:34AM

As I understand many people are translating MapWindow into several languages.
That's cool!
But when I go to the code I see that all forms still have the property 'localizable' set to false.
Is there a reason for this?
Should we wait with translating or are we all waiting for the first person to start?
If we can start I'll commit my changes.
I'm not finished yet, though ;)


--
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

Re: Internationalization, languages, and such
Posted by: Thomas ()
Date: October 05, 2005 10:55AM

I think Paul is right, one of us have to start and create the english resx file for the MapWindow application. We need to organize how to handle new menu items, message stings ect. added during the development of Map Window.

Thomas Erbacher
Ambiente Informática Ltda
Estrada Riberão Piave, 300
Doutor Pedrinho / SC
Brasil

Re: Internationalization, languages, and such
Posted by: danames ()
Date: October 05, 2005 04:06PM

I've actually asked Lailin (Forest) Chen here in the GISci Lab at ISU to start create the English and Simplified Chinese resource files as a template for the rest of the work. However he is also working on a couple of other core issues and it may be a few days before it gets started. So if someone else has started that effort, then let us know here. Maybe Forest and someone else can collaborate to get it going. - Dan

Internationalization Resources.GetString
Posted by: Thomas ()
Date: October 08, 2005 09:44AM

Forest,

Thanks for the manual, I tried step by step all works fine when I change to Portugues (Brazil) 2 resx files are created.
frmMain.pt-BR.resx and frmMain.pt.resx
I edited the frmMain.pt-BR.resx file adding

<data name="mnuWelcomeScreen">
<value>Tela Bemvindo</value>
</data>

Changed in the Sub SetUpMenus()
the line
m_Menu.AddMenu("mnuWelcomeScreen", "mnuHelp", Nil, "&Welcome Screen")
to
m_Menu.AddMenu("mnuWelcomeScreen", "mnuHelp", Nil, Resources.GetString("mnuWelcomeScreen.Text"))

Receive an error message:
'GetString' is not menber of 'Resources'

Anything wrong with the definition?:
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(MapWindowForm))

Any idea?

Re: Internationalization Resources.GetString
Posted by: Thomas ()
Date: October 08, 2005 01:25PM

Forest,
We need to add this to the frmMain

Imports System
Imports System.Globalization
Imports System.Threading
Imports System.Resources
Imports System.Reflection


Dim rm As New ResourceManager("items", [Assembly].GetExecutingAssembly())

m_Menu.AddMenu("mnuWelcomeScreen", "mnuHelp", Nil, rm.GetString("mnuWelcomeScreen.Text"))


Re: Internationalization Resources.GetString
Posted by: danames ()
Date: October 08, 2005 07:16PM

Thomas,

This is Dan and Forest... If you do step 2.1 in the internationalization manual that Forest wrote, then you will see that the needed code to create the "resources" object will be created automatically for you. This occurs directly after you set "Localizable = True". Now, if we were up to speed, we would have already done this for all of the forms, but you are ahead of us - which is great - so bottom line: you don't need to explicitly add the "imports..." and "dim rim" etc. code, Just set the localazable property. Then when the menu add should be

m_Menu.AddMenu("mnuWelcomeScreen", "mnuHelp", Nil, resources.GetString("mnuWelcomeScreen.Text"))

It looks like the trick is doing the static controls first in your language, then you should be able to edit the .RESX file directly to add the text for your language for those dynamic controls like menu stuff.

Please try this and let us know what happens. At the same time, Forest will be working on it from our end.

Dan and Forest

Re: Internationalization Resources.GetString
Posted by: Thomas ()
Date: October 09, 2005 10:23AM

Dan, Forest,

I started again from a new SVN downlaod.
Registred the new ocx from the bin folder, no error compiling Map Window :-) solved

Passed all steps from the manual of Forest, Localizable = True
Language Portugues(Brazil)
Fine, a frmMain.pt-PT.resx file and a frmMain.pt.resx are created automaticly.
Then I started to edit the mnuLegend
My translations are added to the frmMain.pt-PT.resx file.

<data name="MenuItem2.Text">
<value>Adicione Grupo</value>
</data>
<data name="MenuItem3.Text">
<value>Adicione Camada</value>
</data>
<data name="MenuItem4.Text">
<value>Remover Camada</value>
</data>
<data name="MenuItem5.Text">
<value>Limpar Camadas</value>
</data>
<data name="MenuItem6.Text">
<value>Zoom para Camada</value>
</data>
<data name="MenuItem8.Text">
<value>Mostrar Metadata</value>
</data>
<data name="MenuItem11.Text">
<value>Expandir Grupos</value>
</data>
<data name="MenuItem12.Text">
<value>Expandir Tudo</value>
</data>
<data name="MenuItem13.Text">
<value>Fechar Grupos</value>
</data>
<data name="MenuItem14.Text">
<value>Fechar Todos</value>
</data>
<data name="MenuItem16.Text">
<value>Propriedades</value>
</data>

Very nice, but when I run the code the menu shows up in english.
My Locale at the Control Panel-> Regional Options is Portugues (Brazil)
At the bin\pt-BR folder a MapWindow.resources.dll file is created.
Anything more to change?

Changing the the dynamically created controls, no way, :-( there is no code created automaticly to accept the resources.GetString
I get this error message:
C:\Dev\MapWindow\Forms\frmMain.vb(1645): 'GetString' is not a member of 'Resources'.

An other question, how we can handle to localize this kind of code?
Dim menuText As String
menuText = MenuItem4.Text
If menuText = "Remove Layer" Then
DoRemoveLayer()
Else
DoRemoveGroup()
End If


Thanks for you help,

Thomas

CurrentCulture
Posted by: Thomas ()
Date: October 09, 2005 12:36PM

Dan, Forest,

One more step is solved.
I am using an english version of Win2000 for developing and I set my Locale at the Regional Options of the Control Panel to Portugues (Brazil).

But to debug MapWindows seeing the translation we need to add this line at the Sub Main()

Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture

If not VB.Net use the culture information from the OS and not from the Regional Options of the Control Panel.

In this way we can test more than one translation on the same peveloping PC changing the Locale at the Control Panel.

Thomas

Re: CurrentCulture
Posted by: danames ()
Date: October 09, 2005 08:54PM

I am glad to see this because I was wondering how to make it reflect the change made to the control panel. will you please commit the change to frmMain and add your new language files to the repository so we can grab them and try them here? - Dan

Re: Internationalization Resources.GetString
Posted by: danames ()
Date: October 10, 2005 11:53AM

Thomas,

On the question of how to handle this code:

Dim menuText As String
menuText = MenuItem4.Text
If menuText = "Remove Layer" Then
DoRemoveLayer()
Else
DoRemoveGroup()
End If


About two weeks ago someone here noted that the Menu.Name property wasn't returning the name correctly. The idea of that property was to have it return the actual internal name like "mnuPrintMenu" so that rather than checking for the Text when making a comparison, you would instead check for the Name. This way the name will always be the same, regardless of the current language and the current text.

Chris Michaelis fixed the Name property a week or so ago, but there is likely still code lingering around that is referring to the "Text" property instead of the "Name" property. We'll have to keep our eyes open for these and change them to use the Name property when we find them. This way, the internationalization will still work with no problem.

Dan

Re: Internationalization, languages, and such
Posted by: ForestChen ()
Date: October 10, 2005 03:13PM

According the code you have provided here, I cann't figure out what is going wrong, GetString() is a member of ResourceManager, which you can confirm at the following URL:

[msdn.microsoft.com]

I don't know why your compiler is complaining that 'GetString' is not a menber of 'Resources', while here Resources is a instance of ResourceManager.

By the way, I have changed all the forms in the MapWindow project to use resource files, all the string for the static controls are now using Resources.GetString() function. And it works fine. Please reference the latest version of source file, and hope this will help you somehow.

Thanks for your information.
Forest.

Re: Internationalization, languages, and such
Posted by: Thomas ()
Date: October 10, 2005 04:50PM

Forest,

This is added automaticly changing a form to Localizable = True
at Private Sub InitializeComponent()

Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(MapWindowForm))

But to use it at an other Sub like Public Sub SetUpMenus()
We need to add the definition again. ;-)

Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(MapWindowForm))

Now it works.

Thank you

Thomas

Re: Internationalization, languages, and such
Posted by: ForestChen ()
Date: October 11, 2005 08:11AM

--Cheers, I am glad to see it is working now.
Thank you very much for your work, Thomas. And good luck with the rest part.

Best regards,
Forest.

Re: Internationalization, languages, and such
Posted by: cmichaelis ()
Date: October 11, 2005 09:16AM

Forest et al,

Is there anything that the innocent bystanders need to know about this? I got the most recent code and hit 'build', and now all of my menus are showing the "name" rather than the "text", e.g. mnuFile, mnuEdit, etc.

Is there something that I need to do before building now?

--Chris

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: