Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #196 from Morichan/ticket-184
Browse files Browse the repository at this point in the history
✨ feat(easy Japanese): やさしい日本語ページの文言変更
  • Loading branch information
korosuke613 authored May 4, 2020
2 parents 957adc3 + e98fcbf commit 5c33225
Show file tree
Hide file tree
Showing 7 changed files with 250 additions and 400 deletions.
2 changes: 1 addition & 1 deletion assets/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"日南市": "Nichinan",
"串間市": "Kushima",
"高千穂町": "Takachiho",
"{age}代": " {age}s",
"{ageHead}歳〜{ageTail}歳": " {ageHead}s",
"10歳未満": "Under 10 years old",
"男性": "Male",
"女性": "Female",
Expand Down
460 changes: 218 additions & 242 deletions assets/locales/ja-Hira.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/locales/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"埼玉県": "埼玉県",
"湖南省長沙市": "湖南省長沙市",
"湖北省武漢市": "湖北省武漢市",
"{age}代": "{age}代",
"{ageHead}歳〜{ageTail}歳": "{ageHead}代",
"10歳未満": "10歳未満",
"男性": "男性",
"女性": "女性",
Expand Down
15 changes: 15 additions & 0 deletions components/DataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@
:mobile-breakpoint="0"
class="cardTable"
>
<template v-slot:header.公表日="{ header }">
<t-i18n>{{ header.text }}</t-i18n>
</template>
<template v-slot:header.居住地="{ header }">
<t-i18n>{{ header.text }}</t-i18n>
</template>
<template v-slot:header.年代="{ header }">
<t-i18n>{{ header.text }}</t-i18n>
</template>
<template v-slot:header.性別="{ header }">
<t-i18n>{{ header.text }}</t-i18n>
</template>
<template v-slot:header.退院="{ header }">
<t-i18n>{{ header.text }}</t-i18n>
</template>
<template v-slot:body="{ items }">
<tbody>
<tr v-for="item in items" :key="item.text">
Expand Down
5 changes: 3 additions & 2 deletions components/cards/ConfirmedCasesAttributesCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@ export default {
} else if (row['年代'] === '不明') {
row['年代'] = this.$t('不明')
} else {
const age = row['年代'].substring(0, 2)
row['年代'] = this.$t('{age}代', { age })
const ageHead = row['年代'].substring(0, 2)
const ageTail = String(Number(ageHead) + 9)
row['年代'] = this.$t('{ageHead}歳〜{ageTail}歳', { ageHead, ageTail })
}
}
Expand Down
2 changes: 1 addition & 1 deletion utils/ruby.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const createRubyObject = (text: string) => {
let lastText: string
let pos = 0
const texts: RubyText[] = []
const regp = /([\p{sc=Han}|\s|・]+?)(([\p{sc=Hiragana}|\s|・]+?))/gu
const regp = /([\p{sc=Han}|・|A-z]+?)(([\p{sc=Hiragana}|\p{sc=Katakana}|ー|・]+?))/gu

// ふりがなを含んだ文字列をパースしてオブジェクトを生成
while ((match = XRegExp.exec(text, regp, pos))) {
Expand Down
Loading

0 comments on commit 5c33225

Please sign in to comment.