There are a number of approaches to making your website multilingual, and as with all design decisions, your site requirements should dictate how you will go by the end of the analysis. In this article, we will not examine the pros and cons of individual approaches, rather we will look at our own multilingual structure that facilitates translators.
All text on the web, whether it's a word, a sentence, a paragraph, a link, or whatever is stored in a backend database and accessible by a key, ie an integer and a language identifier, such as EN. So you can have several records like: 1, EN, "Hello" and 1, TU, "Salam" You can also have fields that indicate which page can be found, which is useful later in the translation application.
Each page of website content exists once for multiple languages. It is not necessary to replicate the source code for each page. Using this approach, I created a php-based application and wherever the text appeared in HTML, it was replaced by a PHP function that looked like this: p ("Hello", 1) Function "prints the word" Hello "in any language at a given moment If English is active, the function simply returns the English text that was sent to it.If another language is used, the function searches for a text entry in the desired language and returns it.Active language can be stored in the GET or Session variable. that the text "Hello" remains in the right place in the source of the page and is easily readable and maintained.Other approaches sometimes leave you with secret text only and you need to manually search for text to read HTML
As you probably are not interested in watching an extensive database of text id manually eg Hello, 1, Good bye = 2, there are easy approaches to automation, for example when a programmer i write "Hello", just code p ("Hello"). Later starts the utility, finds the virgin "Hello", allocates it id and updates the code to look like "Hello", 1). The same tool can check existing text items to see whether the English text (or any of the languages listed) has been updated and to create a note in the database that alerts the translator that the translation must also be updated. In our database we record current English text and previous English text, so translators can see the history of text changes.
What about efficiency do you ask? To avoid database searches for every text view, we retrieve the whole language database for a particular language into the session grouping variable whenever a user changes languages. This is relatively fast and invisible to users. If you have a large website, you can always choose to pick only the selected parts of the site in the field. The term "very quick search for a field for the return of the relevant text, of course, the basic language does not require any search because the function is already passed
With all the text in the database it is easy to create a translator application in order to add a new language or updated text , which has been changed on the source pages.Translators do not need to know html to perform their work.One of the nice features is to be able to copy the translation for a particular text that is the same on several pages.Be careful when reusing translations because translation may vary depending on the page context
This is by no means an exhaustive description of what needs to be done to make your site fully multilingual There are many questions ranging from simple things such as the date and display of currency to for the finer problems managed such as the photos or colors you use? So now you can visualize at least one design frame option for your multilingual pages. Here is the place where this method was used: www.goodneighboraz.com Good luck globally!