I have a custom built MVC framework with controllers, models and views in the url all set and all working fine, now the site needs to support more languages and some of them are right to left (Arabic, Persian..) Now I will have to create different views in directories like mysite.com/en/ for English and so on everything broke down and I don't know where to start to get this working the system is built to take the controller and the arguments from the url by breaking it i can modify the site path global, but it seems that i have to repeat the code for every language, is this normal, efficient? is there a better way to manage my views? I need your help experts thanks
Asked
Active
Viewed 195 times
0
-
It seems to me tat the views themselves would have no reason to change. Only the templates which are used by the views. As for implementation of other aspects of multilingual site - this should help: http://stackoverflow.com/q/19249159/727208 – tereško Mar 23 '14 at 19:40
1 Answers
0
I am not an expert but i suggest you using .htaccess and passing language as argument to your pages. Visible url will be mysite.com/en/ but .htaccess can translate it to mysite.com?lang=en
You can also use subdomains as language parameter ex: en.mysite.com
In case of translating page elements you can define classes/json/XML for each language as use them according to lang parameter.
I don't think that copying code for each langauge is an efficient method voilating of OOP concepts :)

Madhurendra Sachan
- 760
- 8
- 23
-
thanks for the answer, any idea where to learn about doing this with htaccess, like a tutorial somewhere or a quick code to add without reading the whole documentation on Apache :) – OliviaJ Mar 22 '14 at 01:24
-
1http://stackoverflow.com/questions/18303858/htaccess-rewrite-subdomain-as-get-var-and-path-as-get-var http://htaccess-guide.com/ – Madhurendra Sachan Mar 24 '14 at 01:35