Skip to content

Commit

Permalink
多言語:陽性者の属性の年代処理修正
Browse files Browse the repository at this point in the history
「nn代」の値を最初にチェックするように修正。これで他の値は翻訳
データの追加たけで対応できる。
  • Loading branch information
rayjolt committed Mar 20, 2020
1 parent b7580ba commit a73af6f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -296,15 +296,12 @@ export default {
if (row['性別'] === '非公表性'){
row['性別'] = this.$t('非公表')
}
if (row['年代'] === '10歳未満') {
row['年代'] = this.$t('10歳未満')
}
else if (row['年代'] === '非公表'){
row['年代'] = this.$t('非公表')
const match = row['年代'].match(/^([0-9]+)代$/)
if (match) {
row['年代'] = this.$t('{age}代', { age: match[1] })
}
else {
const age = row['年代'].substring(0, 2)
row['年代'] = this.$t('{age}代', { age })
row['年代'] = this.$t(row['年代'])
}
}
this.patients.last_update = response.last_update;
Expand Down

0 comments on commit a73af6f

Please sign in to comment.