Some short work on localizing commands. The template has been

discovered!
This commit is contained in:
pahimar 2013-08-29 22:03:13 -04:00
parent a223eccabc
commit 0012ef3594
5 changed files with 16 additions and 41 deletions

View file

@ -99,9 +99,6 @@ public class EquivalentExchange3 {
// Initialize the log helper
LogHelper.init();
// Load the localization files into the LanguageRegistry
//LocalizationHandler.loadLanguages();
// Initialize the configuration
ConfigurationHandler.init(new File(event.getModConfigurationDirectory()
.getAbsolutePath()

View file

@ -68,8 +68,9 @@ public class CommandOverlay {
try {
float scale = Float.parseFloat(args[1]);
if (scale <= 0F)
throw new WrongUsageException(Commands.COMMAND_OVERLAY_SCALE_USAGE + " " + LocalizationUtil.getLocalizedString(Commands.COMMAND_OVERLAY_SCALE_USAGE_ADDITIONAL_TEXT), new Object[0]);
if (scale <= 0F) {
throw new WrongUsageException(Commands.COMMAND_OVERLAY_SCALE_USAGE_ADDITIONAL_TEXT, new Object[] { Commands.COMMAND_OVERLAY_SCALE_USAGE });
}
else {
ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE = scale;
ConfigurationHandler.set(ConfigurationHandler.CATEGORY_GRAPHICS, ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE_CONFIGNAME, args[1]);
@ -77,11 +78,12 @@ public class CommandOverlay {
}
}
catch (Exception e) {
throw new WrongUsageException(Commands.COMMAND_OVERLAY_SCALE_USAGE + " " + LocalizationUtil.getLocalizedString(Commands.COMMAND_OVERLAY_SCALE_USAGE_ADDITIONAL_TEXT), new Object[0]);
throw new WrongUsageException(Commands.COMMAND_OVERLAY_SCALE_USAGE_ADDITIONAL_TEXT, new Object[] { Commands.COMMAND_OVERLAY_SCALE_USAGE });
}
}
else
throw new WrongUsageException(Commands.COMMAND_OVERLAY_SCALE_USAGE + " " + LocalizationUtil.getLocalizedString(Commands.COMMAND_OVERLAY_SCALE_USAGE_ADDITIONAL_TEXT), new Object[0]);
else {
throw new WrongUsageException(Commands.COMMAND_OVERLAY_SCALE_USAGE_ADDITIONAL_TEXT, new Object[] { Commands.COMMAND_OVERLAY_SCALE_USAGE });
}
}
private static void processOpacityCommand(ICommandSender commandSender, String[] args) {

View file

@ -1,30 +0,0 @@
package com.pahimar.ee3.core.handlers;
import com.pahimar.ee3.core.util.LocalizationUtil;
import com.pahimar.ee3.lib.Localizations;
import cpw.mods.fml.common.registry.LanguageRegistry;
/**
* Equivalent-Exchange-3
*
* LocalizationHandler
*
* @author pahimar
* @license Lesser GNU Public License v3 (http://www.gnu.org/licenses/lgpl.html)
*
*/
public class LocalizationHandler {
/***
* Loads in all the localization files from the Localizations library class
*/
public static void loadLanguages() {
// For every file specified in the Localization library class, load them into the Language Registry
for (String localizationFile : Localizations.localeFiles) {
LanguageRegistry.instance().loadLocalization(localizationFile, LocalizationUtil.getLocaleFromFileName(localizationFile), LocalizationUtil.isXMLLanguageFile(localizationFile));
}
}
}

View file

@ -51,7 +51,7 @@ public class Commands {
public static final String COMMAND_OVERLAY_POSITION_BOTTOM_RIGHT = "command.ee3.overlay.position.bottom_right";
public static final String COMMAND_OVERLAY_OPACITY_USAGE_ADDITIONAL_TEXT = "command.ee3.overlay.opacity.usage.additional_text";
public static final String COMMAND_OVERLAY_OPACITY_UPDATED = "command.ee3.overlay.opacity.updated";
public static final String COMMAND_OVERLAY_SCALE_USAGE_ADDITIONAL_TEXT = "command.ee3.overlay.opacity.usage.additional_text";
public static final String COMMAND_OVERLAY_SCALE_USAGE_ADDITIONAL_TEXT = "command.ee3.overlay.scale.usage.additional_text";
public static final String COMMAND_OVERLAY_SCALE_UPDATED = "command.ee3.overlay.scale.updated";
public static final String COMMAND_PARTICLES_TURNED_ON = "command.ee3.particles.turned_on";
public static final String COMMAND_PARTICLES_TURNED_OFF = "command.ee3.particles.turned_off";

View file

@ -1,9 +1,10 @@
# Key localizations
key.extra=Extra
key.release=Release
key.toggle=Toggle
key.charge=Charge
# Item localizations
item.ee3:shardMinium.name=Shard of Minium
item.ee3:stoneInert.name=Inert Stone
item.ee3:stoneMinium.name=Minium Stone
@ -16,6 +17,7 @@ item.ee3:alchemicalDustAmaranthine.name=Amaranthine Dust
item.ee3:alchemicalDustIridescent.name=Iridescent Dust
item.ee3:alchemicalBag.name=Alchemical Bag
# Block localizations
tile.ee3:redWaterStill.name=Red Water (Still)
tile.ee3:redWaterFlowing.name=Red Water (Flowing)
tile.ee3:calcinator.name=Calcinator
@ -23,12 +25,14 @@ tile.ee3:aludel.name=Aludel
tile.ee3:alchemicalChest.name=Alchemical Chest
tile.ee3:glassBell.name=Glass Bell
# GUI localizations
container.calcinator=Calcinator
container.aludel=Aludel
container.alchemicalChest=Alchemical Chest
container.alchemicalBag=Alchemical Bag
container.glassBell=Glass Bell
# Command localizations
command.ee3.overlay.turned_on=Target transmutation overlay turned on
command.ee3.overlay.turned_off=Target transmutation overlay turned off
command.ee3.overlay.position.top_left=Target transmutation overlay position set to top left
@ -37,7 +41,7 @@ command.ee3.overlay.position.bottom_left=Target transmutation overlay position s
command.ee3.overlay.position.bottom_right=Target transmutation overlay position set to bottom right
command.ee3.overlay.opacity.usage.additional_text=(where ### is a decimal value between 0.0 and 1.0)
command.ee3.overlay.opacity.updated=Target transmutation overlay opacity updated successfully
command.ee3.overlay.scale.usage.additional_text=(where ### is a decimal value greater than 0.0)
command.ee3.overlay.scale.usage.additional_text=%s (where ### is a decimal value greater than 0.0)
command.ee3.overlay.scale.updated=Target transmutation overlay scale updated successfully
command.ee3.particles.turned_on=Equivalent Exchange 3 particles turned on
command.ee3.particles.turned_off=Equivalent Exchange 3 particles turned off
@ -45,8 +49,10 @@ command.ee3.sounds.set_to_all=Playing Equivalent Exchange 3 sounds from all play
command.ee3.sounds.set_to_self=Playing Equivalent Exchange 3 sounds from self only
command.ee3.sounds.turned_off=Playing Equivalent Exchange 3 sounds disabled
# Creative Tab localizations
itemGroup.EE3=Equivalent Exchange 3
# Version check localizations
version.init_log_message=Initializing remote version check against remote version authority, located at
version.uninitialized=Remote version check failed to initialize properly
version.current=Currently using the most up to date version (@REMOTE_MOD_VERSION@) of Equivalent Exchange 3 for @MINECRAFT_VERSION@