473,396 Members | 1,886 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,396 software developers and data experts.

How do you translate your WinForms app? (outsourcing localization)


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?

I heard about winres.exe, but my application makes use of many
custom usercontrols and winres.exe often chokes on the forms I
try to feed it. Also, I am not sure about relying on reflection to
change all my captions, etc. To be able to switch language without
restarting the application, I believe I would still need to write some
custom code to be executed on all open forms (to update dynamic
information) even if I use winres.exe(?)

Questions:

1) Do you use winres.exe and try to make your application play nice
with this utility?

2) What about dynamic elements not editable by winres.exe? Do you
implement a standard method in all your forms and cycle through
all open forms, calling this method whenever a culture change is
requested? Or is there something built into the framework I can
use? I would prefer *not* having my forms torn down and rebuilt
(even behind the scenes) for the translation to take place.

3) Are there any good alternatives (commercial or free) to winres.exe
or do I have to roll my own?

4) Any links to information/best practices on this subject?

/Joergen Bech

Nov 29 '06 #1
8 3036
I would also love to hear about this. It seems to be one of those areas
where you have to choose between craptastic free tools and repetitive strain
injury or craptasticly expensive professional tools that never do exactly
what you want them to (i.e. WinTrans 8.0). Having said that, your biggest
bill is going to be from the translator ;).

Robin


Nov 29 '06 #2
Hi,

Joergen Bech wrote:
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?
checkout this thread in microsoft.public.dotnet.framework.aspnet:
news:#O**************@TK2MSFTNGP05.phx.gbl

Basically, what I do is using a database that holds all textual contents.

If you'd like to stick with the resources-approach, here's two links that
I've come across, the first being geared at SQLS and the second at Access:
http://www.codeproject.com/aspnet/cu...erprovider.asp
http://www.leftslipper.com/ShowFaq.aspx?FaqId=9
Haven't tried this out yet though.

Concerning the translations, I tend to distribute Access-DBs with WinForms,
along with an application that can be used to translate items. That
application will then be sent to translators and they then send back the
MDB which may then replace the local database(s).
In ASP.Net I have pages that map the same functionality and may used by
translators directly over the web (provided we're talking internet as
opposed to intranet).
2) What about dynamic elements not editable by winres.exe? Do you
implement a standard method in all your forms and cycle through
all open forms, calling this method whenever a culture change is
requested? Or is there something built into the framework I can
use? I would prefer *not* having my forms torn down and rebuilt
(even behind the scenes) for the translation to take place.
Not sure what you're talking about here. If this is about i.e.
product-names which are actually defined by the users themselves: In my
current project, this is handled by extending the identifier (or key) with
a suffix - the record's ID. That is, when a product is being added to the
database, a new record for every language will be added to the text-table
along with the internal title (which needs to be set before adding). It's
up to the user to then supply the texts required to display the item in the
languages that exist.

Cheers & tschüssele,
Olaf
--
My .02: www.Resources.IntuiDev.com
Nov 29 '06 #3
Hi,

Robinson wrote:
I would also love to hear about this. It seems to be one of those areas
where you have to choose between craptastic free tools and repetitive strain
injury or craptasticly expensive professional tools that never do exactly
what you want them to (i.e. WinTrans 8.0).
I don't think so. The setup is actually pretty simple. Basically:

- tblLanguages
Contains one entry per Language (title, native name, SortOrder, Culture,
Active, MayBeDeleted)
- tbl_Language_Info
Contains information about the background of items (one rec for every
text-key)
- tbl_Language_Text
Contains one record per language per text to be displayed, plus a FK to
link to the language. Arguments will be included so that they may be
replaced via string.format()

From .Net, I have a class that consumes the database and returns texts that
are identified by the language's ID and the appropriate text-key.
I haven't tried this with either right-2-left languages or i.e. chinese,
but other than that this works pretty well.
Having said that, your biggest bill is going to be from the translator
;).
Probably ... :-)

Cheers,
Olaf
--
My .02: www.Resources.IntuiDev.com
Nov 29 '06 #4
On Wed, 29 Nov 2006 15:06:39 +0100, Olaf Rabbachin
<Ol*********@IntuiDev.comwrote:
>Hi,

Joergen Bech wrote:
>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?

checkout this thread in microsoft.public.dotnet.framework.aspnet:
news:#O**************@TK2MSFTNGP05.phx.gbl

Basically, what I do is using a database that holds all textual contents.

If you'd like to stick with the resources-approach, here's two links that
I've come across, the first being geared at SQLS and the second at Access:
http://www.codeproject.com/aspnet/cu...erprovider.asp
http://www.leftslipper.com/ShowFaq.aspx?FaqId=9
Haven't tried this out yet though.

