Add chart time window translations

This commit is contained in:
DBotThePony 2024-10-02 10:46:01 +07:00
parent 0f1c1f1653
commit 4e3cf276e9
Signed by: DBot
GPG Key ID: DCC23B5715498507
3 changed files with 21 additions and 8 deletions

View File

@ -829,6 +829,13 @@ private fun gui(provider: MatteryLanguageProvider) {
with(provider.english) {
gui("ago", "%s ago")
gui("time.short.5s", "5s")
gui("time.short.15s", "15s")
gui("time.short.1m", "1m")
gui("time.short.1h", "1h")
gui("time.short.6h", "6h")
gui("time.short.24h", "24h")
gui("part_of_multiblock", "Part of multiblock structure, useless on its own")
gui("quicksearch", "Quick search...")

View File

@ -834,6 +834,13 @@ private fun gui(provider: MatteryLanguageProvider) {
with(provider.russian) {
gui("ago", "%s тому назад")
gui("time.short.5s", "5с")
gui("time.short.15s", "15с")
gui("time.short.1m", "")
gui("time.short.1h", "")
gui("time.short.6h", "")
gui("time.short.24h", "24ч")
gui("part_of_multiblock", "Часть мультиблока, бесполезен сам по себе")
gui("quicksearch", "Быстрый поиск...")

View File

@ -12,7 +12,6 @@ import ru.dbotthepony.mc.otm.client.screen.panels.*
import ru.dbotthepony.mc.otm.client.screen.panels.button.ButtonPanel
import ru.dbotthepony.mc.otm.client.screen.panels.button.makeDeviceControls
import ru.dbotthepony.mc.otm.client.screen.panels.input.NetworkNumberInputPanel
import ru.dbotthepony.mc.otm.core.TextComponent
import ru.dbotthepony.mc.otm.core.util.formatPower
import ru.dbotthepony.mc.otm.menu.tech.EnergyCounterMenu
@ -24,16 +23,16 @@ class EnergyCounterScreen(menu: EnergyCounterMenu, inventory: Inventory, title:
frame.width += 60f
val graphs = linkedMapOf(
menu.history5s to "5s",
menu.history15s to "15s",
menu.history1m to "1m",
menu.history1h to "1h",
menu.history6h to "6h",
menu.history24h to "24h",
menu.history5s to "otm.gui.time.short.5s",
menu.history15s to "otm.gui.time.short.15s",
menu.history1m to "otm.gui.time.short.1m",
menu.history1h to "otm.gui.time.short.1h",
menu.history6h to "otm.gui.time.short.6h",
menu.history24h to "otm.gui.time.short.24h",
)
for ((graph, text) in graphs) {
val tab = frame.Tab(activeIcon = TextIcon(color = RGBAColor.BLACK, font = font, text = TextComponent(text)))
val tab = frame.Tab(activeIcon = TextIcon(color = RGBAColor.BLACK, font = font, text = TranslatableComponent(text)))
val panel = DecimalHistoryChartPanel(this, tab.canvas, graph, formatText = { it.formatPower(formatAsReadable = ShiftPressedCond) })
panel.dock = Dock.FILL
}