Improve i18n

This commit is contained in:
syuilo 2018-08-02 06:58:15 +09:00
parent 97f642a5fa
commit 60c148f322
3 changed files with 44 additions and 27 deletions

View file

@ -37,6 +37,15 @@ common:
friday: "金" friday: "金"
saturday: "土" saturday: "土"
weekday:
sunday: "日曜日"
monday: "月曜日"
tuesday: "火曜日"
wednesday: "水曜日"
thursday: "木曜日"
friday: "金曜日"
saturday: "土曜日"
reactions: reactions:
like: "いいね" like: "いいね"
love: "しゅき" love: "しゅき"

View file

@ -4,27 +4,27 @@
<div class="mkw-calendar--body"> <div class="mkw-calendar--body">
<div class="calendar" :data-is-holiday="isHoliday"> <div class="calendar" :data-is-holiday="isHoliday">
<p class="month-and-year"> <p class="month-and-year">
<span class="year">%i18n:year-english%{{ year }}%i18n:year-japanese%</span> <span class="year">%i18n:@year-english%{{ year }}%i18n:@year-japanese%</span>
<span class="month">%i18n:month-english%{{ month }}%i18n:month-japanese%</span> <span class="month">%i18n:@month-english%{{ month }}%i18n:@month-japanese%</span>
</p> </p>
<p class="day">>%i18n:day-english%{{ day }}%i18n:day-japanese%</p> <p class="day">%i18n:@day-english%{{ day }}%i18n:@day-japanese%</p>
<p class="week-day">%i18n:weekday-english%{{ weekDay }}%i18n:weekday-japanese%</p> <p class="week-day">{{ weekDay }}</p>
</div> </div>
<div class="info"> <div class="info">
<div> <div>
<p>%i18n:today%<b>{{ dayP.toFixed(1) }}%</b></p> <p>%i18n:@today%<b>{{ dayP.toFixed(1) }}%</b></p>
<div class="meter"> <div class="meter">
<div class="val" :style="{ width: `${dayP}%` }"></div> <div class="val" :style="{ width: `${dayP}%` }"></div>
</div> </div>
</div> </div>
<div> <div>
<p>%i18n:this-month%<b>{{ monthP.toFixed(1) }}%</b></p> <p>%i18n:@this-month%<b>{{ monthP.toFixed(1) }}%</b></p>
<div class="meter"> <div class="meter">
<div class="val" :style="{ width: `${monthP}%` }"></div> <div class="val" :style="{ width: `${monthP}%` }"></div>
</div> </div>
</div> </div>
<div> <div>
<p>%i18n:this-year%<b>{{ yearP.toFixed(1) }}%</b></p> <p>%i18n:@this-year%<b>{{ yearP.toFixed(1) }}%</b></p>
<div class="meter"> <div class="meter">
<div class="val" :style="{ width: `${yearP}%` }"></div> <div class="val" :style="{ width: `${yearP}%` }"></div>
</div> </div>
@ -84,7 +84,15 @@ export default define({
this.year = ny; this.year = ny;
this.month = nm + 1; this.month = nm + 1;
this.day = nd; this.day = nd;
this.weekDay = ['日', '月', '火', '水', '木', '金', '土'][now.getDay()]; this.weekDay = [
'%i18n:common.weekday.sunday%',
'%i18n:common.weekday.monday%',
'%i18n:common.weekday.tuesday%',
'%i18n:common.weekday.wednesday%',
'%i18n:common.weekday.thursday%',
'%i18n:common.weekday.friday%',
'%i18n:common.weekday.saturday%'
][now.getDay()];
const dayNumer = now.getTime() - new Date(ny, nm, nd).getTime(); const dayNumer = now.getTime() - new Date(ny, nm, nd).getTime();
const dayDenom = 1000/*ms*/ * 60/*s*/ * 60/*m*/ * 24/*h*/; const dayDenom = 1000/*ms*/ * 60/*s*/ * 60/*m*/ * 24/*h*/;