Improve i18n of tooltip

This commit is contained in:
Antifluxfield 2017-09-15 01:25:50 +08:00 committed by GitHub
parent 673aaeaaab
commit 8faba6a054

View file

@ -42,7 +42,12 @@ public class GT_Item_Machines
if(tDescription.contains("%%%")){ if(tDescription.contains("%%%")){
String[] tString = tDescription.split("%%%"); String[] tString = tDescription.split("%%%");
if(tString.length>=2){ if(tString.length>=2){
aList.add(GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tString[0], !GregTech_API.sPostloadFinished )+" "+tString[1]); StringBuffer tBuffer = new StringBuffer();
Object tRep[] = new String[tString.length / 2];
for (int j = 0; j < tString.length; j++)
if (j % 2 == 0) tBuffer.append(tString[j]);
else {tBuffer.append(" %s"); tRep[j / 2] = tString[j];}
aList.add(String.format(GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tBuffer.toString(), !GregTech_API.sPostloadFinished), tRep));
} }
}else{String tTranslated = GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tDescription, !GregTech_API.sPostloadFinished ); }else{String tTranslated = GT_LanguageManager.addStringLocalization("TileEntity_DESCRIPTION_" + tDamage + "_Index_" + i++, tDescription, !GregTech_API.sPostloadFinished );
aList.add(tTranslated.equals("") ? tDescription : tTranslated);} aList.add(tTranslated.equals("") ? tDescription : tTranslated);}