mirror of
https://github.com/GTNewHorizons/NotEnoughItems.git
synced 2026-11-14 01:14:07 +00:00
Localise all the things!
This commit is contained in:
1 parent
e99febf27c
commit
d59b28f8fc
5 files changed
+61
-22
No files matched your search
@@ -24,6 +24,8 @@ import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import static codechicken.nei.NEIClientUtils.translate;
|
||||
|
||||
public class SubsetWidget extends Button implements ItemFilterProvider, ItemsLoadedCallback, ISearchProvider
|
||||
{
|
||||
public static class SubsetState
|
||||
@@ -125,7 +127,6 @@ public class SubsetWidget extends Button implements ItemFilterProvider, ItemsLoa
|
||||
public List<SubsetTag> sorted = Collections.emptyList();
|
||||
private int childwidth;
|
||||
|
||||
protected String displayName;
|
||||
protected SubsetState state = new SubsetState();
|
||||
protected final SubsetSlot slot = new SubsetSlot();
|
||||
private SubsetTag selectedChild;
|
||||
@@ -139,15 +140,15 @@ public class SubsetWidget extends Button implements ItemFilterProvider, ItemsLoa
|
||||
assert filter != null : "Filter cannot be null";
|
||||
this.fullname = EnumChatFormatting.getTextWithoutFormattingCodes(fullname);
|
||||
this.filter = filter;
|
||||
|
||||
if(fullname != null) {
|
||||
int idx = fullname.lastIndexOf('.');
|
||||
displayName = idx < 0 ? fullname : fullname.substring(idx + 1);
|
||||
}
|
||||
}
|
||||
|
||||
public String displayName() {
|
||||
return displayName;
|
||||
String translated = translate("subsets."+fullname);
|
||||
if(!translated.startsWith("nei."))
|
||||
return translated;
|
||||
|
||||
int idx = fullname.lastIndexOf('.');
|
||||
return idx < 0 ? fullname : fullname.substring(idx + 1);
|
||||
}
|
||||
|
||||
public String name() {
|
||||
@@ -595,6 +596,11 @@ public class SubsetWidget extends Button implements ItemFilterProvider, ItemsLoa
|
||||
ItemList.loadCallbacks.add(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRenderLabel() {
|
||||
return translate("inventory.item_subsets");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(int mx, int my) {
|
||||
super.draw(mx, my);
|
||||
|
||||
Reference in new issue
Block a user