[FEATURE] Started implementing translations

For issue #100
This commit is contained in:
JKetelaar
2016-10-17 00:36:14 +02:00
parent 691406934b
commit 88c94cfce1
2 changed files with 13 additions and 12 deletions
+1 -1
View File
@@ -73,7 +73,7 @@
<dependency> <dependency>
<groupId>org.parabot</groupId> <groupId>org.parabot</groupId>
<artifactId>internal-api</artifactId> <artifactId>internal-api</artifactId>
<version>1.02.7</version> <version>1.03.1</version>
</dependency> </dependency>
</dependencies> </dependencies>
+12 -11
View File
@@ -1,5 +1,6 @@
package org.parabot; package org.parabot;
import org.parabot.api.translations.TranslationHelper;
import org.parabot.core.Configuration; import org.parabot.core.Configuration;
import org.parabot.core.Core; import org.parabot.core.Core;
import org.parabot.core.Directories; import org.parabot.core.Directories;
@@ -32,10 +33,10 @@ public final class Landing {
parseArgs(args); parseArgs(args);
Core.verbose("Debug mode: " + Core.inDebugMode()); Core.verbose(TranslationHelper.translate("DEBUG_MODE") + Core.inDebugMode());
try { try {
Core.verbose("Setting look and feel: " Core.verbose(TranslationHelper.translate("SETTING_LOOK_AND_FEEL")
+ UIManager.getSystemLookAndFeelClassName()); + UIManager.getSystemLookAndFeelClassName());
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Throwable t) { } catch (Throwable t) {
@@ -43,25 +44,25 @@ public final class Landing {
} }
if (!Core.inDebugMode() && !Core.isValid() && Core.hasValidation()) { if (!Core.inDebugMode() && !Core.isValid() && Core.hasValidation()) {
UILog.log("Updates", UILog.log(TranslationHelper.translate("UPDATES"),
"Please download the newest version of Parabot at " TranslationHelper.translate("DOWNLOAD_UPDATE_PARABOT_AT")
+ Configuration.DOWNLOAD_BOT, + Configuration.DOWNLOAD_BOT,
JOptionPane.INFORMATION_MESSAGE); JOptionPane.INFORMATION_MESSAGE);
URI uri = URI.create(Configuration.API_DOWNLOAD_BOT); URI uri = URI.create(Configuration.API_DOWNLOAD_BOT);
try { try {
Desktop.getDesktop().browse(uri); Desktop.getDesktop().browse(uri);
} catch (IOException e1) { } catch (IOException e1) {
JOptionPane.showMessageDialog(null, "Connection Error", JOptionPane.showMessageDialog(null, TranslationHelper.translate("CONNECTION_ERROR"),
"Error", JOptionPane.ERROR_MESSAGE); TranslationHelper.translate("ERROR"), JOptionPane.ERROR_MESSAGE);
e1.printStackTrace(); e1.printStackTrace();
} }
return; return;
} }
Core.verbose("Validating directories..."); Core.verbose(TranslationHelper.translate("VALIDATING_DIRECTORIES"));
Directories.validate(); Directories.validate();
Core.verbose("Validating account manager..."); Core.verbose(TranslationHelper.translate("VALIDATION_ACCOUNT_MANAGER"));
AccountManager.validate(); AccountManager.validate();
if (username != null && password != null) { if (username != null && password != null) {
@@ -71,7 +72,7 @@ public final class Landing {
return; return;
} }
Core.verbose("Starting login gui..."); Core.verbose(TranslationHelper.translate("STARTING_LOGIN_GUI"));
new BotUI(null, null); new BotUI(null, null);
} }
@@ -82,7 +83,7 @@ public final class Landing {
case "-createdirs": case "-createdirs":
Directories.validate(); Directories.validate();
System.out System.out
.println("Directories created, you can now run parabot."); .println(TranslationHelper.translate(("DIRECTORIES_CREATED")));
System.exit(0); System.exit(0);
break; break;
case "-debug": case "-debug":
@@ -131,7 +132,7 @@ public final class Landing {
case "-proxy": case "-proxy":
ProxyType type = ProxyType.valueOf(args[++i].toUpperCase()); ProxyType type = ProxyType.valueOf(args[++i].toUpperCase());
if (type == null) { if (type == null) {
System.err.println("Invalid proxy type: " + args[i]); System.err.println(TranslationHelper.translate("INVALID_PROXY_TYPE") + args[i]);
System.exit(1); System.exit(1);
return; return;
} }