473,659 Members | 3,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.VBTric ks.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 1677
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 IExtenderProvid ers 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 InitializeCompo nent() code).

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

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

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

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

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"VBTricks.d e.vu Webmaster" <no****@thisser verdoesntexist. com> wrote in
message news:eZ******** ******@TK2MSFTN GP15.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.VBTric ks.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.Threadi ng.Thread.Curre ntThread.Curren tUICulture = New
System.Globaliz ation.CultureIn fo("th-TH")

Nov 21 '05 #4
Hello,

thanks for the help. I now use a function that is called this way
TranslateMenu(m nuFile, 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.VBTric ks.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.VBTric ks.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
2330
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, 'badcharshere') Regards, Bengt Richter
1
2025
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 could manually translate, but that's labor intensive. I know there are services were I can paste a URL and it will translate the page, but I don't want to send users away from the site, unless I could do so transparently. Does anyone else have...
0
2051
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. The organizational structure of the files is virtual and is managed by the database. We find it clunky that in order to manage these documents, the user must download the document, make changes, save the file locally and reupload via a web form...
6
2768
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
9383
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 493, in translate return s.translate(table, deletions) TypeError: translate() takes exactly one argument (2 given)
8
3056
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 be done by someone at the other end of the world, without access to Visual Studio. I suppose the first thing to do would be to make sure that all strings are loaded from resource files, but what about the language editor and language switching?
9
3096
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 Bruce Vaughan, BV Detailing & Design, Inc. ## All rights reserved. ## NOT FOR SALE. The software is provided "as is" without any warranty. ############################################################################ """ Class...
3
4697
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
10644
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 TRANSLATE(p.meno, 'aaaaccdeeeiillnnoooorrsstuuuuyzzAAAACCDEEEIILLNNOOOORRSSTUUUUYZZ', 'áâãäæèïéìëíîåµñòóôöõàø¶¹»úüûùý¼¾ÁÂÃÄÆÈÏÉÌËÍÎÅ¥ÑÒÓÔÖÕÀئ©«ÚÜÛÙݬ®') FROM oa.pracovnik p;
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8748
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8531
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8628
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4335
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2754
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.