Translating using resource files

A

Andrus

I have resource files in different languages created by VCS 2005 Express.
I want to use those files to translate reports at runtime.

I have text to be translated as string.

I think I need to search resource file for this string id.
After that I need to return translated string from other resouce file ?

Is this best idea?
Where to find sample code which implements this ?
How to allow application users to add translations at runtime ?

Andrus.
 
J

JT

I have resource files in different languages created by VCS 2005 Express.
I want to use those files to translate reports at runtime.

I have text to be translated as string.

I think I need to search resource file for this string id.
After that I need to return translated string from other resouce file ?

Is this best idea?
Where to find sample code which implements this ?
How to allow application users to add translations at runtime ?

Andrus.

Andrus,

I am assuming that you are literally translating from one written
language to another. I am 90% sure that you will not be able to
update a resource file at runtime. My suggestion is that you need to
use the same key for each language file. For instance, in a French
resource file, the key would be 'dog' and the returned value would be
'chien'. The Spanish file would have 'dog' return 'perro'. You could
choose which language you would use for the keys and make that the
default language of the reports. If the default language was chosen,
you would not need to translate.

However, if you want to have the "resource" files be updated at
runtime, you might need to reconsider how this is done. If you don't
want the files stored locally on each user's machine, I would suggest
using a web service to update a database, or local XML files; meaning
local to the web server. However, I think that would mean rewriting
the whole XML file each time a change was made. If you don't mind
that the files are only stored on the user's machine, then you could
create a local database and update that as necessary.

For sample code, I would look in the
microsoft.public.dotnet.framework.webservices and
microsoft.public.dotnet.samples and some offshoot of
microsoft.public.sqlserver.

JT
 
A

Andrus

I am assuming that you are literally translating from one written
language to another.

I'm using Winforms reportviewer in local mode.
I have repor (rdlc) file written in one language.
User can select other language in which he want to see report.
I need to change report label texts to other language at runtime in this
case.
I am 90% sure that you will not be able to
update a resource file at runtime. My suggestion is that you need to
use the same key for each language file. For instance, in a French
resource file, the key would be 'dog' and the returned value would be
'chien'. The Spanish file would have 'dog' return 'perro'. You could
choose which language you would use for the keys and make that the
default language of the reports. If the default language was chosen,
you would not need to translate.

Major issue is that it is not possible to use keys to design reports.
Reports contain strings in certain language.

I want to use string string to find key (property name) in resource file.
How to search or enumerate strings in resource file ?
However, if you want to have the "resource" files be updated at
runtime, you might need to reconsider how this is done. If you don't
want the files stored locally on each user's machine, I would suggest
using a web service to update a database, or local XML files; meaning
local to the web server. However, I think that would mean rewriting
the whole XML file each time a change was made. If you don't mind
that the files are only stored on the user's machine, then you could
create a local database and update that as necessary.

I have resource as separate dll file, changed its member to public.
My application chacks at startuup for changed foreign languages resource
files and loads them dynamically if change is dedected.

My dictionary is large (8000 sentences)

Andrus.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top