Concerning the translations, I tend to distribute Access-DBs with WinForms,
along with an application that can be used to translate items. That
application will then be sent to translators and they then send back the
MDB which may then replace the local database(s).
In ASP.Net I have pages that map the same functionality and may used by
translators directly over the web (provided we're talking internet as
opposed to intranet).
Yes, this is what I used to do back in the old VB6 days. I could
convert my old tools and ways of doing it to .Net, but before I go
that route, I wanted to know if there was a standard approach
specific to .Net (or a de facto tool).
>2) What about dynamic elements not editable by winres.exe? Do you
implement a standard method in all your forms and cycle through
all open forms, calling this method whenever a culture change is
requested? Or is there something built into the framework I can
use? I would prefer *not* having my forms torn down and rebuilt
(even behind the scenes) for the translation to take place.

Not sure what you're talking about here. If this is about i.e.
product-names which are actually defined by the users themselves: In my
current project, this is handled by extending the identifier (or key) with
a suffix - the record's ID. That is, when a product is being added to the
database, a new record for every language will be added to the text-table
along with the internal title (which needs to be set before adding). It's
up to the user to then supply the texts required to display the item in the
languages that exist.
By "dynamic" elements I mean text strings that are composed by the
program during runtime, i.e. a progress dialog might display
"Now processing record 1 of 457". This string would be stored as
"Now processing record %1 of %2" in the language database and
the %1 and %2 placeholders would be replaced at runtime after the
string had been translated.

Could be any number of other things that cannot be translated at
designtime.

/Joergen Bech

Nov 29 '06 #5

"Joergen Bech @ post1.tele.dk>" <jbech<NOSPAMNOSPAMwrote in message
news:ht********************************@4ax.com...
On Wed, 29 Nov 2006 15:06:39 +0100, Olaf Rabbachin
<Ol*********@IntuiDev.comwrote:
>>Hi,

Joergen Bech wrote:
>>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?

checkout this thread in microsoft.public.dotnet.framework.aspnet:
news:#O**************@TK2MSFTNGP05.phx.gbl

Basically, what I do is using a database that holds all textual contents.

If you'd like to stick with the resources-approach, here's two links that
I've come across, the first being geared at SQLS and the second at Access:
http://www.codeproject.com/aspnet/cu...erprovider.asp
http://www.leftslipper.com/ShowFaq.aspx?FaqId=9
Haven't tried this out yet though.

Concerning the translations, I tend to distribute Access-DBs with
WinForms,
along with an application that can be used to translate items. That
application will then be sent to translators and they then send back the
MDB which may then replace the local database(s).
In ASP.Net I have pages that map the same functionality and may used by
translators directly over the web (provided we're talking internet as
opposed to intranet).

Yes, this is what I used to do back in the old VB6 days. I could
convert my old tools and ways of doing it to .Net, but before I go
that route, I wanted to know if there was a standard approach
specific to .Net (or a de facto tool).
>>2) What about dynamic elements not editable by winres.exe? Do you
implement a standard method in all your forms and cycle through
all open forms, calling this method whenever a culture change is
requested? Or is there something built into the framework I can
use? I would prefer *not* having my forms torn down and rebuilt
(even behind the scenes) for the translation to take place.

Not sure what you're talking about here. If this is about i.e.
product-names which are actually defined by the users themselves: In my
current project, this is handled by extending the identifier (or key) with
a suffix - the record's ID. That is, when a product is being added to the
database, a new record for every language will be added to the text-table
along with the internal title (which needs to be set before adding). It's
up to the user to then supply the texts required to display the item in
the
languages that exist.

By "dynamic" elements I mean text strings that are composed by the
program during runtime, i.e. a progress dialog might display
"Now processing record 1 of 457". This string would be stored as
"Now processing record %1 of %2" in the language database and
the %1 and %2 placeholders would be replaced at runtime after the
string had been translated.

Could be any number of other things that cannot be translated at
designtime.

/Joergen Bech
But you *can* process those strings at designtime.
Store them as something like

"Now Processing Record {0} of {2}."

Then use String.Format to output them in your program:

message = String.Format(stringFromDb, 1, 457)

Robin S.
Nov 29 '06 #6
On Wed, 29 Nov 2006 08:28:36 -0800, "RobinS" <Ro****@NoSpam.yah.none>
wrote:
>By "dynamic" elements I mean text strings that are composed by the
program during runtime, i.e. a progress dialog might display
"Now processing record 1 of 457". This string would be stored as
"Now processing record %1 of %2" in the language database and
the %1 and %2 placeholders would be replaced at runtime after the
string had been translated.

