mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-22 21:09:51 +00:00
Ensure string capitalization uses English Locale
This commit is contained in:
1 parent
d04adf394b
commit
8303f5c216
6 files changed
+11
-14
No files matched your search
@@ -1,6 +1,7 @@
|
||||
package forestry.apiculture.genetics;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.EnumBeeChromosome;
|
||||
@@ -114,7 +115,7 @@ public enum BeeBranchDefinition implements IBranchDefinition {
|
||||
private final IClassification branch;
|
||||
|
||||
BeeBranchDefinition(String scientific) {
|
||||
branch = BeeManager.beeFactory.createBranch(this.name().toLowerCase(), scientific);
|
||||
branch = BeeManager.beeFactory.createBranch(this.name().toLowerCase(Locale.ENGLISH), scientific);
|
||||
}
|
||||
|
||||
protected void setBranchProperties(IAllele[] template) {
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
package forestry.arboriculture.genetics;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
|
||||
@@ -63,13 +64,13 @@ public enum TreeBranchDefinition implements IBranchDefinition {
|
||||
private final IClassification branch;
|
||||
|
||||
TreeBranchDefinition() {
|
||||
String name = this.name().toLowerCase();
|
||||
String name = this.name().toLowerCase(Locale.ENGLISH);
|
||||
String scientific = WordUtils.capitalize(name);
|
||||
branch = new BranchTrees(name, scientific);
|
||||
}
|
||||
|
||||
TreeBranchDefinition(String scientific) {
|
||||
String name = this.name().toLowerCase();
|
||||
String name = this.name().toLowerCase(Locale.ENGLISH);
|
||||
branch = new BranchTrees(name, scientific);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import java.util.Map;
|
||||
import java.util.Stack;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.text.WordUtils;
|
||||
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@@ -168,7 +169,7 @@ public abstract class GuiAlyzer extends GuiForestry<ContainerAlyzer, IInventory>
|
||||
String mode = breedingTracker.getModeName();
|
||||
if (mode != null && !mode.isEmpty()) {
|
||||
newLine();
|
||||
String rules = StringUtil.localize(guiName + ".behaviour") + ": " + StringUtil.capitalize(mode);
|
||||
String rules = StringUtil.localize(guiName + ".behaviour") + ": " + WordUtils.capitalize(mode);
|
||||
drawCenteredLine(rules, 8, 208, fontColor.get(guiName + ".binomial"));
|
||||
}
|
||||
|
||||
|
||||
@@ -68,13 +68,6 @@ public class StringUtil {
|
||||
return cleanTags(block.getUnlocalizedName());
|
||||
}
|
||||
|
||||
public static String capitalize(String s) {
|
||||
if (s.length() == 0) {
|
||||
return s;
|
||||
}
|
||||
return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();
|
||||
}
|
||||
|
||||
public static String append(String delim, String source, String appendix) {
|
||||
if (source.length() <= 0) {
|
||||
return appendix;
|
||||
|
||||
@@ -2,6 +2,7 @@ package uristqwerty.CraftGuide.api;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
@@ -34,7 +35,7 @@ public class LiquidFilter implements ItemFilter
|
||||
{
|
||||
String name = liquid.getFluid().getLocalizedName();
|
||||
this.liquid = liquid;
|
||||
liquidName = name.toLowerCase();
|
||||
liquidName = name.toLowerCase(Locale.ENGLISH);
|
||||
tooltip.clear();
|
||||
tooltip.add(name);
|
||||
}
|
||||
@@ -52,7 +53,7 @@ public class LiquidFilter implements ItemFilter
|
||||
}
|
||||
else if(item instanceof String)
|
||||
{
|
||||
return liquidName.contains(((String)item).toLowerCase());
|
||||
return liquidName.contains(((String)item).toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
else if(item instanceof List)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user