Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Guys,

I have already created one Quiz Website but its only in Eng.

Now, Client requirement is to create/change to support mutiple languages.

AddQuestion page have some dropdowns, one textbox for Question and textboxes for Answers.

My question is:
When the question is entered in Eng and stored in DB as Eng,
how it will show/display in other languages.

What I have tried:

I have added Culture and resource files to support lang like Arabic. But this will change only the lables but not the textboxes/dropdowns values.

Can anyone please suggest me, how to solve this.


Thanks
Posted
Updated 22-Nov-16 2:43am
v2
Comments
Suvendu Shekhar Giri 22-Nov-16 1:13am    
It should work for the textbox and dropdownlist in the same way. Are you having any issue?
abdul subhan mohammed 22-Nov-16 1:23am    
I have entered/added the QuizQuestion in Eng, later I have open the same page in Arabic,
now, how it will display that eng QuizQuestion in arabic for edit and changes will effect in Eng as well.
Karthik_Mahalingam 23-Nov-16 3:24am    
Always use  Reply  button, to post Comments/query to the user, so that the user gets notified and responds to your text.

There is no magic yet the idea is simple. Each question and answer in the database should have a key that map to the corresponding one in another language in your resource file.
 
Share this answer
 
v2
Comments
abdul subhan mohammed 22-Nov-16 1:19am    
Can you please elaborate your answer?
I have not done this before, please provide in details or any link, which will help me.

Thanks
Peter Leow 22-Nov-16 1:22am    
The key will allow you to convert the question or answer from English to your language of choice in the resource file. This is an extension to http://www.codeproject.com/Articles/15313/Globalization-and-localization-demystified-in-ASP
abdul subhan mohammed 22-Nov-16 6:15am    
What are the fields, i have to add, to implement this approach.

I mean, in the gui, do i have to add separate textboxes for each culture?
Quote:
I have already created one Quiz Website but its only in Eng.
Now, Client requirement is to create/change to support multiple languages.
Guessing that you have done pages templates for the ENG site, you will have to create templates for each language and set a tag that remind you which language is in use.
Quote:
When the question is entered in Eng and stored in DB as Eng,
how it will show/display in other languages.
Short answer: it don't.
Practically, no general purpose automatic translator on internet can accurately translate things beyond the most basic sentences.
See for yourself with Google Translate[^]
As soon as the sentence get a little complicated, it get s wrong.
 
Share this answer
 
First of all currently no automatic conversion for text to any specific language.

So, any data which is going to be input you've to make change in each table where those inputted data is being saved.

What I mean suppose you were saving Question text in table namely 'tbl_questions'

tbl_questions {question_id (PK) int , question_text nvarchar(max)}


But now you have to change type of question_text to ntext to support multilingual text and also add an additional field for language and also primary key constraint composite of question_id and languaage_id
.

SQL
tbl_questions { question_id(PK)  int ,language_id (PK) int, question_text ntext}



Now on you have to save the text in selected language. Which means if you've support for four language then same question text has to save four times against those languages.

So u need to make changes in DB end. Mean while on front end no changes would be required. To render the correct text you have to fetch the data against current selected language.

That's how I achieve multilingual site with resource files and db with ntext field.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900