Could be any number of other things that cannot be translated at
designtime.

/Joergen Bech

But you *can* process those strings at designtime.
Store them as something like

"Now Processing Record {0} of {2}."

Then use String.Format to output them in your program:

message = String.Format(stringFromDb, 1, 457)

Robin S.
Yes, I know, and that is what I was describing. The thing is:
Are such strings visible/editable in winres.exe and is there something
in the framework that (via reflection?) causes certain functions to
be called automatically when a new culture is applied to a form?

Remember: I would like to be able to translate forms and controls
(including "dynamic" elements) without restarting the application
and without even tearing down and rebuilding the forms. So some
mechanism needs to be in place to fetch those strings, process them,
and display them to the user. Question is, do I write the whole thing
myself or do I get parts of it for "free"?

/Joergen Bech

Nov 29 '06 #7

"Joergen Bech @ post1.tele.dk>" <jbech<NOSPAMNOSPAMwrote in message
news:hi********************************@4ax.com...
On Wed, 29 Nov 2006 08:28:36 -0800, "RobinS" <Ro****@NoSpam.yah.none>
wrote:
>>By "dynamic" elements I mean text strings that are composed by the
program during runtime, i.e. a progress dialog might display
"Now processing record 1 of 457". This string would be stored as
"Now processing record %1 of %2" in the language database and
the %1 and %2 placeholders would be replaced at runtime after the
string had been translated.

Could be any number of other things that cannot be translated at
designtime.

/Joergen Bech

But you *can* process those strings at designtime.
Store them as something like

"Now Processing Record {0} of {2}."

Then use String.Format to output them in your program:

message = String.Format(stringFromDb, 1, 457)

Robin S.

Yes, I know, and that is what I was describing. The thing is:
Are such strings visible/editable in winres.exe and is there something
in the framework that (via reflection?) causes certain functions to
be called automatically when a new culture is applied to a form?

Remember: I would like to be able to translate forms and controls
(including "dynamic" elements) without restarting the application
and without even tearing down and rebuilding the forms. So some
mechanism needs to be in place to fetch those strings, process them,
and display them to the user. Question is, do I write the whole thing
myself or do I get parts of it for "free"?

/Joergen Bech
I haven't done this, but am generally suspicious of anything free.
Personally, I like to have control. So I would follow the other
suggestions and put the strings in a database table and get them
from there depending on the location in which I am running.

Robin S.
Nov 29 '06 #8
Hi,

Joergen Bech wrote:
>>Not sure what you're talking about here. If this is about i.e.
product-names which are actually defined by the users themselves: In my
current project, this is handled by extending the identifier (or key) with
a suffix - the record's ID. That is, when a product is being added to the
database, a new record for every language will be added to the text-table
along with the internal title (which needs to be set before adding). It's
up to the user to then supply the texts required to display the item in the
languages that exist.

By "dynamic" elements I mean text strings that are composed by the
program during runtime, i.e. a progress dialog might display
"Now processing record 1 of 457". This string would be stored as
"Now processing record %1 of %2" in the language database and
the %1 and %2 placeholders would be replaced at runtime after the
string had been translated.

Could be any number of other things that cannot be translated at
designtime.
since I never went the resources- resp. "built-in" path I actually don't
know. :-)

Cheers,
Olaf
--
My .02: www.Resources.IntuiDev.com
Nov 30 '06 #9

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

Similar topics

5
by: Marcos | last post by:
I need to translate the messages of mine scripts, as I can make professionally this working with the pair php and javascript? Thank`s -- Marcos. http://www.linuxhard.org
2
by: aaa | last post by:
Can I translate to a different language on replication and if so how?
0
by: martinig | last post by:
Outsourcing is often closely related to offshoring in software development, but you can outsource onshore and you can create offshore subsidiaries. This seems to be the current trend for large...
1
by: Data Entry Outsourcing | last post by:
Data Entry plays vital role in every business area. Data Entry is one such aspects of any business that needs to be handled properly for expanding your business. Data Entry is one of the leading...
23
by: raylopez99 | last post by:
Here I am learning WinForms and two months into it I learn there's a WPF API that is coming out. Is this WPF out yet, and is it a threat to WinForms, in the sense that all the library routines I...
1
by: raylopez99 | last post by:
Took a look at a demo of font dialog for WPF, and it looks complicated. You could do the same thing in C# 3 WinForms 2.0 in about one-half to one-fourth the code. So I wonder, for you that have...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.