Easier way to add entries into Resource file?

  • Thread starter Thread starter jw56578
  • Start date Start date
J

jw56578

Hi, so what can be done about this.
I am retrieving custom display messages from the culture specific
resource files through ResourceManager. But I have about 20 differnt
languages, so whenever i add a new display message, i have to add 20
new entries in 20 different resource files. Does anyone have a
recommendation of how to automate this process, or in general a
overall better way to accomplish this desired functionality.
Thanks
 
A little .net app could easily have this automated right - so where do you
find a problem?

- Rakesh
 
I would move my Resources to a Database if I were you.

Make two tables:
Table 1(My_Culture_Messages)
Table 2(My_Culture_Languges)

My_Culture_Messages:
MSG_ID - int - Length 4 - NOT NULL
LNG_ID - int - Length 4 - NOT NULL
MSG - nvarchar - Length 1024(or whatever length you think is max) - NOT NULL
- DEFAULT('')

My_Culture_Languges:
LNG_ID - int - Length 4 - NOT NULL - Seed 1
LNG_NAME - nvarchar - Length 255 - NOT NULL - DEFAULT('')

Example of the two tables :

My_Culture_Messages:
MSG_ID | LNG_ID | MSG
100 | 1 | Hello, how are you?
100 | 2 | Hejsan, hur 'a'r det med dig?
101 | 1 | Cancel
101 | 2 | Avbryt
102 | 1 | An error occured, please contact your Administrator

My_Culture_Languges:
LNG_ID | LNG_NAME
1 | English
2 | Swedish


You can easily make scripts that adds Empty strings for the other languges,
when adding a New string(i.e. New MSG_ID that doesnt exist). Or just do a
check if that string exist in the language you have specified. If it doesnt
exist(like MSG_ID 102 in the example above there is no Swedish version), just
return empty string or maybe you have set a default language that it will
take instead.

Currently working with multiple language myself and I found this solution
alot better than using Resource files.

Best Wishes,
Farek
 
Back
Top