Laravel应用语言改变了吗? [英] Laravel application language change?
问题描述
我最近在Laravel为德国客户开发和应用.现在,客户希望知道该应用程序是否可以用德语而不是英语查看.当然,我使用英语用Blade设计了前端的所有视图.现在有一种方法可以将视图翻译成所需的语言吗?是否有包装或其他方法可以完成此任务?
I have recently developed and application in Laravel for a German client. Now the client wishes to know if the application can viewed in German instead of English. I have designed all the views of the front end using Blade in English of course. Now is there a way in which the views translate to the desired language? Is there a package or another way to accomplish this?
推荐答案
Laravel提供了在 http:中烘焙的本地化功能: //laravel.com/docs/4.2/localization ,尽管您将需要重新执行视图以使用lang字符串并向控制器添加语言检测.
Laravel provides localisation functionality baked in http://laravel.com/docs/4.2/localization though you are going to need to re-do your views to use the lang strings and add language detection to your controllers.
我会避免即时"翻译,因为它们很少可靠.
I would avoid "on-the-fly" translations as they are rarely reliable.
这篇关于Laravel应用语言改变了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!