From 0b9b3cb7bc0235724c8be244043ca64cb1d50f6f Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Wed, 2 Mar 2016 20:38:51 +0900 Subject: [PATCH] fix garbled characters when cjk lang is selected. --- app/Providers/AppServiceProvider.php | 7 ++++++- config/former.php | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 2d6689b554..279549d4cb 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -19,8 +19,13 @@ class AppServiceProvider extends ServiceProvider { public function boot() { HTML::macro('nav_link', function($url, $text, $url2 = '', $extra = '') { + $capitalize = config('former.capitalize_translations'); $class = ( Request::is($url) || Request::is($url.'/*') || Request::is($url2.'/*') ) ? ' class="active"' : ''; - $title = ucwords(trans("texts.$text")) . Utils::getProLabel($text); + if($capitalize){ + $title = ucwords(trans("texts.$text")) . Utils::getProLabel($text); + } else { + $title = trans("texts.$text") . Utils::getProLabel($text); + } return ''.$title.''; }); diff --git a/config/former.php b/config/former.php index 7279aaf78a..b9c729e2f9 100644 --- a/config/former.php +++ b/config/former.php @@ -49,7 +49,7 @@ // Whether text that comes out of the translated // should be capitalized (ex: email => Email) automatically - 'capitalize_translations' => true, + 'capitalize_translations' => false, // An array of attributes to automatically translate 'translatable' => array(