Skip to content

Commit 47bbb88

Browse files
committed
Closes #5 for 1.14.4 branch.
Signed-off-by: Pavel Erokhin (MairwunNx) <[email protected]>
1 parent 0c939c0 commit 47bbb88

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

src/main/kotlin/com/mairwunnx/projectessentials/core/api/v1/messaging/MessagingAPI.kt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,23 @@ object MessagingAPI {
130130
val displayedLines = page * linesPerPage
131131
val droppedLines = displayedLines - linesPerPage
132132
val values = list.take(displayedLines).drop(droppedLines)
133+
val pageString = LocalizationAPI.getLocalizedString(
134+
player.language,
135+
"project_essentials_core.simple.page",
136+
page.toString(),
137+
maxPage.toString()
138+
).let {
139+
if (it.isEmpty()) {
140+
return@let TranslationTextComponent(
141+
"project_essentials_core.simple.page",
142+
page, maxPage
143+
).formattedText
144+
}
145+
return@let it
146+
}
133147
val message =
134148
"""
135-
§7$title page §c$page §7of §c$maxPage
149+
§7$title $pageString
136150
137151
§7${values.joinToString(separator = "\n") { " §c> §7$it" }}
138152
"""

src/main/resources/assets/projectessentialscore/lang/en_us.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
"project_essentials_core.back.restricted": "§cYou §7don't have permission §cto rolling back your location.",
77
"project_essentials_core.configure.successfully": "§6Setting name \"§7%s§6\" value changed from \"§7%s§6\" to \"§7%s§6\"",
88
"project_essentials_core.configure.successfully_required_restart": "§6Setting name \"§7%s§6\" value changed from \"§7%s§6\" to \"§7%s§6\", but §crestart required §6for applying changes.",
9-
"project_essentials_core.configure.restricted": "§cYou §7don't have permission §cto change setting (§8\"§7%s§8\"§c) value."
9+
"project_essentials_core.configure.restricted": "§cYou §7don't have permission §cto change setting (§8\"§7%s§8\"§c) value.",
10+
"project_essentials_core.simple.page": "§7page §c%s §7of §c%s"
1011
}

src/main/resources/assets/projectessentialscore/lang/ru_ru.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
"project_essentials_core.back.restricted": "§cУ вас §7нет прав §cчтобы выполнить откат вашей локации.",
77
"project_essentials_core.configure.successfully": "§6Значение настройки \"§7%s§6\" было изменено с \"§7%s§6\" на \"§7%s§6\"",
88
"project_essentials_core.configure.successfully_required_restart": "§6Значение настройки \"§7%s§6\" было изменено с \"§7%s§6\" на \"§7%s§6\", но для применения изменений §cтребуется перезагрузка §6сервера или клиента.",
9-
"project_essentials_core.configure.restricted": "§cУ вас §7нет прав §cчто бы изменить значение настройки (§8\"§7%s§8\"§c)."
9+
"project_essentials_core.configure.restricted": "§cУ вас §7нет прав §cчто бы изменить значение настройки (§8\"§7%s§8\"§c).",
10+
"project_essentials_core.simple.page": "§7страница §c%s §7из §c%s"
1011
}

0 commit comments

Comments
 (0)