Gacha Records: Support multiple languages

This commit is contained in:
Tesutarin 2022-06-15 10:22:55 +08:00 committed by Melledy
parent 779e0f738d
commit cc4094549e
7 changed files with 31 additions and 3 deletions

View File

@ -70,6 +70,9 @@ public final class GachaHandler implements Router {
String template = new String(FileUtils.read(recordsTemplate), StandardCharsets.UTF_8)
.replace("{{REPLACE_RECORDS}}", records)
.replace("{{REPLACE_MAXPAGE}}", String.valueOf(maxPage))
.replace("{{TITLE}}", translate(player, "gacha.records.title"))
.replace("{{DATE}}", translate(player, "gacha.records.date"))
.replace("{{ITEM}}", translate(player, "gacha.records.item"))
.replace("{{LANGUAGE}}", Utils.getLanguageCode(account.getLocale()));
response.send(template);
}

View File

@ -67,12 +67,12 @@
<body>
<div class="content">
<div class="container">
<h2 class="mb-5">Gacha Records</h2>
<h2 class="mb-5">{{TITLE}}</h2>
<table id="container" class="table table-striped custom-table">
<thead>
<tr>
<th scope="col">Date</th>
<th scope="col">Item</th>
<th scope="col">{{DATE}}</th>
<th scope="col">{{ITEM}}</th>
</tr>
</thead>
<tbody>

View File

@ -399,6 +399,11 @@
"available_five_stars": "Available 5-star Items",
"available_four_stars": "Available 4-star Items",
"available_three_stars": "Available 3-star Items"
},
"records": {
"title": "Gacha Records",
"date": "Date",
"item": "Item"
}
},
"documentation": {

View File

@ -399,6 +399,11 @@
"available_five_stars": "Objets 5 étoiles disponibles",
"available_four_stars": "Objets 4 étoiles disponibles",
"available_three_stars": "Objets 3 étoiles disponibles"
},
"records": {
"title": "Gacha Records",
"date": "Date",
"item": "Objet"
}
},
"documentation": {

View File

@ -315,6 +315,11 @@
"available_five_stars": "Available 5-star Items",
"available_four_stars": "Available 4-star Items",
"available_three_stars": "Available 3-star Items"
},
"records": {
"title": "Gacha Records",
"date": "Date",
"item": "Item"
}
}
}

View File

@ -399,6 +399,11 @@
"available_five_stars": "可获得的5星物品",
"available_four_stars": "可获得的4星物品",
"available_three_stars": "可获得的3星物品"
},
"records": {
"title": "祈愿记录",
"date": "日期",
"item": "物品"
}
},
"documentation": {

View File

@ -399,6 +399,11 @@
"available_five_stars": "可獲得的5星物品",
"available_four_stars": "可獲得的4星物品",
"available_three_stars": "可獲得的3星物品"
},
"records": {
"title": "祈願記錄",
"date": "日期",
"item": "物品"
}
},
"documentation": {