Skip to content

Commit b7e4cf9

Browse files
GUI Translation Additions. Closes #2409 (#2420)
* Add further GUI translations. * Update changelog.
1 parent 490801e commit b7e4cf9

15 files changed

Lines changed: 322 additions & 128 deletions

File tree

.changelog/SNAPSHOTS/6.3.0.0-SNAPSHOT-10.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ Conditional components dynamically determine their output based on the current s
4242
## Minor Changes
4343
- renamed price to price_solo for text-display configurations.
4444
- Added support for displaying the name of the song on a music disc using shop.use-song-for-disc-item in config.yml
45+
- Added enchantments to enchanted book views for shop UIs
46+
- Added support for translating remaining untranslatable UI messages.
4547

4648
## Deprecations
4749
- Deprecated IShopLayoutProvider#renderHeaderSnapshot

quickshop-bukkit/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
</parent>
1313

1414
<properties>
15-
<tnml.version>1.7.0.1-SNAPSHOT-4</tnml.version>
15+
<tnml.version>1.7.0.1-SNAPSHOT-5</tnml.version>
1616
<tnil.version>0.1.3.1-SNAPSHOT-1</tnil.version>
1717
</properties>
1818

quickshop-bukkit/src/main/java/com/ghostchu/quickshop/QuickShop.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
import org.bukkit.command.Command;
155155
import org.bukkit.command.PluginCommand;
156156
import org.bukkit.event.HandlerList;
157+
import org.bukkit.inventory.ItemStack;
157158
import org.bukkit.plugin.Plugin;
158159
import org.bukkit.plugin.ServicePriority;
159160
import org.h2.Driver;
@@ -1417,6 +1418,14 @@ public AbstractItemStack<?> stack() {
14171418
return new BukkitItemStack();
14181419
}
14191420

1421+
public AbstractItemStack<ItemStack> stack(final ItemStack itemStack) {
1422+
1423+
if(PaperLib.isPaper()) {
1424+
return new PaperItemStack().of(itemStack);
1425+
}
1426+
return new BukkitItemStack().of(itemStack);
1427+
}
1428+
14201429
public @NotNull TextManager text() {
14211430

14221431
return this.textManager;

quickshop-bukkit/src/main/java/com/ghostchu/quickshop/menu/browse/BrowseFilterMode.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,27 @@ public enum BrowseFilterMode {
2828
/**
2929
* Show all shops
3030
*/
31-
ALL("all", "gui.browse.filter.all"),
31+
ALL("all", "gui.browse.filter.all", "gui.browse.filter.all-indicator"),
3232

3333
/**
3434
* Show only buying shops (shops that buy from players)
3535
*/
36-
BUYING("buying", "gui.browse.filter.buying"),
36+
BUYING("buying", "gui.browse.filter.buying", "gui.browse.filter.buying-indicator"),
3737

3838
/**
3939
* Show only selling shops (shops that sell to players)
4040
*/
41-
SELLING("selling", "gui.browse.filter.selling");
41+
SELLING("selling", "gui.browse.filter.selling", "gui.browse.filter.selling-indicator");
4242

4343
private final String id;
4444
private final String translationKey;
45+
private final String indicatorTranslationKey;
4546

46-
BrowseFilterMode(final String id, final String translationKey) {
47+
BrowseFilterMode(final String id, final String translationKey, final String indicatorTranslationKey) {
4748

4849
this.id = id;
4950
this.translationKey = translationKey;
51+
this.indicatorTranslationKey = indicatorTranslationKey;
5052
}
5153

5254
/**
@@ -76,6 +78,11 @@ public String getTranslationKey() {
7678
return translationKey;
7779
}
7880

81+
public String indicatorTranslationKey() {
82+
83+
return indicatorTranslationKey;
84+
}
85+
7986
/**
8087
* Get the next filter mode in the cycle
8188
*

quickshop-bukkit/src/main/java/com/ghostchu/quickshop/menu/browse/MainPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public void handle(final PageOpenCallback callback) {
153153
.build());
154154

155155
int i = 0;
156-
for(final Shop shop : shops) {
156+
for(final Shop<?, ?> shop : shops) {
157157

158158
//System.out.println("Menu add: id: " + shop.getShopId() + " slot: " + offset + (i - start) + "i: " + i);
159159

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
package com.ghostchu.quickshop.menu.browse;
2+
3+
/*
4+
* QuickShop-Hikari
5+
* Copyright (C) 2026 Daniel "creatorfromhell" Vidmar
6+
*
7+
* This program is free software: you can redistribute it and/or modify
8+
* it under the terms of the GNU Affero General Public License as published by
9+
* the Free Software Foundation, either version 3 of the License, or
10+
* (at your option) any later version.
11+
*
12+
* This program is distributed in the hope that it will be useful,
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
* GNU Affero General Public License for more details.
16+
*
17+
* You should have received a copy of the GNU Affero General Public License
18+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19+
*/
20+
21+
/**
22+
* PriceIndicator
23+
*
24+
* @author creatorfromhell
25+
* @since 6.3.0.0
26+
*/
27+
public enum PriceIndicator {
28+
29+
GREAT("great"),
30+
GOOD("good"),
31+
AVERAGE("average"),
32+
BAD("bad"),
33+
WORST("worst");
34+
35+
private final String key;
36+
37+
PriceIndicator(final String key) {
38+
this.key = key;
39+
}
40+
41+
public String key() {
42+
return key;
43+
}
44+
45+
public String colorPath(final boolean selling) {
46+
return "indicators." + key + "." + ((selling)? "sell" : "buy") + ".color";
47+
}
48+
49+
public String ratioPath(final boolean selling) {
50+
return "indicators." + key + "." + ((selling)? "sell" : "buy") + ".ratio";
51+
}
52+
53+
public String labelPath(final boolean selling) {
54+
return "indicators." + key + "." + ((selling)? "sell" : "buy") + ".label";
55+
}
56+
}

0 commit comments

Comments
 (0)