473,324 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Translate my application

Hello,

in VB6 I used to translate my application by setting the tag-property of
all controls, menu-entries... to a number which has been linked to a
string (array). Then I went through all controls or a form, checked the
tag-property and changed the caption-property to the lokalized string.
This was working for me fine.
Therefore I wanted to use the same implementation in VB.net.
Unfortunately I found out, that menuitems and some other controls do not
implement a tag-property. I surely could use inheritance to create a
menuentry with a tag-property, but I think the menueditor of my #develop
environment would accept them.
I also tried to use the localizable-property of the form and then to
translate the controls but this does not work with my #develop and the
resources created with winres.exe do not seem to work with it either.
What other ways to translate my apps?
Thanks in advance,

Stefan

--
___________________________________www.VBTricks.de .vu
the free resource for Visual Basic, Gambas and Pascal
components, tips & complete projects

www: http://www.VBTricks.de.vu
mail: vbtricks <at> gmx <dot> net
__________________________________________________ ___
Nov 21 '05 #1
6 1662
Hi,

I saw that there was a link including VBNet code how to add a tag property
to a menu Item on msdn.
http://support.microsoft.com/default...b;en-us;555264

Every control has a tag by the way, because in VBNet are controls always
inherited from control which has that.
http://msdn.microsoft.com/library/de...ssTagTopic.asp

I hope this helps,

Cor
Nov 21 '05 #2
Don't know anything about sharpdevelop so can't advise there on
localisation.

I would assume that IExtenderProviders work with its IDE though (otherwise
you couldn't use errorprovider or tooltip) so you may like to implement my
MenuExtender which adds a tag property to standard menuitems (saves manually
changing InitializeComponent() code).

You'll find the source on my site at:
http://dotnetrix.co.uk/menus.html

To set value at runtime:
\\\
MenuExtender1.SetTag(menuitem1,"SomeValue")
///

To get value at runtime:
\\\
Dim someObject As Object = MenuExtender1.GetTag(menuitem1)

If Not (someObject Is Nothing) Then
someValue = someObject.ToString()
End If
///

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"VBTricks.de.vu Webmaster" <no****@thisserverdoesntexist.com> wrote in
message news:eZ**************@TK2MSFTNGP15.phx.gbl...
Hello,

in VB6 I used to translate my application by setting the tag-property of
all controls, menu-entries... to a number which has been linked to a
string (array). Then I went through all controls or a form, checked the
tag-property and changed the caption-property to the lokalized string.
This was working for me fine.
Therefore I wanted to use the same implementation in VB.net. Unfortunately
I found out, that menuitems and some other controls do not implement a
tag-property. I surely could use inheritance to create a menuentry with a
tag-property, but I think the menueditor of my #develop environment would
accept them.
I also tried to use the localizable-property of the form and then to
translate the controls but this does not work with my #develop and the
resources created with winres.exe do not seem to work with it either.
What other ways to translate my apps?
Thanks in advance,

Stefan

--
___________________________________www.VBTricks.de .vu
the free resource for Visual Basic, Gambas and Pascal
components, tips & complete projects

www: http://www.VBTricks.de.vu
mail: vbtricks <at> gmx <dot> net
__________________________________________________ ___

Nov 21 '05 #3
I've never had any problems localizing forms -- the IDE does a nice
job.

here are the steps:
0) set the Localizable property of your form to True
1) ON PAPER: Design the form and translate the UI elements as needed
2) Add the controls to the form for the *default* culture
3) Save it
4) Set the Language property of the form to the appropriate culture
5) Add the localized content to the form
6) Repeat the last two steps as needed

***you will either need to change the culture on your machine before
each test OR you will need to explicitly set the culture before
instantiating the form
(System.Threading.Thread.CurrentThread.CurrentUICu lture = New
System.Globalization.CultureInfo("th-TH")

Nov 21 '05 #4
Hello,

thanks for the help. I now use a function that is called this way
TranslateMenu(mnuFile, 1).
So I have to call it for every menuitem, but it works. I definitely
prefer textfiles that can be easily translated (although I need someone
who speaks French, Spanish... anyway, no matter which solution I take ;-) )
As Mick said, all "controls" implement Tag. What I meant were MenuItems,
ColumnHeaders, which are no controls...
Thanks again,

Stefan
--
___________________________________www.VBTricks.de .vu
the free resource for Visual Basic, Gambas and Pascal
components, tips & complete projects

www: http://www.VBTricks.de.vu
mail: vbtricks <at> gmx <dot> net
__________________________________________________ ___
Nov 21 '05 #5
> As Mick said, all "controls" implement Tag. What I meant were MenuItems,
ColumnHeaders, which are no controls...


Actually, that was Cor :)

Glad you got a working solution.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
Nov 21 '05 #6
Oops,

sorry. Hope you help me in the future anyway...
Stefan

--
___________________________________www.VBTricks.de .vu
the free resource for Visual Basic, Gambas and Pascal
components, tips & complete projects

www: http://www.VBTricks.de.vu
mail: vbtricks <at> gmx <dot> net
__________________________________________________ ___
Nov 21 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Bengt Richter | last post by:
Just thought None as the first argument would be both handy and mnemonic, signifying no translation, but allowing easy expression of deleting characters, e.g., s = s.translate(None,...
1
by: shank | last post by:
I'm sure this is a stretch, but is there some kind of component that I could install to translate from English to Spanish on the fly? I have a lot of equipment features and specifications that I...
0
by: SimpleSimple | last post by:
My company has an IIS 5, ASP.net intranet site that contains documents for employee use. The files are of various types (most often Office) and are stored in blob fields in a SQL2000 database. ...
6
by: bobueland | last post by:
The module string has a function called translate. I tried to find the source code for that function. In: C:\Python24\Lib there is one file called string.py I open it and it says
1
by: peterbe | last post by:
This has always worked fine for me. Peter fine Now if I do it with a unicode string: Traceback (most recent call last): File "<stdin>", line 1, in ? File "/usr/lib/python2.4/string.py", line...
8
by: Joergen Bech | last post by:
Suppose I have written a .Net application and - until now - have hardcoded all my text strings. Now, the application needs to be translated into another language. Furthermore, the translation must...
9
bvdet
by: bvdet | last post by:
I have done some more work on a simple class I wrote to calculate a global coordinate in 3D given a local coordinate: ## Basis3D.py Version 1.02 (module macrolib.Basis3D) ## Copyright (c) 2006...
3
by: Kenneth McDonald | last post by:
I have the need to occasionally translate a single word programatically. Would anyone have a Python script that would let me do this using Google (or another) translation service? Thanks, Ken
4
by: kovariadam | last post by:
Hi, Does anybody know why i get this error: SQL0176N The second, third or fourth argument of the TRANSLATE scalar function is incorrect. SQLSTATE=42815 with this query: SELECT...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.