0

I am trying to make a website with both English and Hindi in option just like the website digit.in .

How can I make this happen?

The website is dynamic.please help me .Since i had already created english version of my website.Now I had to work on only Hindi version of it

Gal Dreiman
  • 3,969
  • 2
  • 21
  • 40
  • 1
    One way would be to use **[Google Cloud Translation API](https://cloud.google.com/translate/docs/)** but if you are looking for 100% accurate translation without having grammatical mistakes since Google Translator is not yet at that stage to do perfect translation like human beings so then you obviously need to do the translation manually..! – Umair Shah Feb 04 '17 at 20:26

2 Answers2

0

First step would be to duplicate your content in Hindi(flag it differently in the database(or file system, different directories for each language) ie lang='en' for english, lang='hi' for hindi).

Then, you have 2 options: Use JS to detect the users language settings, and display the correct content based on that:

JavaScript for detecting browser language preference

Or, you can just create a drop down option(or any other type of selector) somewhere on your site that allows them to select their preferred language, and again serve the correct content based on that option.

EDIT*

If you want to do it purely with PHP, you'd have to detect the language setting in the User-Agent string.

Detect Browser Language in PHP

Community
  • 1
  • 1
Kaylined
  • 655
  • 6
  • 15
  • Well can you provide me anykind of article or tutorial or something since i am very new to all of this i am not understanding all what you want to say – Anubhav Mishra Feb 05 '17 at 06:13
-1

Create a config with language files. In each file create a language folder e.g hindi,arabic,french. Then in your layout reference the files.