Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert and store configurable items in a multi-language web application?

Tags:

I have a multi-language web application. I am converting all the controls i.e. labels, drop down, text, and messages using resource file.

Problem:

For example, registration page has drop down of Prefix- Mr, Mrs,Miss etc. This prefix data comes from a table and is configurable i.e We are having a configuration web page for the same.

There are many other configurable things and corresponding pages.

My question is how to convert this data into other language and how to save the same as it cannot be done with resource file.

Anyone having practical ideas can guide me.

like image 342
Veer Avatar asked Jul 03 '15 11:07

Veer


People also ask

How do I translate a website into multiple languages?

Just go to https://translator.smartcat.com/, type in your URL, select the languages and see your main page translated. It's simple: Automatically translate individual pages or your entire website into multiple languages.

How do I serve a page with contents in multiple languages?

To change the language, just simply set the lang attribute. We can define it anywhere in the document, such as in the body, in the paragraph, in the heading, or in the span tag. But the best practice is to set the lang in the span tag.


1 Answers

If it's user configurable, then it's not practical to use resource files, for users can configure whatever they need.

So, if I understood correctly, I think the only practical solution is having translations in a table for each value users enter.

Since users can enter values in any language it can get tricky.

I would choose a default required language, say english, so whenever users manage the values (Title or prefix in your sample), they have to manage them in pairs, i.e. their language and english.

So, if the locale is french, when they check the index of titles, they see two columns, one for french and one for english.

If it's the first time the french user enters the view, then there are no french values, so the user has to add the french translation for the english values al ready registered.

If the user adds a new [french] value, then she/he has to enter the english translation too.

It looks a litle cumbersome and may be not very practical, but it's an option!

Best,

PD: Hey, please share the solution when you get to it!

like image 170
Miguel Veloso Avatar answered Nov 01 '22 09:11

Miguel Veloso