From ceb9cfda298c08bc799dab5070eb46f40ce56617 Mon Sep 17 00:00:00 2001 From: K Miyano Date: Mon, 20 Jan 2020 17:13:02 +0900 Subject: [PATCH] Update language logic & styles --- app/Http/Controllers/IdolController.php | 1 + public/css/idol.css | 1 + public/css/style.css | 11 +++++++++-- resources/views/idol/index.blade.php | 5 ++--- resources/views/idol/show.blade.php | 16 ++++++++-------- resources/views/layouts/app.blade.php | 1 - resources/views/search/result.blade.php | 5 ++--- 7 files changed, 23 insertions(+), 17 deletions(-) diff --git a/app/Http/Controllers/IdolController.php b/app/Http/Controllers/IdolController.php index 88302d7..cb5a39d 100644 --- a/app/Http/Controllers/IdolController.php +++ b/app/Http/Controllers/IdolController.php @@ -71,6 +71,7 @@ public function show($name_r) case 'ja': break; case 'en': + case 'zh-CN': $name .= '_r'; break; default: $name .= '_'.mb_substr(\App::getLocale(),0,2); diff --git a/public/css/idol.css b/public/css/idol.css index dbc61f2..99fdefa 100644 --- a/public/css/idol.css +++ b/public/css/idol.css @@ -38,6 +38,7 @@ background-repeat: no-repeat; background-size: 32px; background-position: top 5px left; + font-family: 'VL PGothic',sans-serif; } #idolname.Fairy{ background-image: url("../image/fairy_symbol.png"); diff --git a/public/css/style.css b/public/css/style.css index f1a96a7..a2a0892 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -1,5 +1,6 @@ @import url("https://fonts.googleapis.com/css?family=Gothic+A1:400,700&display=swap&subset=korean"); @import url("https://fonts.googleapis.com/css?family=Open+Sans:400,700&display=swap"); +@import url('https://fonts.googleapis.com/css?family=Noto+Sans+TC:400,700&display=swap'); @font-face { font-family: "VL PGothic"; @@ -15,16 +16,22 @@ body{ box-sizing: border-box; min-height: 99vh; - font-family: 'Open Sans','VL PGothic','Gothic A1','Segoe UI',sans-serif; + font-family: 'Open Sans','VL PGothic','Gothic A1',sans-serif; } *:focus{ outline: none; } +.ja{ + font-family: 'VL PGothic',sans-serif; +} +.zh_TW{ + font-family: 'Noto Sans TC',sans-serif; +} + html{ min-width: 1300px; margin: 0; - font-family: "VL PGothic", sans-serif; font-weight: 500; background: repeating-linear-gradient(45deg, rgba(255,255,255,0.5), rgba(255,255,255,0.5) 1px, rgba(255,255,255,0) 2px, rgba(255,255,255,0) 40px), diff --git a/resources/views/idol/index.blade.php b/resources/views/idol/index.blade.php index 77fccbd..fb344be 100644 --- a/resources/views/idol/index.blade.php +++ b/resources/views/idol/index.blade.php @@ -9,18 +9,17 @@ @foreach ($idols as $idol) name_r.'/0.png'); if(!$ja_flag){ - $name = 'name_'.($en_flag ? 'r' : mb_substr($current_lang,0,2)); + $name = 'name_'.((App::isLocale('en') || App::isLocale('zh-CN')) ? 'r' : mb_substr($current_lang,0,2)); if(empty($idol->$name)) $name = 'name_r'; //fallback $separate = $name.'_separate'; $text = e(ucwords(separateString($idol->$name,$idol->$separate))); - $text .= "".e(ucwords(separateString($idol->name,$idol->name_separate))).""; + $text .= "".e(ucwords(separateString($idol->name,$idol->name_separate))).""; } $dateflag = $ja_flag ? 'ja' : 'slash'; ?> diff --git a/resources/views/idol/show.blade.php b/resources/views/idol/show.blade.php index 93adc3b..baa1452 100644 --- a/resources/views/idol/show.blade.php +++ b/resources/views/idol/show.blade.php @@ -45,12 +45,12 @@ if(!empty($idol->subname)) $namestr .= ' ('.$idol->subname.')'; $dateflag = App::isLocale('ja') ? 'ja' : 'slash'; $urlname = urlencode($idol->name) ?> - {{ __fb('Name') }}{{ $namestr }} - {{ __fb('CV') }}{{ $idol->cv }} + {{ __fb('Name') }}{{ $namestr }} + {{ __fb('CV') }}{{ $idol->cv }} - {{ __fb('Hiragana') }}{{ separateString($idol->name_y,$idol->name_y_separate) }} - {{ __fb('Chinese') }}{{ $idol->name_zh ? separateString($idol->name_zh,$idol->name_zh_separate) : __fb('N/A') }} + {{ __fb('Hiragana') }}{{ separateString($idol->name_y,$idol->name_y_separate) }} + {{ __fb('Chinese') }}{{ $idol->name_zh ? separateString($idol->name_zh,$idol->name_zh_separate) : __fb('N/A') }} Alphabet{{ ucwords(separateString($idol->name_r,$idol->name_r_separate)) }} @@ -67,27 +67,27 @@ {{ __fb('Handedness') }}{{ __fb(translateHandedness($idol->handedness)) ?: __fb('N/A') }} - {{ __fb('Birthplace') }}{{ $idol->birthplace ?: '不明' }} + {{ __fb('Birthplace') }}{{ $idol->birthplace ?: '不明' }} BMI{{ calcBmi($idol->height,$idol->weight) ?: __fb('N/A') }} {{ __fb('3 size') }}{{ $idol->bust ? $idol->bust.' / '.$idol->waist.' / '.$idol->hip : __fb('N/A') }} {{ __fb('Hobby') }} - + hobby,App::getLocale()) ?> {{ $idol->hobby ?: __fb('N/A') }} {{ __fb('Skill') }} - + skill,App::getLocale()) ?> {{ $idol->skill ?: __fb('N/A') }} {{ __fb('Favorite') }} - + favorite,App::getLocale()) ?> {{ $idol->favorite ?: __fb('N/A') }} diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 44cc12c..81a45c9 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -49,7 +49,6 @@ function gtag(){dataLayer.push(arguments);} @elseif(\App::isLocale('zh-TW'))