Commit e5a85f81 authored by ImmuState's avatar ImmuState Committed by Melledy
Browse files

Insert language setting based on the player's account.

parent 57c7f7a4
...@@ -81,11 +81,11 @@ ...@@ -81,11 +81,11 @@
</footer> </footer>
<script> <script>
fiveStarItems = {{FIVE_STARS}}; var fiveStarItems = {{FIVE_STARS}};
fourStarItems = {{FOUR_STARS}}; var fourStarItems = {{FOUR_STARS}};
threeStarItems = {{THREE_STARS}}; var threeStarItems = {{THREE_STARS}};
var lang = "{{LANGUAGE}}";
var lang = new window.URLSearchParams(window.location.search).get("lang");
function getNameForId(itemId) { function getNameForId(itemId) {
if (mappings[lang] != null && mappings[lang][itemId] != null) { if (mappings[lang] != null && mappings[lang][itemId] != null) {
return mappings[lang][itemId][0]; return mappings[lang][itemId][0];
......
...@@ -52,6 +52,8 @@ public final class GachaDetailsHandler implements HttpContextHandler { ...@@ -52,6 +52,8 @@ public final class GachaDetailsHandler implements HttpContextHandler {
response = response.replace("{{AVAILABLE_FOUR_STARS}}", translate(player, "gacha.details.available_four_stars")); response = response.replace("{{AVAILABLE_FOUR_STARS}}", translate(player, "gacha.details.available_four_stars"));
response = response.replace("{{AVAILABLE_THREE_STARS}}", translate(player, "gacha.details.available_three_stars")); response = response.replace("{{AVAILABLE_THREE_STARS}}", translate(player, "gacha.details.available_three_stars"));
response = response.replace("{{LANGUAGE}}", Utils.getLanguageCode(account.getLocale()));
// Get the banner info for the banner we want. // Get the banner info for the banner we want.
int gachaType = Integer.parseInt(req.query("gachaType")); int gachaType = Integer.parseInt(req.query("gachaType"));
GachaManager manager = Grasscutter.getGameServer().getGachaManager(); GachaManager manager = Grasscutter.getGameServer().getGachaManager();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment