Skip to content

Commit 85f59d4

Browse files
committed
handle translation on server
1 parent 6ba7ff8 commit 85f59d4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/main/java/gregtech/api/mui/LocaleAccessor.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package gregtech.api.mui;
22

33
import net.minecraft.client.resources.Locale;
4+
import net.minecraft.util.text.translation.I18n;
45

56
// todo remove in next mui2 version
67
public interface LocaleAccessor {
@@ -10,7 +11,9 @@ public interface LocaleAccessor {
1011
ThreadLocal<LocaleAccessor> accessor = new ThreadLocal<>();
1112

1213
static String getRawKey(String s) {
13-
if (accessor.get() == null) return s;
14+
if (accessor.get() == null) {
15+
return I18n.localizedName.translateKey(s);
16+
}
1417
return accessor.get().gregtech$getRawKey(s);
1518
}
1619

0 commit comments

Comments
 (0)