2
votes

I have

a laravel site, and everything is in English.


I need

to change the entire site to Chinese friendly.


I try

On top of my master view, I update <html lang="en"> to <html lang="zh"> Site, seemed to be the same.


I know

that we can leverage Laravel Localization and load the proper texts base on the region of the visitor. But if I chose to do it that way, meaning that I will have to create those files manually - I want to save this to my last resort, when I couldn't change the language automatically.


What should I start look into ?

How would one implement this kind of feature in there existing app ?

I'm opening to any suggestion on this.

2

2 Answers

3
votes

You should use localization feature. If want to have Chinese version only, you should create new lang files and change locale without changing routes.

https://laravel.com/docs/5.2/localization

Also, you can save some time and download translated validation, auth lang files etc.

1
votes

I would suggest an alternative, don't use the Laravel localization package, instead use this one: https://github.com/oscarotero/Gettext -- the files it uses (.po files) are more industry standard. There are dedicated .po file editors that translators and translation companies commonly use to provide the translation data.