Closed mechcalvin closed 3 years ago
- how to do translation on e.g. award titles, descriptions, etc
Currently, the only way to do this is by editing all the modules (the py
files in the mcstats/stats
directory). Simply change the title
and desc
fields to what you need.
The units for stats are practically hardcoded to be metric - if you need miles or want to change those, you'll have to change that in the client (the JavaScripts).
I never had localization in mind, but it sounds like a good idea to centralize it in language files similar to how Minecraft works itself. 👍
- does the awardlist order is auto arrange by names? so if i change the names it will re-arrange base on the new names?
Yes, the list should be sorted by the award title automatically.
Localization has been implemented! I have added a dropdown in the navigation that allows selecting the language, an example can be seen here: https://mine3.dvgaming.com/
At the time of writing, only English and my native language German are supported. Instructions for adding new languages are given in the readme - if you do translate MinecraftStats, please do create a pull request!
Hi Patrick,
The localization tag for minutes is wrong in js/dev/mcstats-widgets.js. stat.unit.duration.hours should be stat.unit.duration.minutes
if(higher || seconds > 60) {
var minutes = Math.floor(seconds / 60);
table += `<td class="minutes">${minutes}${**mcstats.localize('stat.unit.duration.hours**')}</td>`
seconds %= 60;
} else {
table += `<td class="minutes"></td>`
}
finally sort out the problem and running on my website (require manual update for now), looks fantastic but wondering