refactor: change the way languages are done

This commit is contained in:
Ryan Dowling 2019-07-13 17:19:54 +10:00
parent 1661f59a02
commit bb16a39784
No known key found for this signature in database
GPG key ID: 5539FCDB88950EFD
69 changed files with 3182 additions and 1633 deletions

3
.gitignore vendored
View file

@ -13,3 +13,6 @@ testLauncher/
# OS X things
.DS_Store
# Other things
java_pid*.hprof

View file

@ -9,6 +9,8 @@
"vscjava.vscode-java-debug",
"redhat.java",
"naco-siren.gradle-language",
"rebornix.project-snippets"
"rebornix.project-snippets",
"mrorz.language-gettext",
"aaron-bond.better-comments"
]
}

15
.vscode/settings.json vendored
View file

@ -1,3 +1,16 @@
{
"java.import.gradle.wrapper.enabled": true
"java.import.gradle.wrapper.enabled": true,
"[po]": {
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": false,
"files.trimFinalNewlines": true,
},
"better-comments.tags": [
{
"tag": "#.",
"color": "#3498DB",
"strikethrough": false,
"backgroundColor": "transparent"
}
],
}

10
.vscode/tasks.json vendored
View file

@ -7,12 +7,20 @@
"label": "build",
"type": "shell",
"command": "./gradlew build",
"dependsOn": ["clean"],
"dependsOn": [
"clean"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "generateTemplatePot",
"type": "shell",
"command": "./gradlew generatePots",
"problemMatcher": []
},
{
"label": "clean",
"type": "shell",

View file

@ -19,3 +19,4 @@
- Speed up launcher load time by hot loading the pack tabs
- Cache some HTTP requests
- Remove advanced backup. We're looking into how to update and make this better for the future
- Change the way that languages are loaded, allowing for easier translations going forward

View file

@ -128,6 +128,33 @@ Build is used for beta releases allowing you to have higher version numbers but
update when the real
release comes.
## Translating
ATLauncher is written for English speakers. All our translations are community run by those who
submit pull requests to update the text to a different language.
Languages are contained within the `src\main\resources\assets\lang` directory and are based off the
master template file at `src\main\resources\assets\lang\template.pot`.
To create a new language you can copy this file and then name it with the locale name and `.po` as
the extension.
For instance for French, it is `src\main\resources\assets\lang\fr.po`.
While you can make changes to the files manually, using a tool like [POEdit](https://poedit.net/) is
recommended.
### Updating the template file
If new strings are added to the launcher, the template file will need to be updated in order to
take into account the new strings.
In order to do this, run `./gradlew generatePots` which will scan the source files and update the
`src\main\resources\assets\lang\template.pot` file.
Note that our of the box, this will not generate in the correct format. The file should be opened
with [POEdit](https://poedit.net/), which will automatically fix the file, which then you can save.
## Need Help/Have Questions?
If you have questions please don't hesitate to [contact us](https://www.atlauncher.com/contact-us/)

View file

@ -1,5 +1,15 @@
import java.util.stream.Collectors
buildscript {
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath 'org.mini2Dx:gettext-gradle-plugin:1.0.1'
}
}
plugins {
id 'java'
id 'application'
@ -10,6 +20,8 @@ plugins {
id 'net.minecrell.licenser' version '0.4.1'
}
apply plugin: "org.mini2Dx.gettext"
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
@ -17,6 +29,7 @@ group = 'com.atlauncher'
version = '3.2.10.0'
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven {
@ -38,6 +51,7 @@ dependencies {
implementation 'com.squareup.okhttp3:okhttp:4.0.0'
implementation 'net.mikehardy:google-analytics-java:2.0.8'
implementation 'io.sentry:sentry:1.7.16'
implementation 'org.mini2Dx:gettext-lib:1.0.1'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.2'
@ -63,6 +77,14 @@ jar {
}
}
gettext {
template {
srcDir = 'src'
include = 'main/java/com/atlauncher/**/*.java'
outputFilename = 'template.pot'
}
}
license {
header = project.file('LICENSEHEADER')
sourceSets = [project.sourceSets.main]
@ -135,6 +157,12 @@ task createMacApp(type: Zip) {
archiveName = "${project.name}-${project.version}.zip"
}
task copyTemplatePot(type: Copy) {
dependsOn generatePots
from "${projectDir}/build/gettext/template.pot"
into "${projectDir}/src/main/resources/assets/lang"
}
copyArtifacts.finalizedBy {
println 'ATLauncher has been built. Distribution files are located in the dist directory'
}
@ -146,3 +174,4 @@ clean.doFirst {
build.finalizedBy copyArtifacts
shadowJar.dependsOn jar
build.dependsOn createExe, createMacApp
generatePots.finalizedBy copyTemplatePot

1
scripts/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.files-to-extract

View file

@ -0,0 +1,7 @@
cd ../src/main/java/com/atlauncher
dir *.java /b/s > ../../../../../scripts/.files-to-extract
cd ../../../../../scripts/
xgettext -D ../ --keyword=GetText.tr -f .files-to-extract -L Java --from-code utf-8 --force-po --add-comments="#. " --omit-header -o ../src/main/resources/assets/lang/template.pot
del .files-to-extract

View file

@ -0,0 +1,7 @@
find ../src/main/java/com/atlauncher/ -name '*.java' | sed -n 's|^../||p' > .files-to-extract
xgettext -D ../ --keyword=GetText.tr -f .files-to-extract -L Java --from-code utf-8 --force-po --add-comments="#. " --omit-header -o ../src/main/resources/assets/lang/template.pot
sed -i 's|^#. #.|#.|p' ../src/main/resources/assets/lang/template.pot
uniq ../src/main/resources/assets/lang/template.pot temp
rm -f ../src/main/resources/assets/lang/template.pot
mv temp ../src/main/resources/assets/lang/template.pot
rm .files-to-extract

View file

@ -53,6 +53,7 @@ import javax.swing.text.DefaultEditorKit;
import com.atlauncher.data.Constants;
import com.atlauncher.data.Instance;
import com.atlauncher.data.Language;
import com.atlauncher.data.Pack;
import com.atlauncher.data.Settings;
import com.atlauncher.gui.LauncherFrame;
@ -255,6 +256,12 @@ public class App {
LogManager.logStackTrace("Error organising filesystem", e);
}
try {
Language.init();
} catch (IOException e1) {
LogManager.logStackTrace("Error loading language", e1);
}
// Setup the Settings and wait for it to finish.
settings = new Settings();
@ -356,8 +363,6 @@ public class App {
}
}
TRAY_MENU.localize();
if (settings.enableDiscordIntegration()) {
DiscordEventHandlers handlers = new DiscordEventHandlers.Builder().build();
DiscordRPC.discordInitialize(Constants.DISCORD_CLIENT_ID, handlers, true);

View file

@ -57,6 +57,8 @@ import com.atlauncher.utils.Utils;
import com.mojang.authlib.yggdrasil.YggdrasilUserAuthentication;
import com.mojang.util.UUIDTypeAdapter;
import org.mini2Dx.gettext.GetText;
/**
* This class deals with the Accounts in the launcher.
*/
@ -472,8 +474,8 @@ public class Account implements Serializable {
this.skinUpdating = true;
final File file = new File(App.settings.getSkinsDir(), this.getUUIDNoDashes() + ".png");
LogManager.info("Downloading skin for " + this.minecraftUsername);
final ProgressDialog dialog = new ProgressDialog(Language.INSTANCE.localize("account.downloadingskin"), 0,
Language.INSTANCE.localizeWithReplace("account.downloadingminecraftskin", this.minecraftUsername),
final ProgressDialog dialog = new ProgressDialog(GetText.tr("Downloading Skin"), 0,
GetText.tr("Downloading Skin For {0}", this.minecraftUsername),
"Aborting downloading Minecraft skin for " + this.minecraftUsername);
final UUID uid = this.getRealUUID();
dialog.addThread(new Thread(() -> {
@ -525,9 +527,9 @@ public class Account implements Serializable {
}));
dialog.start();
if (!(Boolean) dialog.getReturnValue()) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("common.error"))
.setContent(Language.INSTANCE.localize("account.skinerror")).setType(DialogManager.ERROR)
.show();
DialogManager.okDialog().setTitle(GetText.tr("Error"))
.setContent(GetText.tr("Error downloading skin. Please try again later!"))
.setType(DialogManager.ERROR).show();
}
this.skinUpdating = false;
}
@ -656,15 +658,13 @@ public class Account implements Serializable {
if (!this.isRemembered()) {
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
JLabel passwordLabel = new JLabel(
Language.INSTANCE.localizeWithReplace("instance.enterpassword", this.getMinecraftUsername()));
JLabel passwordLabel = new JLabel(GetText.tr("Enter password for {0}", this.getMinecraftUsername()));
JPasswordField passwordField = new JPasswordField();
panel.add(passwordLabel, BorderLayout.NORTH);
panel.add(passwordField, BorderLayout.CENTER);
int ret = DialogManager.confirmDialog()
.setTitle(Language.INSTANCE.localize("instance.enterpasswordtitle")).setContent(panel).show();
int ret = DialogManager.confirmDialog().setTitle(GetText.tr("Enter Password")).setContent(panel).show();
if (ret == DialogManager.OK_OPTION) {
if (passwordField.getPassword().length == 0) {
@ -687,10 +687,9 @@ public class Account implements Serializable {
if (response.hasError() && !response.isOffline()) {
LogManager.error(response.getErrorMessage());
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.errorloggingintitle"))
.setContent(HTMLUtils.centerParagraph(HTMLUtils.centerParagraph(
HTMLUtils.centerParagraph(Language.INSTANCE.localizeWithReplace("instance.errorloggingin",
"<br/><br/>" + response.getErrorMessage())))))
DialogManager.okDialog().setTitle(GetText.tr("Error Logging In"))
.setContent(HTMLUtils.centerParagraph(HTMLUtils.centerParagraph(HTMLUtils.centerParagraph(
GetText.tr("Couldn't login to Minecraft servers") + "<br/><br/>" + response.getErrorMessage()))))
.setType(DialogManager.ERROR).show();
App.settings.setMinecraftLaunched(false);

View file

@ -55,6 +55,8 @@ import com.atlauncher.utils.HTMLUtils;
import com.atlauncher.utils.OS;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
import net.arikia.dev.drpc.DiscordRPC;
import net.arikia.dev.drpc.DiscordRichPresence;
@ -509,7 +511,7 @@ public class Instance implements Cloneable {
if (this.realPack != null) {
return this.realPack.getDescription();
} else {
return Language.INSTANCE.localize("pack.nodescription");
return GetText.tr("No Description");
}
}
@ -1353,8 +1355,8 @@ public class Instance implements Cloneable {
public boolean launch() {
final Account account = App.settings.getAccount();
if (account == null) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.noaccountselected"))
.setContent(HTMLUtils.centerParagraph(Language.INSTANCE.localize("instance.noaccount")))
DialogManager.okDialog().setTitle(GetText.tr("No Account Selected"))
.setContent(GetText.tr("Cannot play instance as you have no account selected"))
.setType(DialogManager.ERROR).show();
App.settings.setMinecraftLaunched(false);
@ -1364,10 +1366,10 @@ public class Instance implements Cloneable {
? App.settings.getMaximumMemory()
: settings.getMaximumMemory();
if ((maximumMemory < this.memory) && (this.memory <= OS.getSafeMaximumRam())) {
int ret = DialogManager.optionDialog()
.setTitle(Language.INSTANCE.localize("instance.insufficientramtitle"))
.setContent(HTMLUtils.centerParagraph(Language.INSTANCE.localizeWithReplace(
"instance.insufficientram", "<b>" + this.memory + "</b> " + "MB<br/><br/>")))
int ret = DialogManager.optionDialog().setTitle(GetText.tr("Insufficient Ram"))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"This pack has set a minimum amount of ram needed to {0}.<br/><br/>Do you want to continue loading the instance anyway?",
"<b>" + this.memory + "</b> MB")))
.setLookAndFeel(DialogManager.YES_NO_OPTION).setType(DialogManager.ERROR)
.setDefaultOption(DialogManager.YES_OPTION).show();
@ -1380,10 +1382,10 @@ public class Instance implements Cloneable {
Integer permGen = (this.settings == null || this.settings.getPermGen() == null) ? App.settings.getPermGen()
: settings.getPermGen();
if (permGen < this.permgen) {
int ret = DialogManager.optionDialog()
.setTitle(Language.INSTANCE.localize("instance.insufficientpermgentitle"))
.setContent(HTMLUtils.centerParagraph(Language.INSTANCE.localizeWithReplace(
"instance.insufficientpermgen", "<b>" + this.permgen + "</b> " + "MB<br/><br/>")))
int ret = DialogManager.optionDialog().setTitle(GetText.tr("Insufficent Permgen"))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"This pack has set a minimum amount of permgen to {0}.<br/><br/>Do you want to continue loading the instance anyway?",
"<b>" + this.permgen + "</b> MB")))
.setLookAndFeel(DialogManager.YES_NO_OPTION).setType(DialogManager.ERROR)
.setDefaultOption(DialogManager.YES_OPTION).show();
if (ret != 0) {
@ -1394,8 +1396,8 @@ public class Instance implements Cloneable {
}
LogManager.info("Logging into Minecraft!");
final ProgressDialog dialog = new ProgressDialog(Language.INSTANCE.localize("account.loggingin"), 0,
Language.INSTANCE.localize("account.loggingin"), "Aborted login to Minecraft!");
final ProgressDialog dialog = new ProgressDialog(GetText.tr("Logging Into Minecraft"), 0,
GetText.tr("Logging Into Minecraft"), "Aborted login to Minecraft!");
dialog.addThread(new Thread(() -> {
dialog.setReturnValue(account.login());
dialog.close();
@ -1554,15 +1556,14 @@ public class Instance implements Cloneable {
// OpenEye returned a response to the report, display that to user if needed.
LogManager.info("OpenEye: Pending crash report sent! URL: " + response.getURL());
if (response.hasNote()) {
int ret = DialogManager.optionDialog()
.setTitle(Language.INSTANCE.localize("instance.aboutyourcrash"))
.setContent(HTMLUtils.centerParagraph(
Language.INSTANCE.localizeWithReplace("instance.openeyereport1", "<br/><br/>")
+ response.getNoteDisplay()
+ Language.INSTANCE.localize("instance" + ".openeyereport2")))
.setType(DialogManager.INFO)
.addOption(Language.INSTANCE.localize("common.opencrashreport"))
.addOption(Language.INSTANCE.localize("common.ok"), true).show();
int ret = DialogManager.optionDialog().setTitle(GetText.tr("About Your Crash"))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"We detected a previous unreported crash generated by the OpenEye mod.<br/><br/>This has now been sent off to OpenEye and you can open the crash report below or continue without viewing it.")
+ "<br/><br/>" + response.getNoteDisplay()
+ GetText.tr(
"You can turn this off by unchecking the OpenEye Reporting setting in the Settings tab. Click Ok to continue.")))
.setType(DialogManager.INFO).addOption(GetText.tr("Open Crash Report"))
.addOption(GetText.tr("Ok"), true).show();
if (ret == 0) {
OS.openWebBrowser(response.getURL());
@ -1660,7 +1661,8 @@ public class Instance implements Cloneable {
writer.flush();
if (showToast) {
App.TOASTER.pop("Instance " + this.getName());
// #. {0} is the name of the instance
App.TOASTER.pop(GetText.tr("Instance {0} Saved!", this.getName()));
}
} catch (IOException e) {
LogManager.logStackTrace("Failed to write instance.json", e);
@ -1759,6 +1761,6 @@ public class Instance implements Cloneable {
this.save(false);
App.TOASTER.pop(mod.name + " " + Language.INSTANCE.localize("common.installed"));
App.TOASTER.pop(mod.name + " " + GetText.tr("Installed"));
}
}

View file

@ -62,6 +62,7 @@ import com.atlauncher.utils.OS;
import com.atlauncher.utils.Utils;
import com.google.gson.JsonIOException;
import org.mini2Dx.gettext.GetText;
import org.zeroturnaround.zip.ZipUtil;
import net.arikia.dev.drpc.DiscordRPC;
@ -157,7 +158,7 @@ public class InstanceV2 extends MinecraftVersion {
if (pack != null) {
return pack.description;
} else {
return Language.INSTANCE.localize("pack.nodescription");
return GetText.tr("No Description");
}
}
@ -219,7 +220,7 @@ public class InstanceV2 extends MinecraftVersion {
OkHttpClient httpClient = Network.createProgressClient(progressDialog);
try {
progressDialog.setLabel(Language.INSTANCE.localize("instance.downloadingminecraft"));
progressDialog.setLabel(GetText.tr("Downloading Minecraft"));
com.atlauncher.network.Download clientDownload = com.atlauncher.network.Download.build()
.setUrl(this.downloads.client.url).hash(this.downloads.client.sha1).size(this.downloads.client.size)
.withHttpClient(httpClient).downloadTo(this.getMinecraftJarLibraryPath());
@ -236,7 +237,7 @@ public class InstanceV2 extends MinecraftVersion {
}
// download libraries
progressDialog.setLabel(Language.INSTANCE.localize("instance.downloadinglibraries"));
progressDialog.setLabel(GetText.tr("Downloading Libraries"));
DownloadPool librariesPool = new DownloadPool();
this.libraries.stream().filter(library -> library.shouldInstall() && library.downloads.artifact != null)
@ -271,7 +272,7 @@ public class InstanceV2 extends MinecraftVersion {
progressDialog.doneTask();
// organise assets
progressDialog.setLabel(Language.INSTANCE.localize("instance.downloadingresources"));
progressDialog.setLabel(GetText.tr("Downloading Resources"));
MojangAssetIndex assetIndex = this.assetIndex;
AssetIndex index = com.atlauncher.network.Download.build().setUrl(assetIndex.url).hash(assetIndex.sha1)
@ -305,7 +306,7 @@ public class InstanceV2 extends MinecraftVersion {
progressDialog.doneTask();
try {
progressDialog.setLabel(Language.INSTANCE.localize("instance.organisinglibraries"));
progressDialog.setLabel(GetText.tr("Organising Libraries"));
if (Files.exists(this.getNativesTemp())) {
FileUtils.deleteDirectory(this.getNativesTemp());
}
@ -348,8 +349,9 @@ public class InstanceV2 extends MinecraftVersion {
final Account account = App.settings.getAccount();
if (account == null) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.noaccountselected"))
.setContent(HTMLUtils.centerParagraph(Language.INSTANCE.localize("instance.noaccount")))
DialogManager.okDialog().setTitle(GetText.tr("No Account Selected"))
.setContent(HTMLUtils
.centerParagraph(GetText.tr("Cannot play instance as you have no account selected.")))
.setType(DialogManager.ERROR).show();
App.settings.setMinecraftLaunched(false);
@ -359,11 +361,10 @@ public class InstanceV2 extends MinecraftVersion {
: this.launcher.maximumMemory;
if ((maximumMemory < this.launcher.requiredMemory)
&& (this.launcher.requiredMemory <= OS.getSafeMaximumRam())) {
int ret = DialogManager.optionDialog()
.setTitle(Language.INSTANCE.localize("instance.insufficientramtitle"))
.setContent(HTMLUtils
.centerParagraph(Language.INSTANCE.localizeWithReplace("instance.insufficientram",
"<b>" + this.launcher.requiredMemory + "</b> " + "MB<br/><br/>")))
int ret = DialogManager.optionDialog().setTitle(GetText.tr("Insufficient Ram"))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"This pack has set a minimum amount of ram needed to {0}.<br/><br/>Do you want to continue loading the instance anyway?",
"<b>" + this.launcher.requiredMemory + "</b> MB")))
.setLookAndFeel(DialogManager.YES_NO_OPTION).setType(DialogManager.ERROR)
.setDefaultOption(DialogManager.YES_OPTION).show();
@ -375,11 +376,10 @@ public class InstanceV2 extends MinecraftVersion {
}
Integer permGen = (this.launcher.permGen == null) ? App.settings.getPermGen() : this.launcher.permGen;
if (permGen < this.launcher.requiredPermGen) {
int ret = DialogManager.optionDialog()
.setTitle(Language.INSTANCE.localize("instance.insufficientpermgentitle"))
.setContent(HTMLUtils
.centerParagraph(Language.INSTANCE.localizeWithReplace("instance.insufficientpermgen",
"<b>" + this.launcher.requiredPermGen + "</b> " + "MB<br/><br/>")))
int ret = DialogManager.optionDialog().setTitle(GetText.tr("Insufficent Permgen"))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"This pack has set a minimum amount of permgen to {0}.<br/><br/>Do you want to continue loading the instance anyway?",
"<b>" + this.launcher.requiredPermGen + "</b> MB")))
.setLookAndFeel(DialogManager.YES_NO_OPTION).setType(DialogManager.ERROR)
.setDefaultOption(DialogManager.YES_OPTION).show();
if (ret != 0) {
@ -390,8 +390,8 @@ public class InstanceV2 extends MinecraftVersion {
}
LogManager.info("Logging into Minecraft!");
ProgressDialog loginDialog = new ProgressDialog(Language.INSTANCE.localize("account.loggingin"), 0,
Language.INSTANCE.localize("account.loggingin"), "Aborted login to Minecraft!");
ProgressDialog loginDialog = new ProgressDialog(GetText.tr("Logging Into Minecraft"), 0,
GetText.tr("Logging Into Minecraft"), "Aborted login to Minecraft!");
loginDialog.addThread(new Thread(() -> {
loginDialog.setReturnValue(account.login());
loginDialog.close();
@ -404,8 +404,8 @@ public class InstanceV2 extends MinecraftVersion {
return false;
}
ProgressDialog prepareDialog = new ProgressDialog(Language.INSTANCE.localize("instance.preparingforlaunch"),
4, Language.INSTANCE.localize("instance.preparingforlaunch"));
ProgressDialog prepareDialog = new ProgressDialog(GetText.tr("Preparing For Launch"), 4,
GetText.tr("Preparing For Launch"));
prepareDialog.addThread(new Thread(() -> {
LogManager.info("Preparing for launch!");
prepareDialog.setReturnValue(prepareForLaunch(prepareDialog));
@ -563,15 +563,14 @@ public class InstanceV2 extends MinecraftVersion {
// OpenEye returned a response to the report, display that to user if needed.
LogManager.info("OpenEye: Pending crash report sent! URL: " + response.getURL());
if (response.hasNote()) {
int ret = DialogManager.optionDialog()
.setTitle(Language.INSTANCE.localize("instance.aboutyourcrash"))
.setContent(HTMLUtils.centerParagraph(
Language.INSTANCE.localizeWithReplace("instance.openeyereport1", "<br/><br/>")
+ response.getNoteDisplay()
+ Language.INSTANCE.localize("instance" + ".openeyereport2")))
.setType(DialogManager.INFO)
.addOption(Language.INSTANCE.localize("common.opencrashreport"))
.addOption(Language.INSTANCE.localize("common.ok"), true).show();
int ret = DialogManager.optionDialog().setTitle(GetText.tr("instance.aboutyourcrash"))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"We detected a previous unreported crash generated by the OpenEye mod.<br/><br/>This has now been sent off to OpenEye and you can open the crash report below or continue without viewing it.")
+ "<br/><br/>" + response.getNoteDisplay()
+ GetText.tr(
"You can turn this off by unchecking the OpenEye Reporting setting in the Settings tab. Click Ok to continue.")))
.setType(DialogManager.INFO).addOption(GetText.tr("Open Crash Report"))
.addOption(GetText.tr("Ok"), true).show();
if (ret == 0) {
OS.openWebBrowser(response.getURL());
@ -654,7 +653,8 @@ public class InstanceV2 extends MinecraftVersion {
this.save();
App.TOASTER.pop(mod.name + " " + Language.INSTANCE.localize("common.installed"));
// #. {0} is the name of a mod that was installed
App.TOASTER.pop(GetText.tr("{0} Installed", mod.name));
}
public boolean hasCustomMods() {

View file

@ -17,95 +17,40 @@
*/
package com.atlauncher.data;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Properties;
import com.atlauncher.App;
import com.atlauncher.LogManager;
public enum Language {
INSTANCE, Language;
import org.mini2Dx.gettext.GetText;
private final Map<String, Properties> langs = new HashMap<>();
private volatile String current;
public class Language {
public final static Map<String, Locale> languages = new HashMap<>();
public static String selected = "English";
private Language() {
try {
this.load("English");
} catch (IOException ex) {
LogManager.logStackTrace("Failed to load language", ex);
}
public static void init() throws IOException {
languages.put("English", Locale.ENGLISH);
}
public static String[] available() {
File[] files = App.settings.getLanguagesDir().listFiles((dir, name) -> name.endsWith(".lang"));
String[] langs = new String[files.length];
for (int i = 0; i < files.length; i++) {
langs[i] = files[i].getName().substring(0, 1).toUpperCase()
+ files[i].getName().substring(1, files[i].getName().lastIndexOf("."));
}
return langs;
}
public static void setLanguage(String language) throws IOException {
Locale locale;
public static synchronized String current() {
return INSTANCE.current;
}
public synchronized void load(String lang) throws IOException {
if (!this.langs.containsKey(lang)) {
Properties props = new Properties();
File langFile = new File(App.settings.getLanguagesDir(), lang.toLowerCase() + ".lang");
if (!langFile.exists()) {
LogManager.error("Language file " + langFile.getName() + " doesn't exist! Defaulting it inbuilt one!");
props.load(App.class.getResourceAsStream("/assets/lang/english.lang"));
} else {
props.load(new FileInputStream(langFile));
}
this.langs.put(lang, props);
LogManager.info("Loading Language: " + lang);
}
this.current = lang;
}
public synchronized void reload(String lang) throws IOException {
if (this.langs.containsKey(lang)) {
this.langs.remove(lang);
}
this.load(lang);
}
public synchronized String localize(String lang, String tag) {
if (this.langs.containsKey(lang)) {
Properties props = this.langs.get(lang);
if (props.containsKey(tag)) {
return props.getProperty(tag, tag);
} else {
if (lang.equalsIgnoreCase("English")) {
return "Unknown language key " + tag;
} else {
return this.localize("English", tag);
}
}
if (isLanguageByName(language)) {
LogManager.info("Language set to " + language);
locale = languages.get(language);
selected = language;
} else {
return this.localize("English", tag);
LogManager.info("Unknown language " + language + ". Defaulting to English");
locale = Locale.ENGLISH;
selected = "English";
}
GetText.setLocale(locale);
}
public synchronized String localize(String tag) {
return this.localize(this.current, tag);
}
public synchronized String localizeWithReplace(String tag, String replaceWith) {
return this.localize(this.current, tag).replace("%s", replaceWith);
}
public synchronized String getCurrent() {
return this.current;
public static boolean isLanguageByName(String language) {
return languages.containsKey(language);
}
}

View file

@ -20,6 +20,8 @@ package com.atlauncher.data;
import com.atlauncher.managers.DialogManager;
import com.atlauncher.utils.HTMLUtils;
import org.mini2Dx.gettext.GetText;
public class MinecraftError {
static final int OUT_OF_MEMORY = 1;
static final int CONCURRENT_MODIFICATION_ERROR_1_6 = 2;
@ -34,16 +36,15 @@ public class MinecraftError {
}
static void showOutOfMemoryPopup() {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.aboutyourcrash"))
DialogManager.okDialog().setTitle(GetText.tr("About Your Crash"))
.setContent(HTMLUtils.centerParagraph(
Language.INSTANCE.localizeWithReplace("instancecrash.outofmemory", "<br/><br/>")))
GetText.tr("Minecraft has crashed due to insufficent memory being allocated.<br/><br/>Please go to the settings tab and increase the maximum memory option and then try launching the instance again.")))
.setType(DialogManager.INFO).show();
}
static void showConcurrentModificationError16() {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.aboutyourcrash"))
.setContent(HTMLUtils.centerParagraph(Language.INSTANCE
.localizeWithReplace("instancecrash.concurrentmodificationerror16", "<br/><br/>")))
DialogManager.okDialog().setTitle(GetText.tr("About Your Crash"))
.setContent(HTMLUtils.centerParagraph(GetText.tr("Minecraft has crashed due to an incompatability with Forge and your version of Java.<br/><br/>Please reinstall the instance to automatically fix the problem, and then try launching the instance again.")))
.setType(DialogManager.INFO).show();
}
}

View file

@ -24,6 +24,8 @@ import com.atlauncher.App;
import com.atlauncher.utils.MCQuery;
import com.google.gson.reflect.TypeToken;
import org.mini2Dx.gettext.GetText;
import de.zh32.pingtest.QueryVersion;
public class MinecraftServer {
@ -147,9 +149,9 @@ public class MinecraftServer {
private String getStatusLocalization() {
if (this.playersOnline == -1) {
return Language.INSTANCE.localize("tools.serverchecker.offline");
return GetText.tr("Offline");
} else {
return Language.INSTANCE.localize("tools.serverchecker.online") + " - " + this.getPrintablePlayersOnline()
return GetText.tr("Online") + " - " + this.getPrintablePlayersOnline()
+ " Players";
}
}

View file

@ -89,6 +89,8 @@ import com.google.gson.JsonIOException;
import com.google.gson.JsonSyntaxException;
import com.google.gson.reflect.TypeToken;
import org.mini2Dx.gettext.GetText;
import net.arikia.dev.drpc.DiscordRPC;
import okhttp3.OkHttpClient;
@ -241,9 +243,9 @@ public class Settings {
if (OS.isWindows() && !OS.is64Bit() && OS.isWindows64Bit()) {
LogManager.warn("You're using 32 bit Java on a 64 bit Windows install!");
int ret = DialogManager.yesNoDialog().setTitle(Language.INSTANCE.localize("settings.running32bittitle"))
.setContent(HTMLUtils.centerParagraph(
Language.INSTANCE.localizeWithReplace("settings.running32bit", "<br/><br/>")))
int ret = DialogManager.yesNoDialog().setTitle(GetText.tr("Running 32 Bit Java on 64 Bit Windows"))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"We have detected that you're running 64 bit Windows but not 64 bit Java.<br/><br/>This will cause severe issues playing all packs if not fixed.<br/><br/>Do you want to close the launcher and learn how to fix this issue now?")))
.setType(DialogManager.ERROR).show();
if (ret == 0) {
@ -255,13 +257,12 @@ public class Settings {
if (Java.isMinecraftJavaNewerThanJava8() && !this.hideJava9Warning) {
LogManager.warn("You're using a newer version of Java than Java 8! Modpacks may not launch!");
int ret = DialogManager.optionDialog().setTitle(Language.INSTANCE.localize("settings.java9warningtitle"))
.setContent(HTMLUtils.centerParagraph(
Language.INSTANCE.localizeWithReplace("settings.java9warning", "<br/><br/>")))
.addOption(Language.INSTANCE.localize("common.download"), true)
.addOption(Language.INSTANCE.localize("common.ok"))
.addOption(Language.INSTANCE.localize("instance.dontremindmeagain")).setType(DialogManager.WARNING)
.show();
int ret = DialogManager.optionDialog()
.setTitle(GetText.tr("Warning! You may not be able to play Minecraft"))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"You're using Java 9 or newer! Older modpacks may not work.<br/><br/>If you have issues playing some packs, you may need to install Java 8 and set it to be used in the launchers java settings")))
.addOption(GetText.tr("Download"), true).addOption(GetText.tr("Ok"))
.addOption(GetText.tr("Don't Remind Me Again")).setType(DialogManager.WARNING).show();
if (ret == 0) {
OS.openWebBrowser("http://atl.pw/java8download");
@ -275,13 +276,11 @@ public class Settings {
if (!Java.isUsingJavaSupportingLetsEncrypt() && !this.hideJavaLetsEncryptWarning) {
LogManager.warn("You're using an old version of Java that may not work!");
int ret = DialogManager.optionDialog().setTitle(Language.INSTANCE.localize("settings.unsupportedjavatitle"))
.setContent(HTMLUtils.centerParagraph(
Language.INSTANCE.localizeWithReplace("settings.unsupportedjavaletsencrypt", "<br/><br/>")))
.addOption(Language.INSTANCE.localize("common.download"), true)
.addOption(Language.INSTANCE.localize("common.ok"))
.addOption(Language.INSTANCE.localize("instance.dontremindmeagain")).setType(DialogManager.ERROR)
.show();
int ret = DialogManager.optionDialog().setTitle(GetText.tr("Unsupported Java Version"))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"You're using an unsupported version of Java. You should upgrade your Java to at minimum Java 8 version 101.<br/><br/>Without doing this, some packs may not install.<br/><br/>Click Download to go to the Java downloads page and install the latest Java")))
.addOption(GetText.tr("Download"), true).addOption(GetText.tr("Ok"))
.addOption(GetText.tr("Don't Remind Me Again")).setType(DialogManager.ERROR).show();
if (ret == 0) {
OS.openWebBrowser("http://atl.pw/java8download");
@ -295,13 +294,11 @@ public class Settings {
if (!Java.isJava7OrAbove(true) && !this.hideOldJavaWarning) {
LogManager.warn("You're using an old unsupported version of Java (Java 7 or older)!");
int ret = DialogManager.optionDialog().setTitle(Language.INSTANCE.localize("settings.unsupportedjavatitle"))
.setContent(HTMLUtils.centerParagraph(
Language.INSTANCE.localizeWithReplace("settings.unsupportedjava", "<br/><br/>")))
.addOption(Language.INSTANCE.localize("common.download"), true)
.addOption(Language.INSTANCE.localize("common.ok"))
.addOption(Language.INSTANCE.localize("instance.dontremindmeagain")).setType(DialogManager.WARNING)
.show();
int ret = DialogManager.optionDialog().setTitle(GetText.tr("Unsupported Java Version"))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"You're using an unsupported version of Java. You should upgrade your Java to at minimum Java 7.<br/><br/>Without Java 7 some mods will refuse to load meaning you cannot play.<br/><br/>Click Download to go to the Java downloads page")))
.addOption(GetText.tr("Download"), true).addOption(GetText.tr("Ok"))
.addOption(GetText.tr("Don't Remind Me Again")).setType(DialogManager.WARNING).show();
if (ret == 0) {
OS.openWebBrowser("http://atl.pw/java8download");
@ -521,8 +518,8 @@ public class Settings {
}
public void downloadUpdatedFiles() {
ProgressDialog progressDialog = new ProgressDialog(Language.INSTANCE.localize("common.downloadingupdates"), 1,
Language.INSTANCE.localize("common.downloadingupdates"));
ProgressDialog progressDialog = new ProgressDialog(GetText.tr("Downloading Updates"), 1,
GetText.tr("Downloading Updates"));
progressDialog.addThread(new Thread(() -> {
LogManager.info("Preparing for launch!");
DownloadPool pool = new DownloadPool();
@ -540,14 +537,6 @@ public class Settings {
progressDialog.start();
LogManager.info("Finished downloading updated files!");
if (Language.INSTANCE.getCurrent() != null) {
try {
Language.INSTANCE.reload(Language.INSTANCE.getCurrent());
} catch (IOException e) {
LogManager.logStackTrace("Couldn't reload langauge " + Language.INSTANCE.getCurrent(), e);
}
}
}
public boolean checkForUpdatedFiles() {
@ -816,6 +805,14 @@ public class Settings {
}
}
String lang = properties.getProperty("language", "English");
if (!isLanguageByName(lang)) {
LogManager.warn("Invalid language " + lang + ". Defaulting to English!");
lang = "English";
}
Language.setLanguage(lang);
this.enableProxy = Boolean.parseBoolean(properties.getProperty("enableproxy", "false"));
if (this.enableProxy) {
@ -881,7 +878,7 @@ public class Settings {
lang = "English";
}
Language.INSTANCE.load(lang);
Language.setLanguage(lang);
this.forgeLoggingLevel = properties.getProperty("forgelogginglevel", "INFO");
if (!this.forgeLoggingLevel.equalsIgnoreCase("SEVERE")
@ -1089,7 +1086,7 @@ public class Settings {
properties.setProperty("hideoldjavawarning", this.hideOldJavaWarning + "");
properties.setProperty("hidejavaletsencryptwarning", this.hideJavaLetsEncryptWarning + "");
properties.setProperty("hideJava9Warning", this.hideJava9Warning + "");
properties.setProperty("language", Language.INSTANCE.getCurrent());
properties.setProperty("language", Language.selected);
properties.setProperty("forgelogginglevel", this.forgeLoggingLevel);
properties.setProperty("initialmemory", this.initialMemory + "");
properties.setProperty("ram", this.maximumMemory + "");
@ -2207,7 +2204,7 @@ public class Settings {
*/
public void setLanguage(String language) {
try {
Language.INSTANCE.load(language);
Language.setLanguage(language);
} catch (IOException ex) {
LogManager.logStackTrace("Failed to load language", ex);
}
@ -2574,22 +2571,6 @@ public class Settings {
+ Java.getLauncherJavaVersion();
}
/**
* @deprecated
*/
@Deprecated
public String getLocalizedString(String string) {
return Language.INSTANCE.localize(string);
}
/**
* @deprecated
*/
@Deprecated
public String getLocalizedString(String string, String replace) {
return Language.INSTANCE.localize(string).replace("%s", replace);
}
public void cloneInstance(Instance instance, String clonedName) {
Instance clonedInstance = (Instance) instance.clone();
if (clonedInstance == null) {

View file

@ -21,11 +21,12 @@ import javax.swing.JEditorPane;
import javax.swing.event.HyperlinkEvent;
import com.atlauncher.annot.Json;
import com.atlauncher.data.Language;
import com.atlauncher.data.Pack;
import com.atlauncher.managers.DialogManager;
import com.atlauncher.utils.OS;
import org.mini2Dx.gettext.GetText;
@Json
public class Messages {
public String install;
@ -47,10 +48,9 @@ public class Messages {
OS.openWebBrowser(e.getURL());
}
});
return DialogManager.optionDialog()
.setTitle(Language.INSTANCE.localize("common.installing") + " " + pack.getName()).setContent(ep)
.setType(DialogManager.WARNING).addOption(Language.INSTANCE.localize("common.ok"), true)
.addOption(Language.INSTANCE.localize("common.cancel")).show();
return DialogManager.optionDialog().setTitle(GetText.tr("Installing")).setContent(ep)
.setType(DialogManager.WARNING).addOption(GetText.tr("Ok"), true).addOption(GetText.tr("Cancel"))
.show();
}
public String getUpdateMessage() {
@ -69,9 +69,8 @@ public class Messages {
OS.openWebBrowser(e.getURL());
}
});
return DialogManager.optionDialog()
.setTitle(Language.INSTANCE.localize("common.reinstalling") + " " + pack.getName()).setContent(ep)
.setType(DialogManager.WARNING).addOption(Language.INSTANCE.localize("common.ok"), true)
.addOption(Language.INSTANCE.localize("common.cancel")).show();
return DialogManager.optionDialog().setTitle(GetText.tr("Reinstalling") + " " + pack.getName()).setContent(ep)
.setType(DialogManager.WARNING).addOption(GetText.tr("Ok"), true).addOption(GetText.tr("Cancel"))
.show();
}
}

View file

@ -27,7 +27,6 @@ import com.atlauncher.FileSystem;
import com.atlauncher.LogManager;
import com.atlauncher.annot.Json;
import com.atlauncher.data.Constants;
import com.atlauncher.data.Language;
import com.atlauncher.managers.DialogManager;
import com.atlauncher.utils.HTMLUtils;
import com.atlauncher.utils.Hashing;
@ -36,6 +35,8 @@ import com.atlauncher.utils.Utils;
import com.atlauncher.workers.InstanceInstaller;
import com.google.gson.annotations.SerializedName;
import org.mini2Dx.gettext.GetText;
@Json
public class Mod {
public String name;
@ -418,20 +419,20 @@ public class Mod {
}
retValue = DialogManager.optionDialog()
.setTitle(Language.INSTANCE.localize("common.downloading") + " "
.setTitle(GetText.tr("Downloading") + " "
+ (serverFile == null ? (isFilePattern() ? getName() : getFile())
: (isFilePattern() ? getName() : getServerFile())))
.setContent(HTMLUtils.centerParagraph(Language.INSTANCE.localizeWithReplace(
"instance.browseropened",
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"Browser opened to download file {0}",
(serverFile == null ? (isFilePattern() ? getName() : getFile())
: (isFilePattern() ? getName() : getServerFile())))
+ "<br/><br/>" + Language.INSTANCE.localize("instance.pleasesave") + "<br/><br/>"
+ "<br/><br/>" + GetText.tr("Please save this file to the following location") + "<br/><br/>"
+ (OS.isUsingMacApp() ? App.settings.getUsersDownloadsDir().getAbsolutePath()
: (isFilePattern() ? FileSystem.DOWNLOADS.toAbsolutePath().toString()
: FileSystem.DOWNLOADS.toAbsolutePath().toString() + " or<br/>"
+ App.settings.getUsersDownloadsDir()))))
.addOption(Language.INSTANCE.localize("common.openfolder"), true)
.addOption(Language.INSTANCE.localize("instance.ivedownloaded")).setType(DialogManager.INFO)
.addOption(GetText.tr("Open Folder"), true)
.addOption(GetText.tr("I've Downloading This File")).setType(DialogManager.INFO)
.show();
if (retValue == DialogManager.CLOSED_OPTION) {
@ -559,17 +560,17 @@ public class Mod {
OS.openWebBrowser(this.serverUrl);
int ret = DialogManager.optionDialog()
.setTitle(Language.INSTANCE.localize("common.downloading") + " "
.setTitle(GetText.tr("Downloading") + " "
+ (serverFile == null ? getFile() : getServerFile()))
.setContent(HTMLUtils
.centerParagraph(Language.INSTANCE.localizeWithReplace("instance.browseropened",
.centerParagraph(GetText.tr("Browser opened to download file {0}",
(serverFile == null ? getFile() : getServerFile())) + "<br/><br/>"
+ Language.INSTANCE.localize("instance.pleasesave") + "<br/><br/>"
+ GetText.tr("Please save this file to the following location") + "<br/><br/>"
+ (OS.isUsingMacApp() ? App.settings.getUsersDownloadsDir().getAbsolutePath()
: FileSystem.DOWNLOADS.toAbsolutePath().toString() + " or<br/>"
+ App.settings.getUsersDownloadsDir())))
.setType(DialogManager.INFO)
.addOption(Language.INSTANCE.localize("instance.ivedownloaded"), true).show();
.addOption(GetText.tr("I've Downloading This"), true).show();
if (ret == DialogManager.CLOSED_OPTION) {
installer.cancel(true);

View file

@ -17,9 +17,10 @@
*/
package com.atlauncher.data.openmods;
import com.atlauncher.data.Language;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
/**
* The Class OpenEyeReportResponse contains information returned from OpenMods OpenEye system when a pending crash
* report is reported through their API.
@ -84,10 +85,10 @@ public class OpenEyeReportResponse {
*/
public String getNoteDisplay() {
if (this.hasNote()) {
return Language.INSTANCE.localize("instance.openeyehasnote") + "<br/><br/>" + Utils.splitMultilinedString
return GetText.tr("A note attached to the crash can be seen below:") + "<br/><br/>" + Utils.splitMultilinedString
(this.getNote(), 100, "<br/>") + "<br/><br/>";
} else {
return Language.INSTANCE.localize("instance.openeyenonote") + "<br/><br/>";
return GetText.tr("There is no note attached to this crash.") + "<br/><br/>";
}
}
}

View file

@ -33,7 +33,6 @@ import javax.swing.JScrollPane;
import com.atlauncher.App;
import com.atlauncher.LogManager;
import com.atlauncher.data.Constants;
import com.atlauncher.data.Language;
import com.atlauncher.evnt.listener.RelocalizationListener;
import com.atlauncher.evnt.manager.ConsoleCloseManager;
import com.atlauncher.evnt.manager.ConsoleOpenManager;
@ -42,6 +41,8 @@ import com.atlauncher.gui.components.Console;
import com.atlauncher.gui.components.ConsoleBottomBar;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
public class LauncherConsole extends JFrame implements RelocalizationListener {
private static final long serialVersionUID = -3538990021922025818L;
@ -126,7 +127,7 @@ public class LauncherConsole extends JFrame implements RelocalizationListener {
public void setupLanguage() {
LogManager.debug("Setting up language for console");
copy.setText(Language.INSTANCE.localize("common.copy"));
copy.setText(GetText.tr("Copy"));
bottomBar.setupLanguage();
LogManager.debug("Finished setting up language for console");
}
@ -137,7 +138,7 @@ public class LauncherConsole extends JFrame implements RelocalizationListener {
@Override
public void onRelocalization() {
copy.setText(Language.INSTANCE.localize("common.copy"));
copy.setText(GetText.tr("Copy"));
bottomBar.setupLanguage();
}
}

View file

@ -26,9 +26,10 @@ import javax.swing.JMenuItem;
import javax.swing.JPopupMenu;
import javax.swing.JWindow;
import com.atlauncher.data.Language;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
/**
* The splash screen which shows when the launcher is started up and is loading
* it's stuff.
@ -71,7 +72,7 @@ public class SplashScreen extends JWindow {
* giving a force quit option.
*/
private final class ContextMenu extends JPopupMenu {
private final JMenuItem FORCE_QUIT = new JMenuItem(Language.INSTANCE.localize("common.forcequit"));
private final JMenuItem FORCE_QUIT = new JMenuItem(GetText.tr("Force quit"));
public ContextMenu() {
super();

View file

@ -22,19 +22,17 @@ import javax.swing.JPopupMenu;
import javax.swing.SwingUtilities;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import com.atlauncher.evnt.listener.ConsoleCloseListener;
import com.atlauncher.evnt.listener.ConsoleOpenListener;
import com.atlauncher.evnt.listener.RelocalizationListener;
import com.atlauncher.evnt.manager.ConsoleCloseManager;
import com.atlauncher.evnt.manager.ConsoleOpenManager;
import com.atlauncher.evnt.manager.RelocalizationManager;
import com.atlauncher.managers.DialogManager;
import com.atlauncher.utils.HTMLUtils;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public final class TrayMenu extends JPopupMenu
implements RelocalizationListener, ConsoleCloseListener, ConsoleOpenListener {
public final class TrayMenu extends JPopupMenu implements ConsoleCloseListener, ConsoleOpenListener {
private final JMenuItem killMCButton = new JMenuItem();
private final JMenuItem tcButton = new JMenuItem();
@ -45,9 +43,9 @@ public final class TrayMenu extends JPopupMenu
this.setMinecraftLaunched(false);
this.killMCButton.setText("Kill Minecraft");
this.tcButton.setText("Toggle Console");
this.quitButton.setText("Quit");
this.killMCButton.setText(GetText.tr("Kill Minecraft"));
this.tcButton.setText(GetText.tr("Toggle console"));
this.quitButton.setText(GetText.tr("Quit"));
this.tcButton.setEnabled(false);
@ -58,7 +56,6 @@ public final class TrayMenu extends JPopupMenu
ConsoleCloseManager.addListener(this);
ConsoleOpenManager.addListener(this);
RelocalizationManager.addListener(this);
this.addActionListeners();
}
@ -66,9 +63,9 @@ public final class TrayMenu extends JPopupMenu
private void addActionListeners() {
this.killMCButton.addActionListener(e -> SwingUtilities.invokeLater(() -> {
if (App.settings.isMinecraftLaunched()) {
int ret = DialogManager.yesNoDialog().setTitle(Language.INSTANCE.localize("console.kill"))
.setContent(HTMLUtils.centerParagraph(
Language.INSTANCE.localizeWithReplace("console.killsure", "<br/><br/>")))
int ret = DialogManager.yesNoDialog().setTitle(GetText.tr("Kill Minecraft"))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"Are you sure you want to kill the Minecraft process?<br/>Doing so can cause corruption of your saves")))
.setType(DialogManager.ERROR).show();
if (ret == DialogManager.YES_OPTION) {
@ -81,33 +78,17 @@ public final class TrayMenu extends JPopupMenu
this.quitButton.addActionListener(e -> System.exit(0));
}
public void localize() {
this.tcButton.setEnabled(true);
this.onRelocalization();
}
public void setMinecraftLaunched(boolean l) {
this.killMCButton.setEnabled(l);
}
@Override
public void onConsoleClose() {
this.tcButton.setText(Language.INSTANCE.localize("console.show"));
this.tcButton.setText(GetText.tr("Show console"));
}
@Override
public void onConsoleOpen() {
this.tcButton.setText(Language.INSTANCE.localize("console.hide"));
}
@Override
public void onRelocalization() {
this.killMCButton.setText(Language.INSTANCE.localize("console.kill"));
this.quitButton.setText(Language.INSTANCE.localize("common.quit"));
if (App.settings.getConsole().isVisible()) {
this.tcButton.setText(Language.INSTANCE.localize("console.hide"));
} else {
this.tcButton.setText(Language.INSTANCE.localize("console.show"));
}
this.tcButton.setText(GetText.tr("Hide console"));
}
}

View file

@ -30,7 +30,6 @@ import javax.swing.border.TitledBorder;
import com.atlauncher.data.Instance;
import com.atlauncher.data.InstanceV2;
import com.atlauncher.data.Language;
import com.atlauncher.data.curse.CurseFileDependency;
import com.atlauncher.data.curse.CurseMod;
import com.atlauncher.gui.dialogs.CurseModFileSelectorDialog;
@ -38,6 +37,8 @@ import com.atlauncher.network.Analytics;
import com.atlauncher.utils.CurseApi;
import com.atlauncher.utils.OS;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public final class CurseFileDependencyCard extends JPanel {
private CurseFileDependency dependency;
@ -78,8 +79,8 @@ public final class CurseFileDependencyCard extends JPanel {
summaryPanel.setBorder(new EmptyBorder(0, 0, 10, 0));
JPanel buttonsPanel = new JPanel(new FlowLayout());
JButton addButton = new JButton(Language.INSTANCE.localize("common.add"));
JButton viewButton = new JButton(Language.INSTANCE.localize("common.view"));
JButton addButton = new JButton(GetText.tr("Add"));
JButton viewButton = new JButton(GetText.tr("View"));
buttonsPanel.add(addButton);
buttonsPanel.add(viewButton);

View file

@ -30,12 +30,13 @@ import javax.swing.border.TitledBorder;
import com.atlauncher.data.Instance;
import com.atlauncher.data.InstanceV2;
import com.atlauncher.data.Language;
import com.atlauncher.data.curse.CurseMod;
import com.atlauncher.gui.dialogs.CurseModFileSelectorDialog;
import com.atlauncher.network.Analytics;
import com.atlauncher.utils.OS;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public final class CurseModCard extends JPanel {
private Instance instance;
@ -72,8 +73,8 @@ public final class CurseModCard extends JPanel {
summaryPanel.setBorder(new EmptyBorder(0, 0, 10, 0));
JPanel buttonsPanel = new JPanel(new FlowLayout());
JButton addButton = new JButton(Language.INSTANCE.localize("common.add"));
JButton viewButton = new JButton(Language.INSTANCE.localize("common.view"));
JButton addButton = new JButton(GetText.tr("Add"));
JButton viewButton = new JButton(GetText.tr("View"));
buttonsPanel.add(addButton);
buttonsPanel.add(viewButton);

View file

@ -56,7 +56,6 @@ import com.atlauncher.Gsons;
import com.atlauncher.LogManager;
import com.atlauncher.data.APIResponse;
import com.atlauncher.data.Instance;
import com.atlauncher.data.Language;
import com.atlauncher.evnt.listener.RelocalizationListener;
import com.atlauncher.evnt.manager.RelocalizationManager;
import com.atlauncher.gui.components.CollapsiblePanel;
@ -76,6 +75,7 @@ import com.atlauncher.utils.Utils;
import com.atlauncher.utils.ZipNameMapper;
import com.google.gson.reflect.TypeToken;
import org.mini2Dx.gettext.GetText;
import org.zeroturnaround.zip.ZipUtil;
/**
@ -89,17 +89,17 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList
private final JPanel rightPanel = new JPanel();
private final JTextArea descArea = new JTextArea();
private final ImagePanel image;
private final JButton playButton = new JButton(Language.INSTANCE.localize("common.play"));
private final JButton reinstallButton = new JButton(Language.INSTANCE.localize("common.reinstall"));
private final JButton updateButton = new JButton(Language.INSTANCE.localize("common.update"));
private final JButton renameButton = new JButton(Language.INSTANCE.localize("common.rename"));
private final JButton backupButton = new JButton(Language.INSTANCE.localize("common.backup"));
private final JButton cloneButton = new JButton(Language.INSTANCE.localize("instance.clone"));
private final JButton deleteButton = new JButton(Language.INSTANCE.localize("common.delete"));
private final JButton addButton = new JButton(Language.INSTANCE.localize("common.addmods"));
private final JButton editButton = new JButton(Language.INSTANCE.localize("common.editmods"));
private final JButton openButton = new JButton(Language.INSTANCE.localize("common.openfolder"));
private final JButton settingsButton = new JButton(Language.INSTANCE.localize("tabs.settings"));
private final JButton playButton = new JButton(GetText.tr("Play"));
private final JButton reinstallButton = new JButton(GetText.tr("Reinstall"));
private final JButton updateButton = new JButton(GetText.tr("Update"));
private final JButton renameButton = new JButton(GetText.tr("Rename"));
private final JButton backupButton = new JButton(GetText.tr("Backup"));
private final JButton cloneButton = new JButton(GetText.tr("Clone"));
private final JButton deleteButton = new JButton(GetText.tr("Delete"));
private final JButton addButton = new JButton(GetText.tr("Add Mods"));
private final JButton editButton = new JButton(GetText.tr("Edit Mods"));
private final JButton openButton = new JButton(GetText.tr("Open Folder"));
private final JButton settingsButton = new JButton(GetText.tr("Settings"));
public InstanceCard(Instance instance) {
super(instance);
@ -167,24 +167,24 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList
for (ActionListener al : playButton.getActionListeners()) {
playButton.removeActionListener(al);
}
playButton.addActionListener(
e -> DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.corrupt"))
.setContent(Language.INSTANCE.localize("instance.corruptplay")).setType(DialogManager.ERROR)
.show());
playButton.addActionListener(e -> DialogManager.okDialog().setTitle(GetText.tr("Instance Corrupt"))
.setContent(GetText
.tr("Cannot play instance as it's corrupted. Please reinstall, update or delete it."))
.setType(DialogManager.ERROR).show());
for (ActionListener al : backupButton.getActionListeners()) {
backupButton.removeActionListener(al);
}
backupButton.addActionListener(
e -> DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.corrupt"))
.setContent(Language.INSTANCE.localize("instance.corruptbackup"))
.setType(DialogManager.ERROR).show());
backupButton.addActionListener(e -> DialogManager.okDialog().setTitle(GetText.tr("Instance Corrupt"))
.setContent(GetText
.tr("Cannot backup instance as it's corrupted. Please reinstall, update or delete it."))
.setType(DialogManager.ERROR).show());
for (ActionListener al : cloneButton.getActionListeners()) {
cloneButton.removeActionListener(al);
}
cloneButton.addActionListener(
e -> DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.corrupt"))
.setContent(Language.INSTANCE.localize("instance.corruptclone"))
.setType(DialogManager.ERROR).show());
cloneButton.addActionListener(e -> DialogManager.okDialog().setTitle(GetText.tr("Instance Corrupt"))
.setContent(GetText
.tr("Cannot clone instance as it's corrupted. Please reinstall, update or delete it."))
.setType(DialogManager.ERROR).show());
}
}
@ -192,10 +192,10 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList
this.playButton.addActionListener(e -> {
if (!App.settings.ignoreJavaOnInstanceLaunch() && instance.getJava() != null
&& !Java.getMinecraftJavaVersion().equalsIgnoreCase("Unknown") && !instance.getJava().conforms()) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.incorrectjavatitle"))
.setContent(HTMLUtils.centerParagraph(
Language.INSTANCE.localizeWithReplace("instance.incorrectjava", "<br/><br/>")
+ instance.getJava().getVersionString()))
DialogManager.okDialog().setTitle(GetText.tr("Cannot launch instance due to your Java version"))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"There was an issue launching this instance.<br/><br/>This version of the pack requires a Java version which you are not using.<br/><br/>Please install that version of Java and try again.<br/><br/>Java version needed: {0}",
"<br/><br/>", instance.getJava().getVersionString())))
.setType(DialogManager.ERROR).show();
return;
}
@ -203,16 +203,15 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList
if (instance.hasUpdate() && !instance.hasUpdateBeenIgnored(
(instance.isDev() ? instance.getLatestDevHash() : instance.getLatestVersion()))) {
int ret = DialogManager.yesNoDialog().setTitle(Language.INSTANCE.localize("instance.updateavailable"))
.setContent(HTMLUtils.centerParagraph(
Language.INSTANCE.localizeWithReplace("instance.updatenow", "<br/><br/>")))
.addOption(Language.INSTANCE.localize("instance.dontremindmeagain")).setType(DialogManager.INFO)
.show();
int ret = DialogManager.yesNoDialog().setTitle(GetText.tr("Update Available"))
.setContent(HTMLUtils.centerParagraph(GetText
.tr("An update is available for this instance.<br/><br/>Do you want to update now?")))
.addOption(GetText.tr("Don't Remind Me Again")).setType(DialogManager.INFO).show();
if (ret == 0) {
if (App.settings.getAccount() == null) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.noaccountselected"))
.setContent(Language.INSTANCE.localize("instance.cantupdate"))
DialogManager.okDialog().setTitle(GetText.tr("No Account Selected"))
.setContent(GetText.tr("Cannot update pack as you have no account selected."))
.setType(DialogManager.ERROR).show();
} else {
Analytics.sendEvent(instance.getPackName() + " - " + instance.getVersion(), "UpdateFromPlay",
@ -240,9 +239,9 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList
});
this.reinstallButton.addActionListener(e -> {
if (App.settings.getAccount() == null) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.noaccountselected"))
.setContent(Language.INSTANCE.localize("instance.cantreinstall")).setType(DialogManager.ERROR)
.show();
DialogManager.okDialog().setTitle(GetText.tr("No Account Selected"))
.setContent(GetText.tr("Cannot reinstall pack as you have no account selected."))
.setType(DialogManager.ERROR).show();
} else {
Analytics.sendEvent(instance.getPackName() + " - " + instance.getVersion(), "Reinstall", "Instance");
new InstanceInstallerDialog(instance);
@ -250,9 +249,9 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList
});
this.updateButton.addActionListener(e -> {
if (App.settings.getAccount() == null) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.noaccountselected"))
.setContent(Language.INSTANCE.localize("instance.cantupdate")).setType(DialogManager.ERROR)
.show();
DialogManager.okDialog().setTitle(GetText.tr("No Account Selected"))
.setContent(GetText.tr("Cannot update pack as you have no account selected."))
.setType(DialogManager.ERROR).show();
} else {
Analytics.sendEvent(instance.getPackName() + " - " + instance.getVersion(), "Update", "Instance");
new InstanceInstallerDialog(instance, true, false, null, null, true);
@ -261,24 +260,21 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList
this.renameButton.addActionListener(e -> new RenameInstanceDialog(instance));
this.backupButton.addActionListener(e -> {
if (instance.getSavesDirectory().exists()) {
int ret = DialogManager.yesNoDialog()
.setTitle(Language.INSTANCE.localize("backup.backingup", instance.getName()))
.setContent(HTMLUtils
.centerParagraph(Language.INSTANCE.localizeWithReplace("backup.sure", "<br/><br/>")))
int ret = DialogManager.yesNoDialog().setTitle(GetText.tr("Backing Up {0}", instance.getName()))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"Backups saves all your worlds as well as some other files<br/>such as your configs, so you can restore them later.<br/>Once backed up you can find the zip file in the Backups/ folder.<br/>Do you want to backup this instance?")))
.setType(DialogManager.INFO).show();
if (ret == DialogManager.YES_OPTION) {
final JDialog dialog = new JDialog(App.settings.getParent(),
Language.INSTANCE.localizeWithReplace("backup.backingup", instance.getName()),
ModalityType.APPLICATION_MODAL);
GetText.tr("Backing Up {0}", instance.getName()), ModalityType.APPLICATION_MODAL);
dialog.setSize(300, 100);
dialog.setLocationRelativeTo(App.settings.getParent());
dialog.setResizable(false);
JPanel topPanel = new JPanel();
topPanel.setLayout(new BorderLayout());
JLabel doing = new JLabel(
Language.INSTANCE.localizeWithReplace("backup.backingup", instance.getName()));
JLabel doing = new JLabel(GetText.tr("Backing Up {0}", instance.getName()));
doing.setHorizontalAlignment(JLabel.CENTER);
doing.setVerticalAlignment(JLabel.TOP);
topPanel.add(doing);
@ -302,8 +298,9 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList
ZipUtil.pack(instance.getRootDirectory(), FileSystem.BACKUPS.resolve(filename).toFile(),
ZipNameMapper.INSTANCE_BACKUP);
dialog.dispose();
App.TOASTER.pop(
Language.INSTANCE.localizeWithReplace("backup.backupcomplete", " " + "" + filename));
App.TOASTER.pop(GetText.tr(
"Backup is complete. Your backup was saved to the following location:<br/><br/>{0}",
filename));
});
backupThread.start();
dialog.addWindowListener(new WindowAdapter() {
@ -315,8 +312,9 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList
dialog.setVisible(true);
}
} else {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("backup.nosavestitle"))
.setContent(Language.INSTANCE.localize("backup.nosaves")).setType(DialogManager.ERROR).show();
DialogManager.okDialog().setTitle(GetText.tr("No Saves Found"))
.setContent(GetText.tr("Can't backup instance as no saves were found."))
.setType(DialogManager.ERROR).show();
}
});
this.addButton.addActionListener(e -> {
@ -334,8 +332,8 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList
});
this.cloneButton.addActionListener(e -> {
String clonedName = JOptionPane.showInputDialog(App.settings.getParent(),
Language.INSTANCE.localize("instance.cloneenter"),
Language.INSTANCE.localize("instance.clonetitle"), JOptionPane.INFORMATION_MESSAGE);
GetText.tr("Enter a new name for this cloned instance."), GetText.tr("Cloning Instance"),
JOptionPane.INFORMATION_MESSAGE);
if (clonedName != null && clonedName.length() >= 1 && App.settings.getInstanceByName(clonedName) == null
&& App.settings.getInstanceBySafeName(clonedName.replaceAll("[^A-Za-z0-9]", "")) == null
&& clonedName.replaceAll("[^A-Za-z0-9]", "").length() >= 1) {
@ -343,48 +341,44 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList
Analytics.sendEvent(instance.getPackName() + " - " + instance.getVersion(), "Clone", "Instance");
final String newName = clonedName;
final ProgressDialog dialog = new ProgressDialog(Language.INSTANCE.localize("instance.clonetitle"), 0,
Language.INSTANCE.localize("instance.cloninginstance"), null);
final ProgressDialog dialog = new ProgressDialog(GetText.tr("Cloning Instance"), 0,
GetText.tr("Cloning Instance. Please wait..."), null);
dialog.addThread(new Thread(() -> {
App.settings.cloneInstance(instance, newName);
dialog.close();
App.TOASTER.pop(
Language.INSTANCE.localizeWithReplace("instance.clonedsuccessfully", instance.getName()));
App.TOASTER.pop(GetText.tr("Cloned Instance Successfully"));
}));
dialog.start();
} else if (clonedName == null || clonedName.equals("")) {
LogManager.error("Error Occured While Cloning Instance! Dialog Closed/Cancelled!");
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("common.error"))
.setContent(HTMLUtils.centerParagraph(Language.INSTANCE
.localizeWithReplace("instance.errorclone", instance.getName() + "<br/><br/>")))
DialogManager.okDialog().setTitle(GetText.tr("Error")).setContent(HTMLUtils.centerParagraph(GetText.tr(
"An error occurred while cloning the instance.<br/><br/>Please check the console and try again.")))
.setType(DialogManager.ERROR).show();
} else if (clonedName.replaceAll("[^A-Za-z0-9]", "").length() == 0) {
LogManager.error("Error Occured While Cloning Instance! Invalid Name!");
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("common.error"))
.setContent(HTMLUtils.centerParagraph(Language.INSTANCE
.localizeWithReplace("instance.errorclone", instance.getName() + "<br/><br/>")))
DialogManager.okDialog().setTitle(GetText.tr("Error")).setContent(HTMLUtils.centerParagraph(GetText.tr(
"An error occurred while cloning the instance.<br/><br/>Please check the console and try again")))
.setType(DialogManager.ERROR).show();
} else {
LogManager.error("Error Occured While Cloning Instance! Instance With That Name Already Exists!");
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("common.error"))
.setContent(HTMLUtils.centerParagraph(Language.INSTANCE
.localizeWithReplace("instance.errorclone", instance.getName() + "<br/><br/>")))
DialogManager.okDialog().setTitle(GetText.tr("Error")).setContent(HTMLUtils.centerParagraph(GetText.tr(
"An error occurred while cloning the instance.<br/><br/>Please check the console and try again")))
.setType(DialogManager.ERROR).show();
}
});
this.deleteButton.addActionListener(e -> {
int ret = DialogManager.yesNoDialog().setTitle(Language.INSTANCE.localize("instance.deleteinstance"))
.setContent(Language.INSTANCE.localize("instance.deletesure")).setType(DialogManager.ERROR).show();
int ret = DialogManager.yesNoDialog().setTitle(GetText.tr("Delete Instance"))
.setContent(GetText.tr("Are you sure you want to delete this instance?"))
.setType(DialogManager.ERROR).show();
if (ret == DialogManager.YES_OPTION) {
Analytics.sendEvent(instance.getPackName() + " - " + instance.getVersion(), "Delete", "Instance");
final ProgressDialog dialog = new ProgressDialog(Language.INSTANCE.localize("instance.deletetitle"), 0,
Language.INSTANCE.localize("instance.deletinginstance"), null);
final ProgressDialog dialog = new ProgressDialog(GetText.tr("Deleting Instance"), 0,
GetText.tr("Deleting Instance. Please wait..."), null);
dialog.addThread(new Thread(() -> {
App.settings.removeInstance(instance);
dialog.close();
App.TOASTER.pop(
Language.INSTANCE.localizeWithReplace("instance.deletedsuccessfully", instance.getName()));
App.TOASTER.pop(GetText.tr("Deleted Instance Successfully"));
}));
dialog.start();
}
@ -398,18 +392,15 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList
if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() >= 2) {
if (instance.hasUpdate() && !instance.hasUpdateBeenIgnored(instance.getLatestVersion())) {
int ret = DialogManager.yesNoDialog()
.setTitle(Language.INSTANCE.localize("instance.updateavailable"))
.setContent(HTMLUtils.centerParagraph(
Language.INSTANCE.localizeWithReplace("instance.updatenow", "<br/><br/>")))
.addOption(Language.INSTANCE.localize("instance.dontremindmeagain"))
.setType(DialogManager.INFO).show();
int ret = DialogManager.yesNoDialog().setTitle(GetText.tr("Update Available"))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"An update is available for this instance.<br/><br/>Do you want to update now?")))
.addOption(GetText.tr("Don't Remind Me Again")).setType(DialogManager.INFO).show();
if (ret == 0) {
if (App.settings.getAccount() == null) {
DialogManager.okDialog()
.setTitle(Language.INSTANCE.localize("instance.noaccountselected"))
.setContent(Language.INSTANCE.localize("instance.cantupdate"))
DialogManager.okDialog().setTitle(GetText.tr("No Account Selected"))
.setContent(GetText.tr("Cannot update pack as you have no account selected."))
.setType(DialogManager.ERROR).show();
} else {
Analytics.sendEvent(instance.getPackName() + " - " + instance.getVersion(),
@ -440,13 +431,13 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList
} else if (e.getButton() == MouseEvent.BUTTON3) {
JPopupMenu rightClickMenu = new JPopupMenu();
JMenuItem changeImageItem = new JMenuItem(Language.INSTANCE.localize("instance.changeimage"));
JMenuItem changeImageItem = new JMenuItem(GetText.tr("Change Image"));
rightClickMenu.add(changeImageItem);
JMenuItem shareCodeItem = new JMenuItem(Language.INSTANCE.localize("instance.sharecode"));
JMenuItem shareCodeItem = new JMenuItem(GetText.tr("Share Code"));
rightClickMenu.add(shareCodeItem);
JMenuItem updateItem = new JMenuItem(Language.INSTANCE.localize("common.update"));
JMenuItem updateItem = new JMenuItem(GetText.tr("Update"));
rightClickMenu.add(updateItem);
if (!instance.hasUpdate()) {
@ -479,18 +470,16 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList
updateItem.addActionListener(e12 -> {
if (instance.hasUpdate() && !instance.hasUpdateBeenIgnored(instance.getLatestVersion())) {
int ret = DialogManager.yesNoDialog()
.setTitle(Language.INSTANCE.localize("instance.updateavailable"))
.setContent(HTMLUtils.centerParagraph(
Language.INSTANCE.localizeWithReplace("instance.updatenow", "<br/><br/>")))
.addOption(Language.INSTANCE.localize("instance.dontremindmeagain"))
.setType(DialogManager.INFO).show();
int ret = DialogManager.yesNoDialog().setTitle(GetText.tr("Update Available"))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"An update is available for this instance.<br/><br/>Do you want to update now?")))
.addOption(GetText.tr("Don't Remind Me Again")).setType(DialogManager.INFO).show();
if (ret == 0) {
if (App.settings.getAccount() == null) {
DialogManager.okDialog()
.setTitle(Language.INSTANCE.localize("instance.noaccountselected"))
.setContent(Language.INSTANCE.localize("instance.cantupdate"))
DialogManager.okDialog().setTitle(GetText.tr("No Account Selected"))
.setContent(
GetText.tr("Cannot update pack as you have no account selected."))
.setType(DialogManager.ERROR).show();
} else {
Analytics.sendEvent(instance.getPackName() + " - " + instance.getVersion(),
@ -529,20 +518,18 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList
instance.getShareCodeData()), type);
if (response.wasError()) {
App.TOASTER.pop(Language.INSTANCE.localize("instance.nooptionalmods"));
App.TOASTER.pop(GetText.tr("Error getting share code."));
} else {
StringSelection text = new StringSelection(response.getData());
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(text, null);
App.TOASTER.pop(Language.INSTANCE.localize("instance.sharecodecopied"));
App.TOASTER.pop(GetText.tr("Share code copied to clipboard"));
LogManager.info("Share code copied to clipboard");
}
} catch (IOException ex) {
LogManager.logStackTrace("API call failed", ex);
}
} else {
App.TOASTER.pop(Language.INSTANCE.localize("instance.nooptionalmods"));
}
});
}
@ -564,16 +551,16 @@ public class InstanceCard extends CollapsiblePanel implements RelocalizationList
@Override
public void onRelocalization() {
this.playButton.setText(Language.INSTANCE.localize("common.play"));
this.reinstallButton.setText(Language.INSTANCE.localize("common.reinstall"));
this.updateButton.setText(Language.INSTANCE.localize("common.update"));
this.renameButton.setText(Language.INSTANCE.localize("instance.rename"));
this.backupButton.setText(Language.INSTANCE.localize("common.backup"));
this.cloneButton.setText(Language.INSTANCE.localize("instance.clone"));
this.deleteButton.setText(Language.INSTANCE.localize("common.delete"));
this.addButton.setText(Language.INSTANCE.localize("common.addmods"));
this.editButton.setText(Language.INSTANCE.localize("common.editmods"));
this.openButton.setText(Language.INSTANCE.localize("common.openfolder"));
this.settingsButton.setText(Language.INSTANCE.localize("tabs.settings"));
this.playButton.setText(GetText.tr("Play"));
this.reinstallButton.setText(GetText.tr("Reinstall"));
this.updateButton.setText(GetText.tr("Update"));
this.renameButton.setText(GetText.tr("Rename"));
this.backupButton.setText(GetText.tr("Backup"));
this.cloneButton.setText(GetText.tr("Clone"));
this.deleteButton.setText(GetText.tr("Delete"));
this.addButton.setText(GetText.tr("Add Mods"));
this.editButton.setText(GetText.tr("Edit Mods"));
this.openButton.setText(GetText.tr("Open Folder"));
this.settingsButton.setText(GetText.tr("Settings"));
}
}

View file

@ -52,7 +52,6 @@ import com.atlauncher.App;
import com.atlauncher.FileSystem;
import com.atlauncher.LogManager;
import com.atlauncher.data.InstanceV2;
import com.atlauncher.data.Language;
import com.atlauncher.evnt.listener.RelocalizationListener;
import com.atlauncher.evnt.manager.RelocalizationManager;
import com.atlauncher.gui.components.CollapsiblePanel;
@ -71,6 +70,7 @@ import com.atlauncher.utils.OS;
import com.atlauncher.utils.Utils;
import com.atlauncher.utils.ZipNameMapper;
import org.mini2Dx.gettext.GetText;
import org.zeroturnaround.zip.ZipUtil;
/**
@ -84,17 +84,17 @@ public class InstanceV2Card extends CollapsiblePanel implements RelocalizationLi
private final JPanel rightPanel = new JPanel();
private final JTextArea descArea = new JTextArea();
private final ImagePanel image;
private final JButton playButton = new JButton(Language.INSTANCE.localize("common.play"));
private final JButton reinstallButton = new JButton(Language.INSTANCE.localize("common.reinstall"));
private final JButton updateButton = new JButton(Language.INSTANCE.localize("common.update"));
private final JButton renameButton = new JButton(Language.INSTANCE.localize("common.rename"));
private final JButton backupButton = new JButton(Language.INSTANCE.localize("common.backup"));
private final JButton cloneButton = new JButton(Language.INSTANCE.localize("instance.clone"));
private final JButton deleteButton = new JButton(Language.INSTANCE.localize("common.delete"));
private final JButton addButton = new JButton(Language.INSTANCE.localize("common.addmods"));
private final JButton editButton = new JButton(Language.INSTANCE.localize("common.editmods"));
private final JButton openButton = new JButton(Language.INSTANCE.localize("common.openfolder"));
private final JButton settingsButton = new JButton(Language.INSTANCE.localize("tabs.settings"));
private final JButton playButton = new JButton(GetText.tr("Play"));
private final JButton reinstallButton = new JButton(GetText.tr("Reinstall"));
private final JButton updateButton = new JButton(GetText.tr("Update"));
private final JButton renameButton = new JButton(GetText.tr("Rename"));
private final JButton backupButton = new JButton(GetText.tr("Backup"));
private final JButton cloneButton = new JButton(GetText.tr("Clone"));
private final JButton deleteButton = new JButton(GetText.tr("Delete"));
private final JButton addButton = new JButton(GetText.tr("Add Mods"));
private final JButton editButton = new JButton(GetText.tr("Edit Mods"));
private final JButton openButton = new JButton(GetText.tr("Open Folder"));
private final JButton settingsButton = new JButton(GetText.tr("Settings"));
public InstanceV2Card(InstanceV2 instance) {
super(instance);
@ -162,24 +162,24 @@ public class InstanceV2Card extends CollapsiblePanel implements RelocalizationLi
for (ActionListener al : playButton.getActionListeners()) {
playButton.removeActionListener(al);
}
playButton.addActionListener(
e -> DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.corrupt"))
.setContent(Language.INSTANCE.localize("instance.corruptplay")).setType(DialogManager.ERROR)
.show());
playButton.addActionListener(e -> DialogManager.okDialog().setTitle(GetText.tr("Instance Corrupt"))
.setContent(GetText
.tr("Cannot play instance as it's corrupted. Please reinstall, update or delete it."))
.setType(DialogManager.ERROR).show());
for (ActionListener al : backupButton.getActionListeners()) {
backupButton.removeActionListener(al);
}
backupButton.addActionListener(
e -> DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.corrupt"))
.setContent(Language.INSTANCE.localize("instance.corruptbackup"))
.setType(DialogManager.ERROR).show());
backupButton.addActionListener(e -> DialogManager.okDialog().setTitle(GetText.tr("Instance Corrupt"))
.setContent(GetText
.tr("Cannot backup instance as it's corrupted. Please reinstall, update or delete it."))
.setType(DialogManager.ERROR).show());
for (ActionListener al : cloneButton.getActionListeners()) {
cloneButton.removeActionListener(al);
}
cloneButton.addActionListener(
e -> DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.corrupt"))
.setContent(Language.INSTANCE.localize("instance.corruptclone"))
.setType(DialogManager.ERROR).show());
cloneButton.addActionListener(e -> DialogManager.okDialog().setTitle(GetText.tr("Instance Corrupt"))
.setContent(GetText
.tr("Cannot clone instance as it's corrupted. Please reinstall, update or delete it."))
.setType(DialogManager.ERROR).show());
}
}
@ -188,25 +188,24 @@ public class InstanceV2Card extends CollapsiblePanel implements RelocalizationLi
if (!App.settings.ignoreJavaOnInstanceLaunch() && instance.launcher.java != null
&& !Java.getMinecraftJavaVersion().equalsIgnoreCase("Unknown")
&& !instance.launcher.java.conforms()) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.incorrectjavatitle"))
.setContent(HTMLUtils.centerParagraph(
Language.INSTANCE.localizeWithReplace("instance.incorrectjava", "<br/><br/>")
+ instance.launcher.java.getVersionString()))
DialogManager.okDialog().setTitle(GetText.tr("Cannot launch instance due to your Java version"))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"There was an issue launching this instance.<br/><br/>This version of the pack requires a Java version which you are not using.<br/><br/>Please install that version of Java and try again.<br/><br/>Java version needed: {0}",
"<br/><br/>", instance.launcher.java.getVersionString())))
.setType(DialogManager.ERROR).show();
return;
}
if (instance.hasUpdate()) {
int ret = DialogManager.yesNoDialog().setTitle(Language.INSTANCE.localize("instance.updateavailable"))
.setContent(HTMLUtils.centerParagraph(
Language.INSTANCE.localizeWithReplace("instance.updatenow", "<br/><br/>")))
.addOption(Language.INSTANCE.localize("instance.dontremindmeagain")).setType(DialogManager.INFO)
.show();
int ret = DialogManager.yesNoDialog().setTitle(GetText.tr("Update Available"))
.setContent(HTMLUtils.centerParagraph(GetText
.tr("An update is available for this instance.<br/><br/>Do you want to update now?")))
.addOption(GetText.tr("Don't Remind Me Again")).setType(DialogManager.INFO).show();
if (ret == 0) {
if (App.settings.getAccount() == null) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.noaccountselected"))
.setContent(Language.INSTANCE.localize("instance.cantupdate"))
DialogManager.okDialog().setTitle(GetText.tr("No Account Selected"))
.setContent(GetText.tr("Cannot update pack as you have no account selected."))
.setType(DialogManager.ERROR).show();
} else {
Analytics.sendEvent(instance.launcher.pack + " - " + instance.launcher.version,
@ -234,9 +233,9 @@ public class InstanceV2Card extends CollapsiblePanel implements RelocalizationLi
});
this.reinstallButton.addActionListener(e -> {
if (App.settings.getAccount() == null) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.noaccountselected"))
.setContent(Language.INSTANCE.localize("instance.cantreinstall")).setType(DialogManager.ERROR)
.show();
DialogManager.okDialog().setTitle(GetText.tr("No Account Selected"))
.setContent(GetText.tr("Cannot reinstall pack as you have no account selected."))
.setType(DialogManager.ERROR).show();
} else {
Analytics.sendEvent(instance.launcher.pack + " - " + instance.launcher.version, "Reinstall",
"InstanceV2");
@ -245,9 +244,9 @@ public class InstanceV2Card extends CollapsiblePanel implements RelocalizationLi
});
this.updateButton.addActionListener(e -> {
if (App.settings.getAccount() == null) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.noaccountselected"))
.setContent(Language.INSTANCE.localize("instance.cantupdate")).setType(DialogManager.ERROR)
.show();
DialogManager.okDialog().setTitle(GetText.tr("No Account Selected"))
.setContent(GetText.tr("Cannot update pack as you have no account selected."))
.setType(DialogManager.ERROR).show();
} else {
Analytics.sendEvent(instance.launcher.pack + " - " + instance.launcher.version, "Update", "InstanceV2");
new InstanceInstallerDialog(instance, true, false, null, null, true);
@ -259,24 +258,21 @@ public class InstanceV2Card extends CollapsiblePanel implements RelocalizationLi
});
this.backupButton.addActionListener(e -> {
if (Files.isDirectory(instance.getRoot().resolve("saves"))) {
int ret = DialogManager.yesNoDialog()
.setTitle(Language.INSTANCE.localize("backup.backingup", instance.launcher.name))
.setContent(HTMLUtils
.centerParagraph(Language.INSTANCE.localizeWithReplace("backup.sure", "<br/><br/>")))
int ret = DialogManager.yesNoDialog().setTitle(GetText.tr("Backing Up {0}", instance.launcher.name))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"Backups saves all your worlds as well as some other files<br/>such as your configs, so you can restore them later.<br/>Once backed up you can find the zip file in the Backups/ folder.<br/>Do you want to backup this instance?")))
.setType(DialogManager.INFO).show();
if (ret == DialogManager.YES_OPTION) {
final JDialog dialog = new JDialog(App.settings.getParent(),
Language.INSTANCE.localizeWithReplace("backup.backingup", instance.launcher.name),
ModalityType.APPLICATION_MODAL);
GetText.tr("Backing Up {0}", instance.launcher.name), ModalityType.APPLICATION_MODAL);
dialog.setSize(300, 100);
dialog.setLocationRelativeTo(App.settings.getParent());
dialog.setResizable(false);
JPanel topPanel = new JPanel();
topPanel.setLayout(new BorderLayout());
JLabel doing = new JLabel(
Language.INSTANCE.localizeWithReplace("backup.backingup", instance.launcher.name));
JLabel doing = new JLabel(GetText.tr("Backing Up {0}", instance.launcher.name));
doing.setHorizontalAlignment(JLabel.CENTER);
doing.setVerticalAlignment(JLabel.TOP);
topPanel.add(doing);
@ -301,8 +297,9 @@ public class InstanceV2Card extends CollapsiblePanel implements RelocalizationLi
ZipUtil.pack(instance.getRoot().toFile(), FileSystem.BACKUPS.resolve(filename).toFile(),
ZipNameMapper.INSTANCE_BACKUP);
dialog.dispose();
App.TOASTER.pop(
Language.INSTANCE.localizeWithReplace("backup.backupcomplete", " " + "" + filename));
App.TOASTER.pop(GetText.tr(
"Backup is complete. Your backup was saved to the following location:<br/><br/>{0}",
filename));
});
backupThread.start();
dialog.addWindowListener(new WindowAdapter() {
@ -314,8 +311,8 @@ public class InstanceV2Card extends CollapsiblePanel implements RelocalizationLi
dialog.setVisible(true);
}
} else {
DialogManager.okDialog().setType(DialogManager.WARNING).setTitle("No saves found")
.setContent("No saves were found for this instance").show();
DialogManager.okDialog().setType(DialogManager.WARNING).setTitle(GetText.tr("No saves found"))
.setContent(GetText.tr("No saves were found for this instance")).show();
}
});
this.addButton.addActionListener(e -> {
@ -333,56 +330,52 @@ public class InstanceV2Card extends CollapsiblePanel implements RelocalizationLi
});
this.cloneButton.addActionListener(e -> {
String clonedName = JOptionPane.showInputDialog(App.settings.getParent(),
Language.INSTANCE.localize("instance.cloneenter"),
Language.INSTANCE.localize("instance.clonetitle"), JOptionPane.INFORMATION_MESSAGE);
GetText.tr("Enter a new name for this cloned instance."), GetText.tr("Cloning Instance"),
JOptionPane.INFORMATION_MESSAGE);
if (clonedName != null && clonedName.length() >= 1 && App.settings.getInstanceByName(clonedName) == null
&& App.settings.getInstanceBySafeName(clonedName.replaceAll("[^A-Za-z0-9]", "")) == null
&& clonedName.replaceAll("[^A-Za-z0-9]", "").length() >= 1) {
Analytics.sendEvent(instance.launcher.pack + " - " + instance.launcher.version, "Clone", "InstanceV2");
final String newName = clonedName;
final ProgressDialog dialog = new ProgressDialog(Language.INSTANCE.localize("instance.clonetitle"), 0,
Language.INSTANCE.localize("instance.cloninginstance"), null);
final ProgressDialog dialog = new ProgressDialog(GetText.tr("Cloning Instance"), 0,
GetText.tr("Cloning Instance. Please wait..."), null);
dialog.addThread(new Thread(() -> {
App.settings.cloneInstance(instance, newName);
dialog.close();
App.TOASTER.pop(Language.INSTANCE.localizeWithReplace("instance.clonedsuccessfully",
instance.launcher.name));
App.TOASTER.pop(GetText.tr("Cloned Instance Successfully"));
}));
dialog.start();
} else if (clonedName == null || clonedName.equals("")) {
LogManager.error("Error Occured While Cloning Instance! Dialog Closed/Cancelled!");
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("common.error"))
.setContent(HTMLUtils.centerParagraph(Language.INSTANCE
.localizeWithReplace("instance.errorclone", instance.launcher.name + "<br/><br/>")))
DialogManager.okDialog().setTitle(GetText.tr("Error")).setContent(HTMLUtils.centerParagraph(GetText.tr(
"An error occurred while cloning the instance.<br/><br/>Please check the console and try again.")))
.setType(DialogManager.ERROR).show();
} else if (clonedName.replaceAll("[^A-Za-z0-9]", "").length() == 0) {
LogManager.error("Error Occured While Cloning Instance! Invalid Name!");
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("common.error"))
.setContent(HTMLUtils.centerParagraph(Language.INSTANCE
.localizeWithReplace("instance.errorclone", instance.launcher.name + "<br/><br/>")))
DialogManager.okDialog().setTitle(GetText.tr("Error")).setContent(HTMLUtils.centerParagraph(GetText.tr(
"An error occurred while cloning the instance.<br/><br/>Please check the console and try again")))
.setType(DialogManager.ERROR).show();
} else {
LogManager.error("Error Occured While Cloning Instance! Instance With That Name Already Exists!");
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("common.error"))
.setContent(HTMLUtils.centerParagraph(Language.INSTANCE
.localizeWithReplace("instance.errorclone", instance.launcher.name + "<br/><br/>")))
DialogManager.okDialog().setTitle(GetText.tr("Error")).setContent(HTMLUtils.centerParagraph(GetText.tr(
"An error occurred while cloning the instance.<br/><br/>Please check the console and try again")))
.setType(DialogManager.ERROR).show();
}
});
this.deleteButton.addActionListener(e -> {
int ret = DialogManager.yesNoDialog().setTitle(Language.INSTANCE.localize("instance.deleteinstance"))
.setContent(Language.INSTANCE.localize("instance.deletesure")).setType(DialogManager.ERROR).show();
int ret = DialogManager.yesNoDialog().setTitle(GetText.tr("Delete Instance"))
.setContent(GetText.tr("Are you sure you want to delete this instance?"))
.setType(DialogManager.ERROR).show();
if (ret == DialogManager.YES_OPTION) {
Analytics.sendEvent(instance.launcher.pack + " - " + instance.launcher.version, "Delete", "InstanceV2");
final ProgressDialog dialog = new ProgressDialog(Language.INSTANCE.localize("instance.deletetitle"), 0,
Language.INSTANCE.localize("instance.deletinginstance"), null);
final ProgressDialog dialog = new ProgressDialog(GetText.tr("Deleting Instance"), 0,
GetText.tr("Deleting Instance. Please wait..."), null);
dialog.addThread(new Thread(() -> {
App.settings.removeInstance(instance);
dialog.close();
App.TOASTER.pop(Language.INSTANCE.localizeWithReplace("instance.deletedsuccessfully",
instance.launcher.name));
App.TOASTER.pop(GetText.tr("Deleted Instance Successfully"));
}));
dialog.start();
}
@ -397,18 +390,15 @@ public class InstanceV2Card extends CollapsiblePanel implements RelocalizationLi
if (instance.hasUpdate()
&& !instance.hasUpdateBeenIgnored(instance.launcher.isDev ? instance.getLatestVersion().hash
: instance.getLatestVersion().version)) {
int ret = DialogManager.yesNoDialog()
.setTitle(Language.INSTANCE.localize("instance.updateavailable"))
.setContent(HTMLUtils.centerParagraph(
Language.INSTANCE.localizeWithReplace("instance.updatenow", "<br/><br/>")))
.addOption(Language.INSTANCE.localize("instance.dontremindmeagain"))
.setType(DialogManager.INFO).show();
int ret = DialogManager.yesNoDialog().setTitle(GetText.tr("Update Available"))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"An update is available for this instance.<br/><br/>Do you want to update now?")))
.addOption(GetText.tr("Don't Remind Me Again")).setType(DialogManager.INFO).show();
if (ret == 0) {
if (App.settings.getAccount() == null) {
DialogManager.okDialog()
.setTitle(Language.INSTANCE.localize("instance.noaccountselected"))
.setContent(Language.INSTANCE.localize("instance.cantupdate"))
DialogManager.okDialog().setTitle(GetText.tr("No Account Selected"))
.setContent(GetText.tr("Cannot update pack as you have no account selected."))
.setType(DialogManager.ERROR).show();
} else {
Analytics.sendEvent(instance.launcher.pack + " - " + instance.launcher.version,
@ -439,10 +429,10 @@ public class InstanceV2Card extends CollapsiblePanel implements RelocalizationLi
} else if (e.getButton() == MouseEvent.BUTTON3) {
JPopupMenu rightClickMenu = new JPopupMenu();
JMenuItem changeImageItem = new JMenuItem(Language.INSTANCE.localize("instance.changeimage"));
JMenuItem changeImageItem = new JMenuItem(GetText.tr("Change Image"));
rightClickMenu.add(changeImageItem);
JMenuItem updateItem = new JMenuItem(Language.INSTANCE.localize("common.update"));
JMenuItem updateItem = new JMenuItem(GetText.tr("Update"));
rightClickMenu.add(updateItem);
if (!instance.hasUpdate()) {
@ -477,18 +467,16 @@ public class InstanceV2Card extends CollapsiblePanel implements RelocalizationLi
if (instance.hasUpdate() && !instance
.hasUpdateBeenIgnored(instance.launcher.isDev ? instance.getLatestVersion().hash
: instance.getLatestVersion().version)) {
int ret = DialogManager.yesNoDialog()
.setTitle(Language.INSTANCE.localize("instance.updateavailable"))
.setContent(HTMLUtils.centerParagraph(
Language.INSTANCE.localizeWithReplace("instance.updatenow", "<br/><br/>")))
.addOption(Language.INSTANCE.localize("instance.dontremindmeagain"))
.setType(DialogManager.INFO).show();
int ret = DialogManager.yesNoDialog().setTitle(GetText.tr("Update Available"))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"An update is available for this instance.<br/><br/>Do you want to update now?")))
.addOption(GetText.tr("Don't Remind Me Again")).setType(DialogManager.INFO).show();
if (ret == 0) {
if (App.settings.getAccount() == null) {
DialogManager.okDialog()
.setTitle(Language.INSTANCE.localize("instance.noaccountselected"))
.setContent(Language.INSTANCE.localize("instance.cantupdate"))
DialogManager.okDialog().setTitle(GetText.tr("No Account Selected"))
.setContent(
GetText.tr("Cannot update pack as you have no account selected."))
.setType(DialogManager.ERROR).show();
} else {
Analytics.sendEvent(instance.launcher.pack + " - " + instance.launcher.version,
@ -530,16 +518,16 @@ public class InstanceV2Card extends CollapsiblePanel implements RelocalizationLi
@Override
public void onRelocalization() {
this.playButton.setText(Language.INSTANCE.localize("common.play"));
this.reinstallButton.setText(Language.INSTANCE.localize("common.reinstall"));
this.updateButton.setText(Language.INSTANCE.localize("common.update"));
this.renameButton.setText(Language.INSTANCE.localize("instance.rename"));
this.backupButton.setText(Language.INSTANCE.localize("common.backup"));
this.cloneButton.setText(Language.INSTANCE.localize("instance.clone"));
this.deleteButton.setText(Language.INSTANCE.localize("common.delete"));
this.addButton.setText(Language.INSTANCE.localize("common.addmods"));
this.editButton.setText(Language.INSTANCE.localize("common.editmods"));
this.openButton.setText(Language.INSTANCE.localize("common.openfolder"));
this.settingsButton.setText(Language.INSTANCE.localize("tabs.settings"));
this.playButton.setText(GetText.tr("Play"));
this.reinstallButton.setText(GetText.tr("Reinstall"));
this.updateButton.setText(GetText.tr("Update"));
this.renameButton.setText(GetText.tr("Rename"));
this.backupButton.setText(GetText.tr("Backup"));
this.cloneButton.setText(GetText.tr("Clone"));
this.deleteButton.setText(GetText.tr("Delete"));
this.addButton.setText(GetText.tr("Add Mods"));
this.editButton.setText(GetText.tr("Edit Mods"));
this.openButton.setText(GetText.tr("Open Folder"));
this.settingsButton.setText(GetText.tr("Settings"));
}
}

View file

@ -29,13 +29,14 @@ import javax.swing.JTextArea;
import javax.swing.border.TitledBorder;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import com.atlauncher.evnt.listener.RelocalizationListener;
import com.atlauncher.evnt.manager.RelocalizationManager;
import com.atlauncher.gui.components.ImagePanel;
import com.atlauncher.utils.OS;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
/**
* Class for displaying packs in the Pack Tab.
*/
@ -52,11 +53,11 @@ public class NilCard extends JPanel implements RelocalizationListener {
RelocalizationManager.addListener(this);
if (OS.isMac()) {
this.setBorder(new TitledBorder(null, Language.INSTANCE.localize("common.nothingtoshow"),
this.setBorder(new TitledBorder(null, GetText.tr("Nothing To Show"),
TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION,
new Font("SansSerif", Font.BOLD, 14)));
} else {
this.setBorder(new TitledBorder(null, Language.INSTANCE.localize("common.nothingtoshow"),
this.setBorder(new TitledBorder(null, GetText.tr("Nothing To Show"),
TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION,
new Font("SansSerif", Font.BOLD, 15)));
}
@ -82,6 +83,6 @@ public class NilCard extends JPanel implements RelocalizationListener {
@Override
public void onRelocalization() {
TitledBorder border = (TitledBorder) this.getBorder();
border.setTitle(Language.INSTANCE.localize("common.nothingtoshow"));
border.setTitle(GetText.tr("Nothing To Show"));
}
}

View file

@ -28,7 +28,6 @@ import javax.swing.JSplitPane;
import javax.swing.JTextArea;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import com.atlauncher.data.Pack;
import com.atlauncher.evnt.listener.RelocalizationListener;
import com.atlauncher.evnt.manager.RelocalizationManager;
@ -40,6 +39,8 @@ import com.atlauncher.managers.DialogManager;
import com.atlauncher.network.Analytics;
import com.atlauncher.utils.OS;
import org.mini2Dx.gettext.GetText;
/**
* Class for displaying packs in the Pack Tab
*
@ -48,13 +49,13 @@ import com.atlauncher.utils.OS;
public class PackCard extends CollapsiblePanel implements RelocalizationListener {
private static final long serialVersionUID = -2617283435728223314L;
private final JTextArea descArea = new JTextArea();
private final JButton newInstanceButton = new JButton(Language.INSTANCE.localize("common.newinstance"));
private final JButton createServerButton = new JButton(Language.INSTANCE.localize("common.createserver"));
private final JButton newInstanceButton = new JButton(GetText.tr("New Instance"));
private final JButton createServerButton = new JButton(GetText.tr("Create Server"));
private final JButton discordInviteButton = new JButton("Discord");
private final JButton supportButton = new JButton(Language.INSTANCE.localize("common.support"));
private final JButton websiteButton = new JButton(Language.INSTANCE.localize("common.website"));
private final JButton modsButton = new JButton(Language.INSTANCE.localize("pack.viewmods"));
private final JButton removePackButton = new JButton(Language.INSTANCE.localize("pack.removepack"));
private final JButton supportButton = new JButton(GetText.tr("Support"));
private final JButton websiteButton = new JButton(GetText.tr("Website"));
private final JButton modsButton = new JButton(GetText.tr("View Mods"));
private final JButton removePackButton = new JButton(GetText.tr("Remove"));
private final JPanel actionsPanel = new JPanel(new BorderLayout());
private final JSplitPane splitter = new JSplitPane();
private final Pack pack;
@ -125,13 +126,13 @@ public class PackCard extends CollapsiblePanel implements RelocalizationListener
private void addActionListeners() {
this.newInstanceButton.addActionListener(e -> {
if (App.settings.isInOfflineMode()) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("common.offline"))
.setContent(Language.INSTANCE.localize("pack.offlinenewinstance")).setType(DialogManager.ERROR)
.show();
DialogManager.okDialog().setTitle(GetText.tr("You're In Offline Mode")).setContent(GetText.tr(
"Cannot create new instance as you're in offline mode. Please connect to the internet and try again."))
.setType(DialogManager.ERROR).show();
} else {
if (App.settings.getAccount() == null) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.noaccountselected"))
.setContent(Language.INSTANCE.localize("instance.cannotcreate"))
DialogManager.okDialog().setTitle(GetText.tr("No Account Selected"))
.setContent(GetText.tr("Cannot create instance as you have no account selected."))
.setType(DialogManager.ERROR).show();
} else {
Analytics.sendEvent(pack.getName(), "Install", "Pack");
@ -142,13 +143,13 @@ public class PackCard extends CollapsiblePanel implements RelocalizationListener
this.createServerButton.addActionListener(e -> {
if (App.settings.isInOfflineMode()) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("common.offline"))
.setContent(Language.INSTANCE.localize("pack.offlinecreateserver")).setType(DialogManager.ERROR)
.show();
DialogManager.okDialog().setTitle(GetText.tr("You're In Offline Mode")).setContent(GetText.tr(
"Cannot create server as you're in offline mode. Please connect to the internet and try again."))
.setType(DialogManager.ERROR).show();
} else {
if (App.settings.getAccount() == null) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("instance.noaccountselected"))
.setContent(Language.INSTANCE.localize("instance.cannotcreate"))
DialogManager.okDialog().setTitle(GetText.tr("No Account Selected"))
.setContent(GetText.tr("Cannot create instance as you have no account selected."))
.setType(DialogManager.ERROR).show();
} else {
Analytics.sendEvent(pack.getName(), "ServerInstall", "Pack");
@ -176,11 +177,11 @@ public class PackCard extends CollapsiblePanel implements RelocalizationListener
@Override
public void onRelocalization() {
this.newInstanceButton.setText(Language.INSTANCE.localize("common.newinstance"));
this.createServerButton.setText(Language.INSTANCE.localize("common.createserver"));
this.supportButton.setText(Language.INSTANCE.localize("common.support"));
this.websiteButton.setText(Language.INSTANCE.localize("common.website"));
this.modsButton.setText(Language.INSTANCE.localize("pack.viewmods"));
this.removePackButton.setText(Language.INSTANCE.localize("pack.removepack"));
this.newInstanceButton.setText(GetText.tr("New Instance"));
this.createServerButton.setText(GetText.tr("Create Server"));
this.supportButton.setText(GetText.tr("Support"));
this.websiteButton.setText(GetText.tr("Website"));
this.modsButton.setText(GetText.tr("View Mods"));
this.removePackButton.setText(GetText.tr("Remove"));
}
}

View file

@ -24,13 +24,11 @@ import javax.swing.JButton;
import javax.swing.JPanel;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
public abstract class AbstractToolPanel extends JPanel {
/**
* Auto generated serial.
*/
private static final long serialVersionUID = -7755529465856056647L;
protected final Font BOLD_FONT = new Font(App.THEME.getDefaultFont().getFontName(), Font.BOLD, App.THEME
@ -39,7 +37,7 @@ public abstract class AbstractToolPanel extends JPanel {
protected final JPanel MIDDLE_PANEL = new JPanel();
protected final JPanel BOTTOM_PANEL = new JPanel();
protected final JButton LAUNCH_BUTTON = new JButton(Language.INSTANCE.localize("tools.launch"));
protected final JButton LAUNCH_BUTTON = new JButton(GetText.tr("Launch"));
public AbstractToolPanel() {
setLayout(new BorderLayout());

View file

@ -30,7 +30,6 @@ import javax.swing.JPanel;
import com.atlauncher.App;
import com.atlauncher.LogManager;
import com.atlauncher.data.Constants;
import com.atlauncher.data.Language;
import com.atlauncher.evnt.listener.RelocalizationListener;
import com.atlauncher.evnt.manager.RelocalizationManager;
import com.atlauncher.managers.DialogManager;
@ -38,6 +37,8 @@ import com.atlauncher.network.Analytics;
import com.atlauncher.thread.PasteUpload;
import com.atlauncher.utils.HTMLUtils;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public class ConsoleBottomBar extends BottomBar implements RelocalizationListener {
@ -103,9 +104,9 @@ public class ConsoleBottomBar extends BottomBar implements RelocalizationListene
}
});
killMinecraftButton.addActionListener(arg0 -> {
int ret = DialogManager.yesNoDialog().setTitle(Language.INSTANCE.localize("console.kill"))
.setContent(HTMLUtils
.centerParagraph(Language.INSTANCE.localizeWithReplace("console.killsure", "<br/><br/>")))
int ret = DialogManager.yesNoDialog().setTitle(GetText.tr("Kill Minecraft") + "?")
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"Are you sure you want to kill the Minecraft process?<br/><br/>Doing so can cause corruption of your saves.")))
.setType(DialogManager.QUESTION).show();
if (ret == DialogManager.YES_OPTION) {
Analytics.sendEvent("KillMinecraft", "Launcher");
@ -129,9 +130,9 @@ public class ConsoleBottomBar extends BottomBar implements RelocalizationListene
@Override
public void onRelocalization() {
clearButton.setText(Language.INSTANCE.localize("console.clear"));
copyLogButton.setText(Language.INSTANCE.localize("console.copy"));
uploadLogButton.setText(Language.INSTANCE.localize("console.upload"));
killMinecraftButton.setText(Language.INSTANCE.localize("console.kill"));
clearButton.setText(GetText.tr("Clear"));
copyLogButton.setText(GetText.tr("Copy Log"));
uploadLogButton.setText(GetText.tr("Upload Log"));
killMinecraftButton.setText(GetText.tr("Kill Minecraft"));
}
}

View file

@ -34,7 +34,6 @@ import javax.swing.border.Border;
import com.atlauncher.App;
import com.atlauncher.FileSystem;
import com.atlauncher.data.Account;
import com.atlauncher.data.Language;
import com.atlauncher.data.Status;
import com.atlauncher.evnt.listener.RelocalizationListener;
import com.atlauncher.evnt.manager.ConsoleCloseManager;
@ -47,6 +46,8 @@ import com.atlauncher.network.Analytics;
import com.atlauncher.utils.OS;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public class LauncherBottomBar extends BottomBar implements RelocalizationListener {
private JPanel leftSide;
@ -98,8 +99,8 @@ public class LauncherBottomBar extends BottomBar implements RelocalizationListen
toggleConsole.addActionListener(e -> App.settings.getConsole().setVisible(!App.settings.isConsoleVisible()));
openFolder.addActionListener(e -> OS.openFileExplorer(FileSystem.BASE_DIR));
updateData.addActionListener(e -> {
final ProgressDialog dialog = new ProgressDialog(Language.INSTANCE.localize("common.checkingforupdates"), 0,
Language.INSTANCE.localize("common.checkingforupdates"), "Aborting" + " Update Check!");
final ProgressDialog dialog = new ProgressDialog(GetText.tr("Checking For Updated"), 0,
GetText.tr("Checking For Updates"), "Aborting Update Check!");
dialog.addThread(new Thread(() -> {
Analytics.sendEvent("UpdateData", "Launcher");
if (App.settings.checkForUpdatedFiles()) {
@ -117,8 +118,8 @@ public class LauncherBottomBar extends BottomBar implements RelocalizationListen
}
}
});
ConsoleCloseManager.addListener(() -> toggleConsole.setText(Language.INSTANCE.localize("console.show")));
ConsoleOpenManager.addListener(() -> toggleConsole.setText(Language.INSTANCE.localize("console.hide")));
ConsoleCloseManager.addListener(() -> toggleConsole.setText(GetText.tr("Show")));
ConsoleOpenManager.addListener(() -> toggleConsole.setText(GetText.tr("Hide")));
}
/**
@ -126,17 +127,17 @@ public class LauncherBottomBar extends BottomBar implements RelocalizationListen
*/
private void createButtons() {
if (App.settings.isConsoleVisible()) {
toggleConsole = new JButton(Language.INSTANCE.localize("console.hide"));
toggleConsole = new JButton(GetText.tr("Hide"));
} else {
toggleConsole = new JButton(Language.INSTANCE.localize("console.show"));
toggleConsole = new JButton(GetText.tr("Show"));
}
openFolder = new JButton(Language.INSTANCE.localize("common.openfolder"));
updateData = new JButton(Language.INSTANCE.localize("common.updatedata"));
openFolder = new JButton(GetText.tr("Open Folder"));
updateData = new JButton(GetText.tr("Update Data"));
username = new JComboBox<>();
username.setRenderer(new AccountsDropDownRenderer());
fillerAccount = new Account(Language.INSTANCE.localize("account.select"));
fillerAccount = new Account(GetText.tr("Select An Account"));
username.addItem(fillerAccount);
for (Account account : App.settings.getAccounts()) {
username.addItem(account);
@ -157,7 +158,7 @@ public class LauncherBottomBar extends BottomBar implements RelocalizationListen
}
};
statusIcon.setBorder(BorderFactory.createEmptyBorder());
statusIcon.setToolTipText(Language.INSTANCE.localize("status.minecraft.checking"));
statusIcon.setToolTipText(GetText.tr("Checking Minecraft server status..."));
}
/**
@ -168,19 +169,19 @@ public class LauncherBottomBar extends BottomBar implements RelocalizationListen
public void updateStatus(Status status) {
switch (status) {
case UNKNOWN:
statusIcon.setToolTipText(Language.INSTANCE.localize("status.minecraft.checking"));
statusIcon.setToolTipText(GetText.tr("Checking Minecraft server status..."));
statusIcon.setIcon(Utils.getIconImage("/assets/image/StatusWhite.png"));
break;
case ONLINE:
statusIcon.setToolTipText(Language.INSTANCE.localize("status.minecraft.online"));
statusIcon.setToolTipText(GetText.tr("All Minecraft servers are up!"));
statusIcon.setIcon(Utils.getIconImage("/assets/image/StatusGreen.png"));
break;
case OFFLINE:
statusIcon.setToolTipText(Language.INSTANCE.localize("status.minecraft.offline"));
statusIcon.setToolTipText(GetText.tr("Minecraft servers are down!"));
statusIcon.setIcon(Utils.getIconImage("/assets/image/StatusRed.png"));
break;
case PARTIAL:
statusIcon.setToolTipText(Language.INSTANCE.localize("status.minecraft.partial"));
statusIcon.setToolTipText(GetText.tr("Some Minecraft servers are down!"));
statusIcon.setIcon(Utils.getIconImage("/assets/image/StatusYellow.png"));
break;
default:
@ -206,12 +207,12 @@ public class LauncherBottomBar extends BottomBar implements RelocalizationListen
@Override
public void onRelocalization() {
if (App.settings.getConsole().isVisible()) {
toggleConsole.setText(Language.INSTANCE.localize("console.hide"));
toggleConsole.setText(GetText.tr("Hide"));
} else {
toggleConsole.setText(Language.INSTANCE.localize("console.show"));
toggleConsole.setText(GetText.tr("Show"));
}
this.updateData.setText(Language.INSTANCE.localize("common.updatedata"));
this.openFolder.setText(Language.INSTANCE.localize("common.openfolder"));
this.fillerAccount.setMinecraftUsername(Language.INSTANCE.localize("account.select"));
this.updateData.setText(GetText.tr("Update Data"));
this.openFolder.setText(GetText.tr("Open Folder"));
this.fillerAccount.setMinecraftUsername(GetText.tr("Select An Account"));
}
}

View file

@ -26,23 +26,24 @@ import javax.swing.JLabel;
import javax.swing.border.BevelBorder;
import com.atlauncher.FileSystem;
import com.atlauncher.data.Language;
import com.atlauncher.managers.DialogManager;
import com.atlauncher.network.Analytics;
import com.atlauncher.thread.LoggingThread;
import com.atlauncher.utils.HTMLUtils;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
public class LogClearerToolPanel extends AbstractToolPanel implements ActionListener {
/**
* Auto generated serial.
*/
private static final long serialVersionUID = 1964636496849129267L;
private final JLabel TITLE_LABEL = new JLabel(Language.INSTANCE.localize("tools.logclearer"));
private final JLabel TITLE_LABEL = new JLabel(GetText.tr("Log Clearer"));
private final JLabel INFO_LABEL = new JLabel(HTMLUtils.centerParagraph(
Utils.splitMultilinedString(Language.INSTANCE.localize("tools.logclearer.info"), 60, "<br>")));
Utils.splitMultilinedString(GetText.tr("This tool clears out all logs created by the launcher (not included those made by instances) to free up space and old junk."), 60, "<br>")));
public LogClearerToolPanel() {
TITLE_LABEL.setFont(BOLD_FONT);
@ -66,8 +67,8 @@ public class LogClearerToolPanel extends AbstractToolPanel implements ActionList
Utils.delete(file);
}
DialogManager.okDialog().setType(DialogManager.INFO).setTitle(Language.INSTANCE.localize("common.success"))
.setContent(Language.INSTANCE.localize("tools.logclearer.success")).show();
DialogManager.okDialog().setType(DialogManager.INFO).setTitle(GetText.tr("Success"))
.setContent(GetText.tr("Successfully cleared the logs.")).show();
}
}
}

View file

@ -29,7 +29,6 @@ import com.atlauncher.App;
import com.atlauncher.FileSystem;
import com.atlauncher.LogManager;
import com.atlauncher.data.Constants;
import com.atlauncher.data.Language;
import com.atlauncher.evnt.listener.SettingsListener;
import com.atlauncher.evnt.manager.SettingsManager;
import com.atlauncher.gui.dialogs.ProgressDialog;
@ -39,16 +38,16 @@ import com.atlauncher.network.Download;
import com.atlauncher.utils.HTMLUtils;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
public class NetworkCheckerToolPanel extends AbstractToolPanel implements ActionListener, SettingsListener {
/**
* Auto generated serial.
*/
private static final long serialVersionUID = 4811953376698111667L;
private final JLabel TITLE_LABEL = new JLabel(Language.INSTANCE.localize("tools.networkchecker"));
private final JLabel TITLE_LABEL = new JLabel(GetText.tr("Network Checker"));
private final JLabel INFO_LABEL = new JLabel(HTMLUtils.centerParagraph(
Utils.splitMultilinedString(Language.INSTANCE.localize("tools.networkchecker.info"), 60, "<br>")));
private final JLabel INFO_LABEL = new JLabel(HTMLUtils.centerParagraph(Utils.splitMultilinedString(GetText.tr(
"This tool does various tests on your network and determines any issues that may pop up with connecting to our file servers and to other servers."),
60, "<br>")));
public NetworkCheckerToolPanel() {
TITLE_LABEL.setFont(BOLD_FONT);
@ -69,15 +68,15 @@ public class NetworkCheckerToolPanel extends AbstractToolPanel implements Action
public void actionPerformed(ActionEvent e) {
Analytics.sendEvent("NetworkChecker", "Run", "Tool");
int ret = DialogManager.yesNoDialog().setTitle(Language.INSTANCE.localize("tools.networkchecker"))
.setContent(HTMLUtils.centerParagraph(Utils.splitMultilinedString(
Language.INSTANCE.localizeWithReplace("tools.networkcheckerpopup", "20 MB.<br/><br/>"), 75,
"<br>")))
int ret = DialogManager.yesNoDialog().setTitle(GetText.tr("Network Checker"))
.setContent(HTMLUtils.centerParagraph(Utils.splitMultilinedString(GetText.tr(
"Please note that the data from this tool is sent to ATLauncher so we can diagnose possible issues in your setup. This test may take up to 10 minutes or longer to complete and you will be unable to do anything while it's running. Please also keep in mind that this test will use some of your bandwidth, it will use approximately 20MB.<br/><br/>Do you wish to continue?"),
75, "<br>")))
.setType(DialogManager.INFO).show();
if (ret == 0) {
final ProgressDialog dialog = new ProgressDialog(Language.INSTANCE.localize("tools.networkchecker"), 5,
Language.INSTANCE.localize("tools.networkchecker.running"), "Network Checker Tool Cancelled!");
final ProgressDialog dialog = new ProgressDialog(GetText.tr("Network Checker"), 5,
GetText.tr("Network Checker Running. Please Wait!"), "Network Checker Tool Cancelled!");
dialog.addThread(new Thread(() -> {
StringBuilder results = new StringBuilder();
@ -157,9 +156,8 @@ public class NetworkCheckerToolPanel extends AbstractToolPanel implements Action
} else {
LogManager.info("Network Test ran and submitted to " + Constants.LAUNCHER_NAME + "!");
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("tools.networkchecker"))
.setContent(HTMLUtils.centerParagraph(
Language.INSTANCE.localizeWithReplace("tools.networkheckercomplete", "<br/><br/>")))
DialogManager.okDialog().setTitle(GetText.tr("Network Checker"))
.setContent(HTMLUtils.centerParagraph(GetText.tr("tools.networkheckercomplete", "<br/><br/>")))
.setType(DialogManager.INFO).show();
}
}

View file

@ -26,9 +26,10 @@ import java.awt.Image;
import javax.swing.JPanel;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import com.atlauncher.data.Pack;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public final class PackImagePanel extends JPanel {
private final Image image;
@ -51,17 +52,17 @@ public final class PackImagePanel extends JPanel {
Color colour;
if (this.pack.getVersionCount() == 0) {
text = Language.INSTANCE.localize("pack.dev");
text = GetText.tr("Dev");
colour = Color.lightGray;
} else {
if (this.pack.isPrivate()) {
text = Language.INSTANCE.localize("pack.private");
text = GetText.tr("Private");
colour = Color.red;
} else if (this.pack.isPublic()) {
text = Language.INSTANCE.localize("pack.public");
text = GetText.tr("Public");
colour = Color.green;
} else {
text = Language.INSTANCE.localize("pack.semipublic");
text = GetText.tr("Semi Public");
colour = Color.cyan;
}
}

View file

@ -25,18 +25,19 @@ import javax.swing.JLabel;
import javax.swing.border.BevelBorder;
import com.atlauncher.LogManager;
import com.atlauncher.data.Language;
import com.atlauncher.network.Analytics;
import com.atlauncher.utils.HTMLUtils;
import com.atlauncher.utils.OS;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public class RelaunchInDebugModePanel extends AbstractToolPanel implements ActionListener {
private final JLabel TITLE_LABEL = new JLabel(Language.INSTANCE.localize("tools.launchindebugmode"));
private final JLabel TITLE_LABEL = new JLabel(GetText.tr("Launch in debug mode"));
private final JLabel INFO_LABEL = new JLabel(HTMLUtils.centerParagraph(
Utils.splitMultilinedString(Language.INSTANCE.localize("tools.launchindebugmode.info"), 60, "<br>")));
Utils.splitMultilinedString(GetText.tr("Use this to relaunch ATLauncher in debug mode. This can be used to get more debug logs in order to help diagnose issues with ATLauncher."), 60, "<br>")));
public RelaunchInDebugModePanel() {
TITLE_LABEL.setFont(BOLD_FONT);

View file

@ -31,7 +31,6 @@ import com.atlauncher.FileSystem;
import com.atlauncher.LogManager;
import com.atlauncher.Network;
import com.atlauncher.data.Constants;
import com.atlauncher.data.Language;
import com.atlauncher.data.Runtime;
import com.atlauncher.data.Runtimes;
import com.atlauncher.gui.dialogs.ProgressDialog;
@ -42,6 +41,7 @@ import com.atlauncher.utils.HTMLUtils;
import com.atlauncher.utils.OS;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
import org.zeroturnaround.zip.ZipUtil;
import okhttp3.OkHttpClient;
@ -49,10 +49,12 @@ import okhttp3.OkHttpClient;
public class RuntimeDownloaderToolPanel extends AbstractToolPanel implements ActionListener {
private static final long serialVersionUID = -2690200209156149465L;
private final JLabel TITLE_LABEL = new JLabel(Language.INSTANCE.localize("tools.runtimedownloader"));
private final JLabel TITLE_LABEL = new JLabel(GetText.tr("Runtime Downloader"));
private final JLabel INFO_LABEL = new JLabel(HTMLUtils.centerParagraph(
Utils.splitMultilinedString(Language.INSTANCE.localize("tools.runtimedownloader.info"), 60, "<br>")));
private final JLabel INFO_LABEL = new JLabel(HTMLUtils.centerParagraph(Utils.splitMultilinedString(
GetText.tr(
"Use this to automatically install and use a recommended version of Java to use with ATLauncher."),
60, "<br>")));
public RuntimeDownloaderToolPanel() {
TITLE_LABEL.setFont(BOLD_FONT);
@ -72,8 +74,8 @@ public class RuntimeDownloaderToolPanel extends AbstractToolPanel implements Act
public void actionPerformed(ActionEvent e) {
Analytics.sendEvent("RuntimeDownloader", "Run", "Tool");
final ProgressDialog dialog = new ProgressDialog(Language.INSTANCE.localize("tools.runtimedownloader"), 3,
Language.INSTANCE.localize("tools.runtimedownloader.running"), "Runtime Downloader Tool Cancelled!");
final ProgressDialog dialog = new ProgressDialog(GetText.tr("Runtime Downloader"), 3,
GetText.tr("Downloading. Please Wait!"), "Runtime Downloader Tool Cancelled!");
dialog.addThread(new Thread(() -> {
Runtimes runtimes = Download.build().cached()
@ -108,7 +110,7 @@ public class RuntimeDownloaderToolPanel extends AbstractToolPanel implements Act
.downloadTo(downloadFile.toPath());
if (download.needToDownload()) {
dialog.setLabel(Language.INSTANCE.localize("common.downloading"));
dialog.setLabel(GetText.tr("Downloading"));
dialog.setTotalBytes(runtime.size);
try {
@ -123,7 +125,7 @@ public class RuntimeDownloaderToolPanel extends AbstractToolPanel implements Act
dialog.doneTask();
dialog.setLabel(Language.INSTANCE.localize("common.extracting"));
dialog.setLabel(GetText.tr("Extracting"));
try {
Utils.unXZFile(downloadFile, unpackedFile);
@ -145,8 +147,9 @@ public class RuntimeDownloaderToolPanel extends AbstractToolPanel implements Act
if (dialog.getReturnValue() == null) {
LogManager.error("Runtime downloaded failed to run!");
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("tools.runtimedownloader"))
.setContent(HTMLUtils.centerParagraph(Language.INSTANCE.localize("tools.runtimedownloader.error")))
DialogManager.okDialog().setTitle(GetText.tr("Runtime Downloader"))
.setContent(HTMLUtils.centerParagraph(
GetText.tr("An error occurred downloading the runtime. Please check the logs.")))
.setType(DialogManager.ERROR).show();
} else {
LogManager.info("Runtime downloaded!");
@ -156,9 +159,9 @@ public class RuntimeDownloaderToolPanel extends AbstractToolPanel implements Act
App.settings.setJavaPath(path);
App.settings.saveProperties();
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("tools.runtimedownloader"))
.setContent(
HTMLUtils.centerParagraph(Language.INSTANCE.localize("tools.runtimedownloader.complete")))
DialogManager.okDialog().setTitle(GetText.tr("Runtime Downloader"))
.setContent(HTMLUtils.centerParagraph(
GetText.tr("The recommended version of Java has been installed and set to be used.")))
.setType(DialogManager.INFO).show();
}
}

View file

@ -25,7 +25,6 @@ import javax.swing.JLabel;
import javax.swing.border.BevelBorder;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import com.atlauncher.evnt.listener.SettingsListener;
import com.atlauncher.evnt.manager.SettingsManager;
import com.atlauncher.gui.dialogs.ServerListForCheckerDialog;
@ -33,16 +32,16 @@ import com.atlauncher.network.Analytics;
import com.atlauncher.utils.HTMLUtils;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
public class ServerCheckerToolPanel extends AbstractToolPanel implements ActionListener, SettingsListener {
/**
* Auto generated serial.
*/
private static final long serialVersionUID = 1964636496849129267L;
private final JLabel TITLE_LABEL = new JLabel(Language.INSTANCE.localize("tools.serverchecker"));
private final JLabel TITLE_LABEL = new JLabel(GetText.tr("Server Checker"));
private final JLabel INFO_LABEL = new JLabel(HTMLUtils.centerParagraph(
Utils.splitMultilinedString(Language.INSTANCE.localize("tools.serverchecker.info"), 60, "<br>")));
private final JLabel INFO_LABEL = new JLabel(HTMLUtils.centerParagraph(Utils.splitMultilinedString(GetText.tr(
"This tool checks specified Minecraft servers to see if they are up or not and how many players are logged in. Settings can be configured in the Settings tab under the Tools sub tab."),
60, "<br>")));
public ServerCheckerToolPanel() {
TITLE_LABEL.setFont(BOLD_FONT);

View file

@ -32,12 +32,13 @@ import javax.swing.JPanel;
import javax.swing.JTextField;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import com.atlauncher.data.MinecraftServer;
import com.atlauncher.managers.DialogManager;
import com.atlauncher.utils.MCQuery;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
import de.zh32.pingtest.QueryVersion;
public class AddEditServerForCheckerDialog extends JDialog implements ActionListener {
@ -63,7 +64,7 @@ public class AddEditServerForCheckerDialog extends JDialog implements ActionList
private MinecraftServer serverEditing = null;
public AddEditServerForCheckerDialog(MinecraftServer minecraftServer) {
super(null, Language.INSTANCE.localize((minecraftServer == null ? "tools.addserver" : "tools.editserver")),
super(null, (minecraftServer == null ? GetText.tr("Add Server") : GetText.tr("Edit Server")),
ModalityType.APPLICATION_MODAL);
setSize(300, 200);
setLocationRelativeTo(null);
@ -76,7 +77,7 @@ public class AddEditServerForCheckerDialog extends JDialog implements ActionList
if (minecraftServer != null) {
this.serverEditing = minecraftServer;
addEditButton.setText(Language.INSTANCE.localize("common.edit"));
addEditButton.setText(GetText.tr("Edit"));
serverName.setText(minecraftServer.getName());
serverHost.setText(minecraftServer.getHost());
serverPort.setText(minecraftServer.getPort() + "");
@ -96,7 +97,7 @@ public class AddEditServerForCheckerDialog extends JDialog implements ActionList
gbc.gridx = 0;
gbc.gridy = 0;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
serverNameLabel = new JLabel(Language.INSTANCE.localize("tools.serverchecker.name") + ": ");
serverNameLabel = new JLabel(GetText.tr("Name") + ": ");
middle.add(serverNameLabel, gbc);
gbc.gridx++;
@ -109,7 +110,7 @@ public class AddEditServerForCheckerDialog extends JDialog implements ActionList
gbc.gridx = 0;
gbc.gridy++;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
serverHostLabel = new JLabel(Language.INSTANCE.localize("tools.serverchecker.ip") + ": ");
serverHostLabel = new JLabel(GetText.tr("Host/IP") + ": ");
middle.add(serverHostLabel, gbc);
gbc.gridx++;
@ -122,7 +123,7 @@ public class AddEditServerForCheckerDialog extends JDialog implements ActionList
gbc.gridx = 0;
gbc.gridy++;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
serverPortLabel = new JLabel(Language.INSTANCE.localize("tools.serverchecker.port") + ": ");
serverPortLabel = new JLabel(GetText.tr("Port") + ": ");
middle.add(serverPortLabel, gbc);
gbc.gridx++;
@ -135,11 +136,11 @@ public class AddEditServerForCheckerDialog extends JDialog implements ActionList
bottom = new JPanel();
bottom.setLayout(new FlowLayout());
addEditButton = new JButton(Language.INSTANCE.localize("common.add"));
addEditButton = new JButton(GetText.tr("Add"));
addEditButton.addActionListener(this);
bottom.add(addEditButton);
closeButton = new JButton(Language.INSTANCE.localize("common.close"));
closeButton = new JButton(GetText.tr("Close"));
closeButton.addActionListener(this);
bottom.add(closeButton);
@ -156,12 +157,12 @@ public class AddEditServerForCheckerDialog extends JDialog implements ActionList
public void actionPerformed(ActionEvent e) {
if (e.getSource() == addEditButton) {
if (serverName.getText().isEmpty() || serverHost.getText().isEmpty() || serverPort.getText().isEmpty()) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("common.error"))
.setContent(Language.INSTANCE.localize("tools.serverchecker.notallfields"))
DialogManager.okDialog().setTitle(GetText.tr("Error"))
.setContent(GetText.tr("Not all fields were filled in. Please go back and fill them in!"))
.setType(DialogManager.ERROR).show();
} else if (!isValidPort()) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("common.error"))
.setContent(Language.INSTANCE.localize("settings.proxyportinvalid"))
DialogManager.okDialog().setTitle(GetText.tr("Error"))
.setContent(GetText.tr("The port you specified is invalid. Please check it and try again."))
.setType(DialogManager.ERROR).show();
} else {
String name = serverName.getText();
@ -169,9 +170,8 @@ public class AddEditServerForCheckerDialog extends JDialog implements ActionList
final int port = Integer.parseInt(serverPort.getText().replaceAll("[^0-9]", ""));
QueryVersion qv = null;
final ProgressDialog dialog = new ProgressDialog(
Language.INSTANCE.localize("tools.serverchecker.checkingserver"), 0,
Language.INSTANCE.localize("tools.serverchecker.checkingserver"), "Cancelled Server Check!");
final ProgressDialog dialog = new ProgressDialog(GetText.tr("Checking Server"), 0,
GetText.tr("Checking Server"), "Cancelled Server Check!");
dialog.addThread(new Thread(() -> {
dialog.setReturnValue(MCQuery.getMinecraftServerQueryVersion(host, port));
dialog.close();
@ -183,13 +183,12 @@ public class AddEditServerForCheckerDialog extends JDialog implements ActionList
}
if (qv == null) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("common.error"))
.setContent(Language.INSTANCE.localize("tools.serverchecker.couldntconnect"))
DialogManager.okDialog().setTitle(GetText.tr("Error")).setContent(GetText.tr(
"Couldn't connect to server. All servers must be online and successfully checked once before adding."))
.setType(DialogManager.ERROR).show();
} else {
App.TOASTER.pop(
Language.INSTANCE.localize((this.serverEditing == null ? "tools.serverchecker.serveradded"
: "tools.serverchecker.serveredited")));
(this.serverEditing == null ? GetText.tr("Server Added") : GetText.tr("Server Edited")));
if (this.serverEditing == null) {
App.settings.addCheckingServer(new MinecraftServer(name, host, port, qv));
} else {

View file

@ -36,7 +36,6 @@ import com.atlauncher.App;
import com.atlauncher.data.Constants;
import com.atlauncher.data.Instance;
import com.atlauncher.data.InstanceV2;
import com.atlauncher.data.Language;
import com.atlauncher.data.curse.CurseMod;
import com.atlauncher.gui.card.CurseModCard;
import com.atlauncher.gui.panels.LoadingPanel;
@ -44,6 +43,8 @@ import com.atlauncher.gui.panels.NoCurseModsPanel;
import com.atlauncher.network.Analytics;
import com.atlauncher.utils.CurseApi;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public final class AddModsDialog extends JDialog {
private Instance instance;
@ -52,7 +53,7 @@ public final class AddModsDialog extends JDialog {
private JPanel contentPanel = new JPanel(new GridLayout(Constants.CURSE_PAGINATION_SIZE / 2, 2));
private JPanel topPanel = new JPanel(new BorderLayout());
private JTextField searchField = new JTextField(16);
private JButton searchButton = new JButton(Language.INSTANCE.localize("common.search"));
private JButton searchButton = new JButton(GetText.tr("Search"));
private JButton installFabricApiButton = new JButton("Install Fabric API");
private JScrollPane jscrollPane;
private JButton nextButton;
@ -61,8 +62,8 @@ public final class AddModsDialog extends JDialog {
private int page = 0;
public AddModsDialog(Instance instance) {
super(App.settings.getParent(),
Language.INSTANCE.localizeWithReplace("instance.addingmods", instance.getName()),
// #. {0} is the name of the mod we're installing
super(App.settings.getParent(), GetText.tr("Adding Mods For {0}", instance.getName()),
ModalityType.APPLICATION_MODAL);
this.instance = instance;
@ -80,8 +81,8 @@ public final class AddModsDialog extends JDialog {
}
public AddModsDialog(InstanceV2 instanceV2) {
super(App.settings.getParent(),
Language.INSTANCE.localizeWithReplace("instance.addingmods", instanceV2.launcher.name),
// #. {0} is the name of the mod we're installing
super(App.settings.getParent(), GetText.tr("Adding Mods For {0}", instanceV2.launcher.name),
ModalityType.APPLICATION_MODAL);
this.instanceV2 = instanceV2;
@ -101,7 +102,7 @@ public final class AddModsDialog extends JDialog {
private void setupComponents() {
JPanel searchButtonsPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
searchButtonsPanel.add(new JLabel(Language.INSTANCE.localize("common.search") + ": "));
searchButtonsPanel.add(new JLabel(GetText.tr("Search") + ": "));
searchButtonsPanel.add(this.searchField);
searchButtonsPanel.add(this.searchButton);

View file

@ -32,10 +32,11 @@ import javax.swing.JPanel;
import javax.swing.JTextField;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import com.atlauncher.managers.DialogManager;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public class AddPackDialog extends JDialog {
private JPanel top;
@ -48,7 +49,7 @@ public class AddPackDialog extends JDialog {
private JButton saveButton;
public AddPackDialog() {
super(null, Language.INSTANCE.localize("pack.addpack"), ModalityType.APPLICATION_MODAL);
super(null, GetText.tr("Add Pack"), ModalityType.APPLICATION_MODAL);
setSize(350, 150);
setLocationRelativeTo(null);
setLayout(new BorderLayout());
@ -58,7 +59,7 @@ public class AddPackDialog extends JDialog {
// Top Panel Stuff
top = new JPanel();
top.add(new JLabel(Language.INSTANCE.localize("pack.addpack")));
top.add(new JLabel(GetText.tr("Add Pack")));
// Middle Panel Stuff
middle = new JPanel();
@ -68,7 +69,7 @@ public class AddPackDialog extends JDialog {
gbc.gridx = 0;
gbc.gridy = 0;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
packCodeLabel = new JLabel(Language.INSTANCE.localize("pack.packcode") + ": ");
packCodeLabel = new JLabel(GetText.tr("Pack Code") + ": ");
middle.add(packCodeLabel, gbc);
gbc.gridx++;
@ -79,26 +80,21 @@ public class AddPackDialog extends JDialog {
// Bottom Panel Stuff
bottom = new JPanel();
bottom.setLayout(new FlowLayout());
saveButton = new JButton(Language.INSTANCE.localize("common.save"));
saveButton = new JButton(GetText.tr("Save"));
saveButton.addActionListener(e -> {
if (App.settings.semiPublicPackExistsFromCode(packCode.getText())) {
if (App.settings.addPack(packCode.getText())) {
DialogManager.okDialog().setParent(AddPackDialog.this)
.setTitle(Language.INSTANCE.localize("pack.packadded"))
.setContent(Language.INSTANCE.localize("pack.packaddedmessage"))
.setType(DialogManager.ERROR).show();
DialogManager.okDialog().setParent(AddPackDialog.this).setTitle(GetText.tr("Pack Added"))
.setContent(GetText.tr("The pack has been added!")).setType(DialogManager.ERROR).show();
} else {
DialogManager.okDialog().setParent(AddPackDialog.this)
.setTitle(Language.INSTANCE.localize("pack.packalreadyadded"))
.setContent(Language.INSTANCE.localize("pack.packalreadyaddedmessage"))
.setType(DialogManager.ERROR).show();
DialogManager.okDialog().setParent(AddPackDialog.this).setTitle(GetText.tr("Pack Already Added"))
.setContent(GetText.tr("The pack was already added!")).setType(DialogManager.ERROR).show();
}
setVisible(false);
dispose();
} else {
DialogManager.okDialog().setParent(AddPackDialog.this)
.setTitle(Language.INSTANCE.localize("pack.packaddederror"))
.setContent(Language.INSTANCE.localize("pack.packdoesntexist")).setType(DialogManager.ERROR)
DialogManager.okDialog().setParent(AddPackDialog.this).setTitle(GetText.tr("Error Adding Pack"))
.setContent(GetText.tr("A pack with that code doesn't exist!")).setType(DialogManager.ERROR)
.show();
}
});

View file

@ -38,7 +38,6 @@ import javax.swing.JScrollPane;
import com.atlauncher.App;
import com.atlauncher.data.Instance;
import com.atlauncher.data.InstanceV2;
import com.atlauncher.data.Language;
import com.atlauncher.data.curse.CurseFile;
import com.atlauncher.data.curse.CurseFileDependency;
import com.atlauncher.data.curse.CurseMod;
@ -48,6 +47,8 @@ import com.atlauncher.network.Analytics;
import com.atlauncher.utils.CurseApi;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
public class CurseModFileSelectorDialog extends JDialog {
private static final long serialVersionUID = -6984886874482721558L;
private int filesLength = 0;
@ -81,7 +82,8 @@ public class CurseModFileSelectorDialog extends JDialog {
}
private void setupComponents() {
setTitle(Language.INSTANCE.localize("common.installing") + " " + mod.name);
// #. {0} is the name of the mod we're installing
setTitle(GetText.tr("Installing {0}", mod.name));
setSize(500, 200);
setLocationRelativeTo(App.settings.getParent());
@ -89,15 +91,17 @@ public class CurseModFileSelectorDialog extends JDialog {
setResizable(false);
this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
addButton = new JButton(Language.INSTANCE.localize("common.add"));
addButton = new JButton(GetText.tr("Add"));
addButton.setEnabled(false);
dependenciesPanel.setVisible(false);
dependenciesPanel.setBorder(BorderFactory.createTitledBorder("The below mods need to be installed"));
dependenciesPanel
.setBorder(BorderFactory.createTitledBorder(GetText.tr("The below mods need to be installed")));
// Top Panel Stuff
JPanel top = new JPanel();
top.add(new JLabel(Language.INSTANCE.localize("common.installing") + " " + mod.name));
// #. {0} is the name of the mod we're installing
top.add(new JLabel(GetText.tr("Installing {0}", mod.name)));
// Middle Panel Stuff
JPanel middle = new JPanel(new BorderLayout());
@ -106,7 +110,7 @@ public class CurseModFileSelectorDialog extends JDialog {
filesPanel = new JPanel(new FlowLayout());
filesPanel.setBorder(BorderFactory.createEmptyBorder(20, 0, 0, 0));
versionsLabel = new JLabel(Language.INSTANCE.localize("instance.versiontoinstall") + ": ");
versionsLabel = new JLabel(GetText.tr("Version To Install") + ": ");
filesPanel.add(versionsLabel);
filesDropdown = new JComboBox<>();
@ -130,8 +134,8 @@ public class CurseModFileSelectorDialog extends JDialog {
addButton.addActionListener(e -> {
CurseFile file = (CurseFile) filesDropdown.getSelectedItem();
final JDialog dialog = new JDialog(this,
Language.INSTANCE.localize("common.installing") + " " + file.displayName,
// #. {0} is the name of the mod we're installing
final JDialog dialog = new JDialog(this, GetText.tr("Installing {0}", file.displayName),
ModalityType.DOCUMENT_MODAL);
dialog.setLocationRelativeTo(this);
@ -140,7 +144,8 @@ public class CurseModFileSelectorDialog extends JDialog {
JPanel topPanel = new JPanel();
topPanel.setLayout(new BorderLayout());
final JLabel doing = new JLabel(Language.INSTANCE.localize("common.installing") + " " + file.displayName);
// #. {0} is the name of the mod we're installing
final JLabel doing = new JLabel(GetText.tr("Installing {0}", file.displayName));
doing.setHorizontalAlignment(JLabel.CENTER);
doing.setVerticalAlignment(JLabel.TOP);
topPanel.add(doing);
@ -216,7 +221,7 @@ public class CurseModFileSelectorDialog extends JDialog {
}
});
JButton cancel = new JButton(Language.INSTANCE.localize("common.cancel"));
JButton cancel = new JButton(GetText.tr("Cancel"));
cancel.addActionListener(e -> dispose());
bottom.add(addButton);
bottom.add(cancel);

View file

@ -39,11 +39,12 @@ import com.atlauncher.LogManager;
import com.atlauncher.data.DisableableMod;
import com.atlauncher.data.Instance;
import com.atlauncher.data.InstanceV2;
import com.atlauncher.data.Language;
import com.atlauncher.exceptions.InvalidMinecraftVersion;
import com.atlauncher.gui.components.ModsJCheckBox;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
public class EditModsDialog extends JDialog {
private static final long serialVersionUID = 7004414192679481818L;
@ -59,8 +60,8 @@ public class EditModsDialog extends JDialog {
public EditModsDialog(Instance instance) {
super(App.settings.getParent(),
Language.INSTANCE.localizeWithReplace("instance.editingmods", instance.getName()),
ModalityType.APPLICATION_MODAL);
// #. {0} is the name of the instance
GetText.tr("Editing Mods For {0}", instance.getName()), ModalityType.APPLICATION_MODAL);
this.instance = instance;
setSize(550, 450);
setLocationRelativeTo(App.settings.getParent());
@ -83,8 +84,8 @@ public class EditModsDialog extends JDialog {
public EditModsDialog(InstanceV2 instanceV2) {
super(App.settings.getParent(),
Language.INSTANCE.localizeWithReplace("instance.editingmods", instanceV2.launcher.name),
ModalityType.APPLICATION_MODAL);
// #. {0} is the name of the instance
GetText.tr("Editing Mods For {0}", instanceV2.launcher.name), ModalityType.APPLICATION_MODAL);
this.instanceV2 = instanceV2;
setSize(550, 450);
setLocationRelativeTo(App.settings.getParent());
@ -125,11 +126,11 @@ public class EditModsDialog extends JDialog {
labels.setEnabled(false);
split.setRightComponent(labels);
topLabelLeft = new JLabel(Language.INSTANCE.localize("instance.enabledmods"));
topLabelLeft = new JLabel(GetText.tr("Enabled Mods"));
topLabelLeft.setHorizontalAlignment(SwingConstants.CENTER);
labels.setLeftComponent(topLabelLeft);
topLabelRight = new JLabel(Language.INSTANCE.localize("instance.disabledmods"));
topLabelRight = new JLabel(GetText.tr("Disabled Mods"));
topLabelRight.setHorizontalAlignment(SwingConstants.CENTER);
labels.setRightComponent(topLabelRight);
@ -163,7 +164,7 @@ public class EditModsDialog extends JDialog {
bottomPanel = new JPanel();
add(bottomPanel, BorderLayout.SOUTH);
addButton = new JButton(Language.INSTANCE.localize("instance.addmod"));
addButton = new JButton(GetText.tr("Add Mods"));
addButton.addActionListener(e -> {
if (instanceV2 != null ? instanceV2.launcher.enableCurseIntegration
: this.instance.hasEnabledCurseIntegration()) {
@ -182,9 +183,8 @@ public class EditModsDialog extends JDialog {
boolean usesCoreMods = false;
try {
usesCoreMods = App.settings
.getMinecraftVersion(instanceV2 != null ? instanceV2.id : this.instance.getMinecraftVersion())
.coremods;
usesCoreMods = App.settings.getMinecraftVersion(
instanceV2 != null ? instanceV2.id : this.instance.getMinecraftVersion()).coremods;
} catch (InvalidMinecraftVersion e1) {
LogManager.logStackTrace(e1);
}
@ -196,10 +196,8 @@ public class EditModsDialog extends JDialog {
modTypes = new String[] { "Mods Folder", "Inside Minecraft.jar", "Resource Pack", "Shader Pack" };
}
FileChooserDialog fcd = new FileChooserDialog(Language.INSTANCE.localize("instance.addmod"),
Language.INSTANCE.localize("common.mod"), Language.INSTANCE.localize("common.add"),
Language.INSTANCE.localize("instance.typeofmod"), modTypes,
new String[] { "jar", "zip", "litemod" });
FileChooserDialog fcd = new FileChooserDialog(GetText.tr("Add Mods"), GetText.tr("Mod"), GetText.tr("Add"),
GetText.tr("Type Of Mod"), modTypes, new String[] { "jar", "zip", "litemod" });
ArrayList<File> files = fcd.getChosenFiles();
if (files != null && !files.isEmpty()) {
boolean reload = false;
@ -243,19 +241,19 @@ public class EditModsDialog extends JDialog {
});
bottomPanel.add(addButton);
enableButton = new JButton(Language.INSTANCE.localize("instance.enablemod"));
enableButton = new JButton(GetText.tr("Enable Mod"));
enableButton.addActionListener(e -> enableMods());
bottomPanel.add(enableButton);
disableButton = new JButton(Language.INSTANCE.localize("instance.disablemod"));
disableButton = new JButton(GetText.tr("Disable Mod"));
disableButton.addActionListener(e -> disableMods());
bottomPanel.add(disableButton);
removeButton = new JButton(Language.INSTANCE.localize("instance.removemod"));
removeButton = new JButton(GetText.tr("Remove Mod"));
removeButton.addActionListener(e -> removeMods());
bottomPanel.add(removeButton);
closeButton = new JButton(Language.INSTANCE.localize("common.close"));
closeButton = new JButton(GetText.tr("Close"));
closeButton.addActionListener(e -> dispose());
bottomPanel.add(closeButton);
}

View file

@ -37,9 +37,10 @@ import javax.swing.JTextField;
import javax.swing.filechooser.FileFilter;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public class FileChooserDialog extends JDialog {
private JPanel top;
@ -92,7 +93,7 @@ public class FileChooserDialog extends JDialog {
gbc.gridx++;
gbc.anchor = GridBagConstraints.BASELINE_LEADING;
selectButton = new JButton(Language.INSTANCE.localize("common.select"));
selectButton = new JButton(GetText.tr("Select"));
selectButton.addActionListener(e -> {
JFileChooser fileChooser = new JFileChooser(App.settings.getBaseDir());
fileChooser.setMultiSelectionEnabled(true);

View file

@ -49,7 +49,6 @@ import com.atlauncher.Gsons;
import com.atlauncher.LogManager;
import com.atlauncher.data.Instance;
import com.atlauncher.data.InstanceV2;
import com.atlauncher.data.Language;
import com.atlauncher.data.Pack;
import com.atlauncher.data.PackVersion;
import com.atlauncher.data.json.Version;
@ -59,6 +58,8 @@ import com.atlauncher.utils.HTMLUtils;
import com.atlauncher.utils.Utils;
import com.atlauncher.workers.InstanceInstaller;
import org.mini2Dx.gettext.GetText;
public class InstanceInstallerDialog extends JDialog {
private static final long serialVersionUID = -6984886874482721558L;
private int versionLength = 0;
@ -110,22 +111,25 @@ public class InstanceInstallerDialog extends JDialog {
if (object instanceof Pack) {
pack = (Pack) object;
setTitle(Language.INSTANCE.localize("common.installing") + " " + pack.getName());
// #. {0} is the name of the pack the user is installing
setTitle(GetText.tr("Installing {0}", pack.getName()));
if (isServer) {
setTitle(Language.INSTANCE.localize("common.installing") + " " + pack.getName() + " "
+ Language.INSTANCE.localize("common.server"));
// #. {0} is the name of the pack the user is installing
setTitle(GetText.tr("Installing {0} Server", pack.getName()));
this.isServer = true;
}
} else if (object instanceof Instance) {
instance = (Instance) object;
pack = instance.getRealPack();
isReinstall = true; // We're reinstalling
setTitle(Language.INSTANCE.localize("common.reinstalling") + " " + instance.getName());
// #. {0} is the name of the pack the user is reinstalling
setTitle(GetText.tr("Reinstalling {0}", instance.getName()));
} else {
instanceV2 = (InstanceV2) object;
pack = instanceV2.getPack();
isReinstall = true; // We're reinstalling
setTitle(Language.INSTANCE.localize("common.reinstalling") + " " + instanceV2.launcher.name);
// #. {0} is the name of the pack the user is installing
setTitle(GetText.tr("Reinstalling {0}", instanceV2.launcher.name));
}
setSize(400, 225);
setLocationRelativeTo(App.settings.getParent());
@ -133,15 +137,13 @@ public class InstanceInstallerDialog extends JDialog {
setResizable(false);
this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
install = new JButton(((isReinstall)
? (isUpdate ? Language.INSTANCE.localize("common.update")
: Language.INSTANCE.localize("common.reinstall"))
: Language.INSTANCE.localize("common.install")));
install = new JButton(((isReinstall) ? (isUpdate ? GetText.tr("Update") : GetText.tr("common.reinstall"))
: GetText.tr("common.install")));
// Top Panel Stuff
top = new JPanel();
top.add(new JLabel(((isReinstall) ? Language.INSTANCE.localize("common.reinstalling")
: Language.INSTANCE.localize("common.installing")) + " " + pack.getName()));
top.add(new JLabel(
((isReinstall) ? GetText.tr("Reinstalling") : GetText.tr("Installing")) + " " + pack.getName()));
// Middle Panel Stuff
middle = new JPanel();
@ -152,7 +154,7 @@ public class InstanceInstallerDialog extends JDialog {
gbc.gridy = 0;
if (!this.isServer) {
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
instanceNameLabel = new JLabel(Language.INSTANCE.localize("instance.name") + ": ");
instanceNameLabel = new JLabel(GetText.tr("Name") + ": ");
middle.add(instanceNameLabel, gbc);
gbc.gridx++;
@ -193,7 +195,7 @@ public class InstanceInstallerDialog extends JDialog {
gbc.gridx = 0;
gbc.gridy++;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
enableUserLockLabel = new JLabel(Language.INSTANCE.localize("instance.enableuserlock") + "? ");
enableUserLockLabel = new JLabel(GetText.tr("Enable User Lock") + "? ");
middle.add(enableUserLockLabel, gbc);
gbc.gridx++;
@ -201,13 +203,10 @@ public class InstanceInstallerDialog extends JDialog {
enableUserLock = new JCheckBox();
enableUserLock.addActionListener(e -> {
if (enableUserLock.isSelected()) {
int ret = DialogManager.optionDialog()
.setTitle(Language.INSTANCE.localize("instance.userlocktitle"))
.setContent(HTMLUtils.centerParagraph(
Language.INSTANCE.localizeWithReplace("instance.userlockhelp", "<br/>")))
.setType(DialogManager.WARNING)
.addOption(Language.INSTANCE.localize("common.yes"), true)
.addOption(Language.INSTANCE.localize("common.no")).show();
int ret = DialogManager.yesNoDialog().setTitle(GetText.tr("Enable User Lock") + "? ")
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"Enabling the user lock setting will lock this instance to only be played<br/>by the person installing this instance (you) and will not show the instance to anyone else.<br/><br/>Are you sure you want to do this?")))
.setType(DialogManager.WARNING).show();
if (ret != 0) {
enableUserLock.setSelected(false);
@ -224,40 +223,37 @@ public class InstanceInstallerDialog extends JDialog {
install.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (!isReinstall && !isServer && App.settings.isInstance(instanceNameField.getText())) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("common.error"))
.setContent(
HTMLUtils.centerParagraph(Language.INSTANCE.localize("common.error") + "<br/><br/>"
+ Language.INSTANCE.localizeWithReplace("instance.alreadyinstance",
instanceNameField.getText() + "<br/><br/>")))
DialogManager.okDialog().setTitle(GetText.tr("Error"))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"An instance already exists with that name.<br/><br/>Rename it and try again.")))
.setType(DialogManager.ERROR).show();
return;
} else if (!isReinstall && !isServer
&& instanceNameField.getText().replaceAll("[^A-Za-z0-9]", "").length() == 0) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("common.error"))
.setContent(
HTMLUtils
.centerParagraph(Language.INSTANCE.localize("common.error") + "<br/><br/>"
+ Language.INSTANCE.localizeWithReplace("instance.invalidname",
instanceNameField.getText())))
DialogManager.okDialog().setTitle(GetText.tr("Error"))
.setContent(HTMLUtils.centerParagraph(GetText
.tr("Instance name is invalid. It must contain at least 1 letter or number.")))
.setType(DialogManager.ERROR).show();
return;
}
final PackVersion version = (PackVersion) versionsDropDown.getSelectedItem();
final JDialog dialog = new JDialog(App.settings.getParent(),
((isReinstall) ? Language.INSTANCE.localize("common.reinstalling")
: Language.INSTANCE.localize("common.installing")) + " " + pack.getName() + " "
+ version.version
+ ((isServer) ? " " + Language.INSTANCE.localize("common.server") : ""),
ModalityType.DOCUMENT_MODAL);
final JDialog dialog = new JDialog(App.settings.getParent(), isReinstall ? (
// #. {0} is the name of the pack the user is installing
isServer ? GetText.tr("Reinstalling {0} Server", pack.getName())
// #. {0} is the name of the pack the user is installing
: GetText.tr("Reinstalling {0}", pack.getName())) : (
// #. {0} is the name of the pack the user is installing
isServer ? GetText.tr("Installing {0} Server", pack.getName())
// #. {0} is the name of the pack the user is installing
: GetText.tr("Installing {0}", pack.getName())), ModalityType.DOCUMENT_MODAL);
dialog.setLocationRelativeTo(App.settings.getParent());
dialog.setSize(300, 100);
dialog.setResizable(false);
JPanel topPanel = new JPanel();
topPanel.setLayout(new BorderLayout());
final JLabel doing = new JLabel(Language.INSTANCE.localizeWithReplace("instance.startingprocess",
((isReinstall) ? Language.INSTANCE.localize("common.reinstall")
: Language.INSTANCE.localize("common.install"))));
final JLabel doing = new JLabel((isReinstall) ? GetText.tr("Starting Reinstall Process")
: GetText.tr("Starting Install Process"));
doing.setHorizontalAlignment(JLabel.CENTER);
doing.setVerticalAlignment(JLabel.TOP);
topPanel.add(doing);
@ -290,16 +286,16 @@ public class InstanceInstallerDialog extends JDialog {
String title;
if (isCancelled()) {
type = DialogManager.ERROR;
text = pack.getName() + " " + version.version + " "
+ Language.INSTANCE.localize("common.wasnt") + " "
+ ((isReinstall) ? Language.INSTANCE.localize("common.reinstalled")
: Language.INSTANCE.localize("common.installed"))
+ "<br/><br/>" + Language.INSTANCE.localize("instance" + ".checkerrorlogs");
title = pack.getName() + " " + version.version + " "
+ Language.INSTANCE.localize("common.not") + " "
+ ((isReinstall) ? Language.INSTANCE.localize("common.reinstalled")
: Language.INSTANCE.localize("common.installed"));
if (isReinstall) {
// #. {0} is the pack name and {1} is the pack version
title = GetText.tr("{0} {1} Not Reinstalled", pack.getName(), version.version);
// #. {0} is the pack name and {1} is the pack version
text = GetText.tr(
"{0} {1} wasn't reinstalled.<br/><br/>Check error logs for more information.",
pack.getName(), version.version);
if (instanceIsCorrupt) {
if (instanceV2 != null) {
instanceV2.launcher.isPlayable = false;
@ -308,8 +304,18 @@ public class InstanceInstallerDialog extends JDialog {
App.settings.setInstanceUnplayable(instance);
}
}
} else {
// #. {0} is the pack name and {1} is the pack version
title = GetText.tr("{0} {1} Not Installed", pack.getName(), version.version);
// #. {0} is the pack name and {1} is the pack version
text = GetText.tr(
"{0} {1} wasn't installed.<br/><br/>Check error logs for more information.",
pack.getName(), version.version);
}
} else {
type = DialogManager.INFO;
try {
success = get();
} catch (InterruptedException ignored) {
@ -318,19 +324,27 @@ public class InstanceInstallerDialog extends JDialog {
} catch (ExecutionException e) {
LogManager.logStackTrace(e);
}
if (success) {
type = DialogManager.INFO;
text = pack.getName() + " " + version.version + " "
+ Language.INSTANCE.localize("common.hasbeen") + " "
+ ((isReinstall) ? Language.INSTANCE.localize("common.reinstalled")
: Language.INSTANCE.localize("common.installed"))
+ "<br/><br/>"
+ ((isServer)
? Language.INSTANCE.localizeWithReplace("instance" + ".finditserver",
"<br/><br/>" + this.root.toFile().getAbsolutePath())
: Language.INSTANCE.localize("instance.findit"));
title = pack.getName() + " " + version.version + " "
+ Language.INSTANCE.localize("common.installed");
// #. {0} is the pack name and {1} is the pack version
title = GetText.tr("{0} {1} Installed", pack.getName(), version.version);
if (isReinstall) {
// #. {0} is the pack name and {1} is the pack version
text = GetText.tr("{0} {1} has been reinstalled.", pack.getName(), version.version);
} else if (isServer) {
// #. {0} is the pack name, {1} is the pack version and {2} is the folder
text = GetText.tr(
"{0} {1} server has been installed.<br/><br/>Find it in the below folder:<br/><br/>{2}",
pack.getName(), version.version, this.root.toFile().getAbsolutePath());
} else {
// #. {0} is the pack name and {1} is the pack version
text = GetText.tr(
"{0} {1} has been installed.<br/><br/>Find it in the instances tab.",
pack.getName(), version.version);
}
App.settings.reloadInstancesPanel();
if (pack.isLoggingEnabled() && App.settings.enableLogs() && !version.isDev) {
@ -343,20 +357,17 @@ public class InstanceInstallerDialog extends JDialog {
}
}
} else {
if (isReinstall) {
type = DialogManager.ERROR;
text = pack.getName() + " " + version.version + " "
+ Language.INSTANCE.localize("common.wasnt") + " "
+ Language.INSTANCE.localize("common.reinstalled") + "<br/><br/>"
+ (this.instanceIsCorrupt
? Language.INSTANCE.localize("instance.nolongerplayable")
: "")
+ "<br/><br/>" + Language.INSTANCE.localize("instance.checkerrorlogs")
+ "!";
title = pack.getName() + " " + version.version + " "
+ Language.INSTANCE.localize("common.not") + " "
+ Language.INSTANCE.localize("common.reinstalled");
if (this.instanceIsCorrupt) {
// #. {0} is the pack name and {1} is the pack version
title = GetText.tr("{0} {1} Not Reinstalled", pack.getName(), version.version);
// #. {0} is the pack name and {1} is the pack version
text = GetText.tr(
"{0} {1} wasn't reinstalled.<br/><br/>Check error logs for more information.",
pack.getName(), version.version);
if (instanceIsCorrupt) {
if (instanceV2 != null) {
instanceV2.launcher.isPlayable = false;
instanceV2.save();
@ -365,16 +376,13 @@ public class InstanceInstallerDialog extends JDialog {
}
}
} else {
// Install failed so delete the folder and clear Temp Dir
Utils.delete(this.root.toFile());
type = DialogManager.ERROR;
text = pack.getName() + " " + version.version + " "
+ Language.INSTANCE.localize("common.wasnt") + " "
+ Language.INSTANCE.localize("common.installed") + "<br/><br/>"
+ Language.INSTANCE.localize("instance.checkerrorlogs") + "!";
title = pack.getName() + " " + version.version + " "
+ Language.INSTANCE.localize("common.not") + " "
+ Language.INSTANCE.localize("common.installed");
// #. {0} is the pack name and {1} is the pack version
title = GetText.tr("{0} {1} Not Installed", pack.getName(), version.version);
// #. {0} is the pack name and {1} is the pack version
text = GetText.tr(
"{0} {1} wasn't installed.<br/><br/>Check error logs for more information.",
pack.getName(), version.version);
}
}
}
@ -475,7 +483,7 @@ public class InstanceInstallerDialog extends JDialog {
}
});
cancel = new JButton(Language.INSTANCE.localize("common.cancel"));
cancel = new JButton(GetText.tr("Cancel"));
cancel.addActionListener(e -> dispose());
bottom.add(install);
bottom.add(cancel);
@ -488,7 +496,7 @@ public class InstanceInstallerDialog extends JDialog {
private GridBagConstraints setupVersionsDropdown(GridBagConstraints gbc) {
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
versionLabel = new JLabel(Language.INSTANCE.localize("instance.versiontoinstall") + ": ");
versionLabel = new JLabel(GetText.tr("Version To Install") + ": ");
middle.add(versionLabel, gbc);
gbc.gridx++;
@ -572,7 +580,7 @@ public class InstanceInstallerDialog extends JDialog {
loaderVersions.clear();
loaderVersionsDropDown.removeAllItems();
loaderVersionsDropDown.addItem(new LoaderVersion(Language.INSTANCE.localize("instance.gettingloaderversions")));
loaderVersionsDropDown.addItem(new LoaderVersion(GetText.tr("Getting Loader Versions")));
loaderVersionLabel.setVisible(true);
loaderVersionsDropDown.setVisible(true);
@ -626,7 +634,7 @@ public class InstanceInstallerDialog extends JDialog {
gbc.gridx = 0;
gbc.gridy++;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
loaderVersionLabel = new JLabel(Language.INSTANCE.localize("instance.loaderversion") + ": ");
loaderVersionLabel = new JLabel(GetText.tr("Loader Version") + ": ");
middle.add(loaderVersionLabel, gbc);
gbc.gridx++;

View file

@ -41,13 +41,14 @@ import com.atlauncher.App;
import com.atlauncher.data.Instance;
import com.atlauncher.data.InstanceSettings;
import com.atlauncher.data.InstanceV2;
import com.atlauncher.data.Language;
import com.atlauncher.gui.CustomLineBorder;
import com.atlauncher.gui.components.JLabelWithHover;
import com.atlauncher.utils.Java;
import com.atlauncher.utils.OS;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public class InstanceSettingsDialog extends JDialog {
private Instance instance;
@ -70,8 +71,8 @@ public class InstanceSettingsDialog extends JDialog {
final Insets FIELD_INSETS_SMALL = new Insets(0, 0, 0, 0);
public InstanceSettingsDialog(Instance instance) {
super(App.settings.getParent(), instance.getName() + " " + Language.INSTANCE.localize("tabs.settings"),
ModalityType.APPLICATION_MODAL);
// #. {0} is the name of the instance
super(App.settings.getParent(), GetText.tr("{0} Settings", instance.getName()), ModalityType.APPLICATION_MODAL);
this.instance = instance;
setupComponents();
@ -86,7 +87,7 @@ public class InstanceSettingsDialog extends JDialog {
}
public InstanceSettingsDialog(InstanceV2 instanceV2) {
super(App.settings.getParent(), instanceV2.launcher.name + " " + Language.INSTANCE.localize("tabs.settings"),
super(App.settings.getParent(), GetText.tr("{0} Settings", instanceV2.launcher.name),
ModalityType.APPLICATION_MODAL);
this.instanceV2 = instanceV2;
@ -116,14 +117,16 @@ public class InstanceSettingsDialog extends JDialog {
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
JLabelWithHover initialMemoryLabelWarning = new JLabelWithHover(WARNING_ICON, "<html>"
+ Utils.splitMultilinedString(Language.INSTANCE.localize("settings.32bitmemorywarning"), 80, "<br/>")
+ "</html>", RESTART_BORDER);
JLabelWithHover initialMemoryLabelWarning = new JLabelWithHover(WARNING_ICON,
"<html>" + Utils.splitMultilinedString(GetText.tr(
"You are running a 32 bit Java and therefore cannot use more than 1GB of Ram. Please see http://atl.pw/32bit for help."),
80, "<br/>") + "</html>",
RESTART_BORDER);
JLabelWithHover initialMemoryLabel = new JLabelWithHover(
Language.INSTANCE.localize("settings.initialmemory") + ":", HELP_ICON,
"<html>" + Utils.splitMultilinedString(Language.INSTANCE.localize("settings.initialmemoryhelp"), 80,
"<br/>") + "</html>");
JLabelWithHover initialMemoryLabel = new JLabelWithHover(GetText.tr("Initial Memory/Ram") + ":", HELP_ICON,
"<html>" + Utils.splitMultilinedString(GetText.tr(
"Initial memory/ram is the starting amount of memory/ram to use when starting Minecraft. This should be left at the default of 512 MB unless you know what your doing."),
80, "<br/>") + "</html>");
JPanel initialMemoryPanel = new JPanel();
initialMemoryPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
@ -153,9 +156,9 @@ public class InstanceSettingsDialog extends JDialog {
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
JLabelWithHover maximumMemoryLabel = new JLabelWithHover(
Language.INSTANCE.localize("settings.maximummemory") + ":", HELP_ICON,
"<html>" + Utils.splitMultilinedString(Language.INSTANCE.localize("settings.maximummemoryhelp"), 80,
JLabelWithHover maximumMemoryLabel = new JLabelWithHover(GetText.tr("Maximum Memory/Ram") + ":", HELP_ICON,
"<html>" + Utils.splitMultilinedString(
GetText.tr("The maximum amount of memory/ram to allocate when starting Minecraft."), 80,
"<br/>") + "</html>");
topPanel.add(maximumMemoryLabel, gbc);
@ -183,8 +186,8 @@ public class InstanceSettingsDialog extends JDialog {
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
JLabelWithHover permGenLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.permgen") + ":",
HELP_ICON, Language.INSTANCE.localize("settings.permgenhelp"));
JLabelWithHover permGenLabel = new JLabelWithHover(GetText.tr("PermGen Size") + ":", HELP_ICON,
GetText.tr("The PermGen Size for java to use when launching Minecraft in MB."));
topPanel.add(permGenLabel, gbc);
gbc.gridx++;
@ -206,9 +209,9 @@ public class InstanceSettingsDialog extends JDialog {
gbc.gridwidth = 1;
gbc.insets = LABEL_INSETS_SMALL;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
JLabelWithHover javaPathLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.javapath") + ":",
HELP_ICON,
"<html>" + Language.INSTANCE.localizeWithReplace("settings.javapathhelp", "<br/>") + "</html>");
JLabelWithHover javaPathLabel = new JLabelWithHover(GetText.tr("Java Path") + ":", HELP_ICON, "<html>" + GetText
.tr("This setting allows you to specify where your Java Path is.<br/><br/>This should be left as default, but if you know what your doing just set<br/>this to the path where the bin folder is for the version of Java you want to use<br/><br/>If you mess up, click the Reset button to go back to the default")
+ "</html>");
topPanel.add(javaPathLabel, gbc);
gbc.gridx++;
@ -220,13 +223,13 @@ public class InstanceSettingsDialog extends JDialog {
javaPath.setText(getIfNotNull(
this.instanceV2 != null ? this.instanceV2.launcher.javaPath : instance.getSettings().getJavaPath(),
App.settings.getJavaPath()));
JButton javaPathResetButton = new JButton(Language.INSTANCE.localize("settings.javapathreset"));
JButton javaPathResetButton = new JButton(GetText.tr("Reset"));
javaPathResetButton.addActionListener(e -> javaPath.setText(Java.getPathToMinecraftJavaExecutable()));
JButton javaBrowseButton = new JButton(Language.INSTANCE.localize("common.browse"));
JButton javaBrowseButton = new JButton(GetText.tr("Browse"));
javaBrowseButton.addActionListener(e -> {
JFileChooser chooser = new JFileChooser();
chooser.setCurrentDirectory(new File(javaPath.getText()));
chooser.setDialogTitle(Language.INSTANCE.localize("settings.selectjavapath"));
chooser.setDialogTitle(GetText.tr("Select path to Java install"));
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
chooser.setAcceptAllFileFilterUsed(false);
@ -246,9 +249,8 @@ public class InstanceSettingsDialog extends JDialog {
gbc.gridwidth = 1;
gbc.insets = LABEL_INSETS_SMALL;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
JLabelWithHover javaParametersLabel = new JLabelWithHover(
Language.INSTANCE.localize("settings.javaparameters") + ":", HELP_ICON,
Language.INSTANCE.localize("settings.javaparametershelp"));
JLabelWithHover javaParametersLabel = new JLabelWithHover(GetText.tr("Java Parameters") + ":", HELP_ICON,
GetText.tr("Extra Java command line paramaters can be added here."));
topPanel.add(javaParametersLabel, gbc);
gbc.gridx++;
@ -259,7 +261,7 @@ public class InstanceSettingsDialog extends JDialog {
final JTextField javaParameters = new JTextField(40);
javaParameters.setText(getIfNotNull(this.instanceV2 != null ? this.instanceV2.launcher.javaArguments
: instance.getSettings().getJavaArguments(), App.settings.getJavaParameters()));
JButton javaParametersResetButton = new JButton(Language.INSTANCE.localize("settings.javapathreset"));
JButton javaParametersResetButton = new JButton(GetText.tr("Reset"));
javaParametersResetButton.addActionListener(e -> javaParameters.setText(
"-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M"));
javaParametersPanel.add(javaParameters);
@ -267,7 +269,7 @@ public class InstanceSettingsDialog extends JDialog {
topPanel.add(javaParametersPanel, gbc);
bottomPanel.setLayout(new FlowLayout());
JButton saveButton = new JButton(Language.INSTANCE.localize("common.save"));
JButton saveButton = new JButton(GetText.tr("Save"));
saveButton.addActionListener(arg0 -> {
saveSettings((Integer) initialMemory.getValue(), (Integer) maximumMemory.getValue(),
(Integer) permGen.getValue(), javaPath.getText(), javaParameters.getText());

View file

@ -37,7 +37,6 @@ import javax.swing.SwingConstants;
import com.atlauncher.App;
import com.atlauncher.Gsons;
import com.atlauncher.LogManager;
import com.atlauncher.data.Language;
import com.atlauncher.data.json.Mod;
import com.atlauncher.gui.components.ModsJCheckBox;
import com.atlauncher.managers.DialogManager;
@ -45,6 +44,8 @@ import com.atlauncher.utils.Utils;
import com.atlauncher.workers.InstanceInstaller;
import com.google.gson.reflect.TypeToken;
import org.mini2Dx.gettext.GetText;
import io.github.asyncronous.toast.Toaster;
public class ModsChooser extends JDialog {
@ -60,8 +61,7 @@ public class ModsChooser extends JDialog {
private boolean wasClosed = false;
public ModsChooser(InstanceInstaller installerr) {
super(App.settings.getParent(), Language.INSTANCE.localize("instance.selectmods"),
ModalityType.APPLICATION_MODAL);
super(App.settings.getParent(), GetText.tr("Select Mods To Install"), ModalityType.APPLICATION_MODAL);
this.installer = installerr;
setIconImage(Utils.getImage("/assets/image/Icon.png"));
setLocationRelativeTo(App.settings.getParent());
@ -94,11 +94,11 @@ public class ModsChooser extends JDialog {
labels.setEnabled(false);
split.setRightComponent(labels);
JLabel topLabelLeft = new JLabel(Language.INSTANCE.localize("instance.requiredmods"));
JLabel topLabelLeft = new JLabel(GetText.tr("Required Mods"));
topLabelLeft.setHorizontalAlignment(SwingConstants.CENTER);
labels.setLeftComponent(topLabelLeft);
JLabel topLabelRight = new JLabel(Language.INSTANCE.localize("instance.optionalmods"));
JLabel topLabelRight = new JLabel(GetText.tr("Optional Mods"));
topLabelRight.setHorizontalAlignment(SwingConstants.CENTER);
labels.setRightComponent(topLabelRight);
@ -131,10 +131,10 @@ public class ModsChooser extends JDialog {
add(bottomPanel, BorderLayout.SOUTH);
useShareCode = new JButton();
useShareCode.setText(Language.INSTANCE.localize("instance.usesharecode"));
useShareCode.setText(GetText.tr("Use Share Code"));
useShareCode.addActionListener(e -> {
String ret = JOptionPane.showInputDialog(null, Language.INSTANCE.localize("instance.entersharecode"),
Language.INSTANCE.localize("instance.sharecode"), JOptionPane.QUESTION_MESSAGE);
String ret = JOptionPane.showInputDialog(null, GetText.tr("Enter Share Code"), GetText.tr("Share Code"),
JOptionPane.QUESTION_MESSAGE);
if (ret != null) {
applyShareCode(ret);
@ -145,9 +145,9 @@ public class ModsChooser extends JDialog {
selectAllButton = new JButton();
if (installer.hasRecommendedMods()) {
selectAllButton.setText(Language.INSTANCE.localize("instance.selectrecommended"));
selectAllButton.setText(GetText.tr("Select Recommended"));
} else {
selectAllButton.setText(Language.INSTANCE.localize("instance.selectall"));
selectAllButton.setText(GetText.tr("Select All"));
}
selectAllButton.addActionListener(e -> {
@ -175,7 +175,7 @@ public class ModsChooser extends JDialog {
});
bottomPanel.add(selectAllButton);
clearAllButton = new JButton(Language.INSTANCE.localize("instance.clearall"));
clearAllButton = new JButton(GetText.tr("Clear All"));
clearAllButton.addActionListener(e -> {
for (ModsJCheckBox check : modCheckboxes) {
if ((installer.isServer ? check.getMod().isServerOptional() : check.getMod().isOptional())) {
@ -193,7 +193,7 @@ public class ModsChooser extends JDialog {
});
bottomPanel.add(clearAllButton);
installButton = new JButton(Language.INSTANCE.localize("common.install"));
installButton = new JButton(GetText.tr("Install"));
installButton.addActionListener(e -> dispose());
bottomPanel.add(installButton);
@ -268,13 +268,14 @@ public class ModsChooser extends JDialog {
String message = installer.packVersion.getWarningMessage(mod.getWarning());
if (message != null) {
int ret = DialogManager.optionDialog()
.setTitle(Language.INSTANCE.localize("instance.warning"))
.setContent("<html>" + message + "<br/>"
+ Language.INSTANCE.localize("instance.warningsure") + "</html>")
.setType(DialogManager.WARNING)
.addOption(Language.INSTANCE.localize("common.yes"))
.addOption(Language.INSTANCE.localize("common.no"), true).show();
int ret = DialogManager
.optionDialog().setTitle(GetText.tr("Warning")).setContent("<html>"
// #. {0} is a warning for a given mod
+ GetText.tr(
"{0}<br/><br/>Are you sure that you want to enable this mod?")
+ "</html>")
.setType(DialogManager.WARNING).addOption(GetText.tr("Yes"))
.addOption(GetText.tr("No"), true).show();
if (ret != 0) {
finalCheckBox.setSelected(false);
@ -365,7 +366,7 @@ public class ModsChooser extends JDialog {
String data = installer.getShareCodeData(code);
if (data == null) {
Toaster.instance().popError(Language.INSTANCE.localize("instance.invalidsharecode"));
Toaster.instance().popError(GetText.tr("Invalid Share Code"));
return;
}
@ -375,14 +376,14 @@ public class ModsChooser extends JDialog {
Map<String, List<Map<String, String>>> mods = Gsons.DEFAULT.fromJson(data, type);
if (mods == null) {
Toaster.instance().popError(Language.INSTANCE.localize("instance.invalidsharecode"));
Toaster.instance().popError(GetText.tr("Invalid Share Code"));
return;
}
List<Map<String, String>> optionalMods = mods.get("optional");
if (optionalMods == null || optionalMods.size() == 0) {
Toaster.instance().popError(Language.INSTANCE.localize("instance.invalidsharecode"));
Toaster.instance().popError(GetText.tr("Invalid Share Code"));
return;
}
@ -406,7 +407,7 @@ public class ModsChooser extends JDialog {
}
} catch (Exception e) {
LogManager.error("Invalid share code!");
Toaster.instance().popError(Language.INSTANCE.localize("instance.invalidsharecode"));
Toaster.instance().popError(GetText.tr("Invalid Share Code"));
}
}

View file

@ -29,10 +29,11 @@ import javax.swing.SwingConstants;
import com.atlauncher.App;
import com.atlauncher.LogManager;
import com.atlauncher.data.Language;
import com.atlauncher.interfaces.NetworkProgressable;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public class ProgressDialog extends JDialog implements NetworkProgressable {
private String labelText; // The text to add to the JLabel
@ -111,7 +112,7 @@ public class ProgressDialog extends JDialog implements NetworkProgressable {
public void doneTask() {
this.progressBar.setString(
++this.tasksDone + "/" + tasksToDo + " " + Language.INSTANCE.localize("common" + "" + ".tasksdone"));
++this.tasksDone + "/" + tasksToDo + " " + GetText.tr("Tasks Done"));
this.progressBar.setValue(this.tasksDone);
this.clearDownloadedBytes();
this.label.setText(this.labelText);

View file

@ -34,11 +34,12 @@ import com.atlauncher.App;
import com.atlauncher.LogManager;
import com.atlauncher.data.Instance;
import com.atlauncher.data.InstanceV2;
import com.atlauncher.data.Language;
import com.atlauncher.managers.DialogManager;
import com.atlauncher.utils.HTMLUtils;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public class RenameInstanceDialog extends JDialog {
private JPanel top;
@ -54,7 +55,7 @@ public class RenameInstanceDialog extends JDialog {
private InstanceV2 instanceV2;
public RenameInstanceDialog(Instance instance) {
super(null, Language.INSTANCE.localize("instance.renaminginstance"), ModalityType.APPLICATION_MODAL);
super(null, GetText.tr("Renaming Instance"), ModalityType.APPLICATION_MODAL);
this.instance = instance;
@ -77,7 +78,7 @@ public class RenameInstanceDialog extends JDialog {
}
public RenameInstanceDialog(InstanceV2 instanceV2) {
super(null, Language.INSTANCE.localize("instance.renaminginstance"), ModalityType.APPLICATION_MODAL);
super(null, GetText.tr("Renaming Instance"), ModalityType.APPLICATION_MODAL);
this.instanceV2 = instanceV2;
@ -102,7 +103,7 @@ public class RenameInstanceDialog extends JDialog {
private void setupComponents() {
// Top Panel Stuff
top = new JPanel();
top.add(new JLabel(Language.INSTANCE.localize("instance.renaminginstance")));
top.add(new JLabel(GetText.tr("Renaming Instance")));
// Middle Panel Stuff
middle = new JPanel();
@ -112,7 +113,7 @@ public class RenameInstanceDialog extends JDialog {
gbc.gridx = 0;
gbc.gridy = 0;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
instanceNameLabel = new JLabel(Language.INSTANCE.localize("instance.name") + ": ");
instanceNameLabel = new JLabel(GetText.tr("Instance Name") + ": ");
middle.add(instanceNameLabel, gbc);
gbc.gridx++;
@ -124,21 +125,19 @@ public class RenameInstanceDialog extends JDialog {
// Bottom Panel Stuff
bottom = new JPanel();
bottom.setLayout(new FlowLayout());
saveButton = new JButton(Language.INSTANCE.localize("common.save"));
saveButton = new JButton(GetText.tr("Save"));
saveButton.addActionListener(e -> {
if (App.settings.isInstance(instanceName.getText())) {
DialogManager.okDialog().setParent(RenameInstanceDialog.this)
.setTitle(Language.INSTANCE.localize("common" + ".error")).setContent(Language.INSTANCE
.localizeWithReplace("instance.alreadyinstance", instanceName.getText()))
DialogManager.okDialog().setParent(RenameInstanceDialog.this).setTitle(GetText.tr("Error"))
.setContent(
GetText.tr("There is already an instance called {0}.<br/><br/>Rename it and try again.",
instanceName.getText()))
.setType(DialogManager.ERROR).show();
} else if (instanceName.getText().replaceAll("[^A-Za-z0-9]", "").length() == 0) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("common.error"))
.setContent(
HTMLUtils
.centerParagraph(
Language.INSTANCE.localize("common.error") + "<br/><br/>"
+ Language.INSTANCE.localizeWithReplace("instance.invalidname",
instanceName.getText())))
DialogManager.okDialog().setTitle(GetText.tr("Error"))
.setContent(HTMLUtils.centerParagraph(GetText.tr("Error") + "<br/><br/>"
+ GetText.tr("The name {0} is invalid. It must contain at least 1 letter or number.",
instanceName.getText())))
.setType(DialogManager.ERROR).show();
} else {
if (this.instanceV2 != null && instanceV2.rename(instanceName.getText())) {
@ -148,12 +147,9 @@ public class RenameInstanceDialog extends JDialog {
App.settings.reloadInstancesPanel();
} else {
LogManager.error("Unknown Error Occured While Renaming Instance!");
DialogManager.okDialog().setParent(RenameInstanceDialog.this)
.setTitle(Language.INSTANCE.localize("common" + ".error"))
.setContent(HTMLUtils
.centerParagraph(Language.INSTANCE.localizeWithReplace("instance.errorrenaming",
this.instanceV2 != null ? this.instanceV2.launcher.name
: this.instance.getName() + "<br/><br/>")))
DialogManager.okDialog().setParent(RenameInstanceDialog.this).setTitle(GetText.tr("Error"))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"An error occurred renaming the instance.<br/><br/>Please check the console and try again.")))
.setType(DialogManager.ERROR).show();
}
close();

View file

@ -35,10 +35,11 @@ import javax.swing.border.BevelBorder;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import com.atlauncher.data.Language;
import com.atlauncher.gui.tabs.ServersForCheckerTab;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
public class ServerListForCheckerDialog extends JDialog implements ActionListener, ListSelectionListener {
/**
* Auto generate serial.
@ -46,17 +47,17 @@ public class ServerListForCheckerDialog extends JDialog implements ActionListene
private static final long serialVersionUID = -1462218261978353036L;
private final JTabbedPane TABBED_PANE = new JTabbedPane(JTabbedPane.TOP);
private final JButton ADD_BUTTON = new JButton(Language.INSTANCE.localize("common.add"));
private final JButton CLOSE_BUTTON = new JButton(Language.INSTANCE.localize("common.close"));
private final JButton DELETE_BUTTON = new JButton(Language.INSTANCE.localize("common.delete"));
private final JButton EDIT_BUTTON = new JButton(Language.INSTANCE.localize("common.edit"));
private final JButton ADD_BUTTON = new JButton(GetText.tr("Add"));
private final JButton CLOSE_BUTTON = new JButton(GetText.tr("Close"));
private final JButton DELETE_BUTTON = new JButton(GetText.tr("Delete"));
private final JButton EDIT_BUTTON = new JButton(GetText.tr("Edit"));
private final ServersForCheckerTab SERVERS_TAB = new ServersForCheckerTab();
private final JPanel BOTTOM_PANEL = new JPanel();
public ServerListForCheckerDialog() {
super(null, Language.INSTANCE.localize("tools.serverchecker"), ModalityType.APPLICATION_MODAL);
super(null, GetText.tr("Server Checker"), ModalityType.APPLICATION_MODAL);
setSize(400, 500);
setLocationRelativeTo(null);
setLayout(new BorderLayout());
@ -65,7 +66,7 @@ public class ServerListForCheckerDialog extends JDialog implements ActionListene
setResizable(false);
TABBED_PANE.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
TABBED_PANE.addTab(Language.INSTANCE.localize("tools.serverchecker.servers"), SERVERS_TAB);
TABBED_PANE.addTab(GetText.tr("Servers"), SERVERS_TAB);
SERVERS_TAB.addListSelectionListener(this);

View file

@ -38,6 +38,8 @@ import com.atlauncher.data.Language;
import com.atlauncher.gui.components.JLabelWithHover;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
public class SetupDialog extends JDialog {
/**
* Auto generated serial.
@ -59,7 +61,8 @@ public class SetupDialog extends JDialog {
private JButton saveButton;
public SetupDialog() {
super(null, Constants.LAUNCHER_NAME + " Setup", ModalityType.APPLICATION_MODAL);
// #. {0} is the name of the launcher (ATLauncher)
super(null, GetText.tr("{0} Setup", Constants.LAUNCHER_NAME), ModalityType.APPLICATION_MODAL);
this.requestFocus();
this.setSize(400, 250);
setLocationRelativeTo(null);
@ -70,7 +73,9 @@ public class SetupDialog extends JDialog {
// Top Panel Stuff
top = new JPanel();
top.add(new JLabel("Setting up " + Constants.LAUNCHER_NAME));
// #. {0} is the name of the launcher (ATLauncher)
top.add(new JLabel(GetText.tr("Setting up {0}", Constants.LAUNCHER_NAME)));
// Middle Panel Stuff
middle = new JPanel();
@ -80,19 +85,19 @@ public class SetupDialog extends JDialog {
gbc.gridx = 0;
gbc.gridy = 0;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
languageLabel = new JLabel("Language: ");
languageLabel = new JLabel(GetText.tr("Language") + ": ");
middle.add(languageLabel, gbc);
gbc.gridx++;
gbc.anchor = GridBagConstraints.BASELINE_LEADING;
language = new JComboBox<>(Language.available());
language.setSelectedItem(Language.current());
language = new JComboBox<>(Language.languages.keySet().toArray(new String[Language.languages.size()]));
language.setSelectedItem(Language.selected);
middle.add(language, gbc);
gbc.gridx = 0;
gbc.gridy++;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
enableLeaderboardsLabel = new JLabel("Enable Leaderboards? ");
enableLeaderboardsLabel = new JLabel(GetText.tr("Enable Leaderboards") + "? ");
middle.add(enableLeaderboardsLabel, gbc);
gbc.gridx++;
@ -104,9 +109,11 @@ public class SetupDialog extends JDialog {
gbc.gridx = 0;
gbc.gridy++;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
enableAnalyticsLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.analytics") + "? ",
enableAnalyticsLabel = new JLabelWithHover(GetText.tr("Enable Anonymous Analytics") + "? ",
Utils.getIconImage("/assets/image/Help.png"),
"<html>" + Language.INSTANCE.localizeWithReplace("settings.analyticshelp", "<br/>") + "</html>");
"<html>" + GetText.tr(
"The Launcher sends back anonymous analytics to Google Analytics%sin order to track what people do and don't use in the launcher.<br/>This helps determine what new features we implement in the future.<br/>All analytics are anonymous and contain no user/instance information in it at all.<br/>If you don't want to send anonymous analytics, you can disable this option.")
+ "</html>");
middle.add(enableAnalyticsLabel, gbc);
gbc.gridx++;
@ -118,7 +125,7 @@ public class SetupDialog extends JDialog {
// Bottom Panel Stuff
bottom = new JPanel();
bottom.setLayout(new FlowLayout());
saveButton = new JButton("Save");
saveButton = new JButton(GetText.tr("Save"));
saveButton.addActionListener(e -> {
App.settings.setLanguage((String) language.getSelectedItem());
App.settings.setEnableLeaderboards(enableLeaderboards.isSelected());

View file

@ -35,11 +35,12 @@ import javax.swing.JScrollPane;
import javax.swing.JTextField;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import com.atlauncher.data.Pack;
import com.atlauncher.data.json.Mod;
import com.atlauncher.gui.card.ModCard;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public final class ViewModsDialog extends JDialog {
private final Pack pack;
@ -49,15 +50,15 @@ public final class ViewModsDialog extends JDialog {
private final List<ModCard> cards = new LinkedList<>();
public ViewModsDialog(Pack pack) {
super(App.settings.getParent(), Language.INSTANCE.localizeWithReplace("pack.mods", pack.getName()),
ModalityType.APPLICATION_MODAL);
// #. {0} is the name of the pack
super(App.settings.getParent(), GetText.tr("Mods in {0}", pack.getName()), ModalityType.APPLICATION_MODAL);
this.pack = pack;
this.setPreferredSize(new Dimension(550, 450));
this.setResizable(false);
this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
this.topPanel.add(new JLabel(Language.INSTANCE.localize("common.search") + ": "));
this.topPanel.add(new JLabel(GetText.tr("Search") + ": "));
this.topPanel.add(this.searchField);
this.add(this.topPanel, BorderLayout.NORTH);

View file

@ -45,7 +45,6 @@ import javax.swing.event.HyperlinkEvent;
import com.atlauncher.App;
import com.atlauncher.LogManager;
import com.atlauncher.data.Account;
import com.atlauncher.data.Language;
import com.atlauncher.data.LoginResponse;
import com.atlauncher.evnt.listener.RelocalizationListener;
import com.atlauncher.evnt.manager.RelocalizationManager;
@ -56,6 +55,8 @@ import com.atlauncher.utils.Authentication;
import com.atlauncher.utils.HTMLUtils;
import com.atlauncher.utils.OS;
import org.mini2Dx.gettext.GetText;
public class AccountsTab extends JPanel implements Tab, RelocalizationListener {
private static final long serialVersionUID = 2493791137600123223L;
private final Insets TOP_INSETS = new Insets(0, 0, 20, 0);
@ -90,8 +91,9 @@ public class AccountsTab extends JPanel implements Tab, RelocalizationListener {
infoPanel.setLayout(new BorderLayout());
infoPanel.setBorder(BorderFactory.createEmptyBorder(60, 250, 0, 250));
JEditorPane infoTextPane = new JEditorPane("text/html",
"<html>" + Language.INSTANCE.localize("account.infotext") + "</html>");
JEditorPane infoTextPane = new JEditorPane("text/html", "<html>" + GetText.tr(
"In order to login and use ATLauncher modpacks, you must authenticate with your existing Minecraft/Mojang account. You must own and have paid for the Minecraft Java edition (not the Windows 10 edition) and use the same login here.<br><br>If you don't have an existing account, you can get one <a href=\"https://my.minecraft.net/en-us/store/minecraft/#register\">by buying Minecraft here</a>. The launcher doesn't work with cracked accounts.")
+ "</html>");
infoTextPane.setEditable(false);
infoTextPane.addHyperlinkListener(e -> {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
@ -116,7 +118,7 @@ public class AccountsTab extends JPanel implements Tab, RelocalizationListener {
gbc.insets = TOP_INSETS;
gbc.anchor = GridBagConstraints.CENTER;
fillerAccount = new Account(Language.INSTANCE.localize("account.add"));
fillerAccount = new Account(GetText.tr("Add An Account"));
accountsComboBox = new JComboBox<>();
accountsComboBox.addItem(fillerAccount);
@ -131,14 +133,14 @@ public class AccountsTab extends JPanel implements Tab, RelocalizationListener {
usernameField.setText("");
passwordField.setText("");
rememberField.setSelected(false);
leftButton.setText(Language.INSTANCE.localize("common.add"));
rightButton.setText(Language.INSTANCE.localize("common.clear"));
leftButton.setText(GetText.tr("Add"));
rightButton.setText(GetText.tr("Clear"));
} else {
usernameField.setText(account.getUsername());
passwordField.setText(account.getPassword());
rememberField.setSelected(account.isRemembered());
leftButton.setText(Language.INSTANCE.localize("common.save"));
rightButton.setText(Language.INSTANCE.localize("common.delete"));
leftButton.setText(GetText.tr("Save"));
rightButton.setText(GetText.tr("Delete"));
}
userSkin.setIcon(account.getMinecraftSkin());
}
@ -151,7 +153,7 @@ public class AccountsTab extends JPanel implements Tab, RelocalizationListener {
gbc.gridwidth = 1;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
usernameLabel = new JLabel(Language.INSTANCE.localize("account.usernameemail") + ":");
usernameLabel = new JLabel(GetText.tr("Username/Email") + ":");
bottomPanel.add(usernameLabel, gbc);
gbc.gridx++;
@ -172,7 +174,7 @@ public class AccountsTab extends JPanel implements Tab, RelocalizationListener {
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
passwordLabel = new JLabel(Language.INSTANCE.localize("account.password") + ":");
passwordLabel = new JLabel(GetText.tr("Password") + ":");
bottomPanel.add(passwordLabel, gbc);
gbc.gridx++;
@ -193,7 +195,7 @@ public class AccountsTab extends JPanel implements Tab, RelocalizationListener {
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
rememberLabel = new JLabel(Language.INSTANCE.localize("account.remember") + ":");
rememberLabel = new JLabel(GetText.tr("Remember Password") + ":");
bottomPanel.add(rememberLabel, gbc);
gbc.gridx++;
@ -203,12 +205,11 @@ public class AccountsTab extends JPanel implements Tab, RelocalizationListener {
bottomPanel.add(rememberField, gbc);
rememberField.addActionListener(e -> {
if (rememberField.isSelected()) {
int ret = DialogManager.optionDialog()
.setTitle(Language.INSTANCE.localize("account.securitywarningtitle"))
.setContent(HTMLUtils.centerParagraph(
Language.INSTANCE.localizeWithReplace("account.rememberpasswordwarning", "<br/><br/>")))
.setType(DialogManager.ERROR).addOption(Language.INSTANCE.localize("common.yes"), true)
.addOption(Language.INSTANCE.localize("common.no")).show();
int ret = DialogManager.optionDialog().setTitle(GetText.tr("Security Warning"))
.setContent(HTMLUtils.centerParagraph(GetText.tr(
"WARNING: By clicking Remember Password you potentially expose your password to bad people.<br/>This saves your encrypted password to disk and can be decrypted by bad people.<br/>Are you sure you want to do this?")))
.setType(DialogManager.ERROR).addOption(GetText.tr("Yes"), true).addOption(GetText.tr("No"))
.show();
if (ret != 0) {
rememberField.setSelected(false);
@ -223,9 +224,9 @@ public class AccountsTab extends JPanel implements Tab, RelocalizationListener {
gbc.anchor = GridBagConstraints.CENTER;
buttons = new JPanel();
buttons.setLayout(new FlowLayout());
leftButton = new JButton(Language.INSTANCE.localize("common.add"));
leftButton = new JButton(GetText.tr("Add"));
leftButton.addActionListener(e -> leftButtonActions());
rightButton = new JButton(Language.INSTANCE.localize("common.clear"));
rightButton = new JButton(GetText.tr("Clear"));
rightButton.addActionListener(e -> {
if (accountsComboBox.getSelectedIndex() == 0) {
usernameField.setText("");
@ -233,9 +234,8 @@ public class AccountsTab extends JPanel implements Tab, RelocalizationListener {
rememberField.setSelected(false);
} else {
Account account = (Account) accountsComboBox.getSelectedItem();
int ret = DialogManager.yesNoDialog().setTitle(Language.INSTANCE.localize("account.delete"))
.setContent(
Language.INSTANCE.localizeWithReplace("account.deletesure", usernameField.getText()))
int ret = DialogManager.yesNoDialog().setTitle(GetText.tr("Delete"))
.setContent(GetText.tr("Are you sure you want to delete this account?"))
.setType(DialogManager.WARNING).show();
if (ret == DialogManager.YES_OPTION) {
Analytics.sendEvent("Delete", "Account");
@ -258,7 +258,7 @@ public class AccountsTab extends JPanel implements Tab, RelocalizationListener {
contextMenu = new JPopupMenu();
updateSkin = new JMenuItem(Language.INSTANCE.localize("account.reloadskin"));
updateSkin = new JMenuItem(GetText.tr("Reload Skin"));
updateSkin.addActionListener(e -> {
final Account account = ((Account) accountsComboBox.getSelectedItem());
Analytics.sendEvent("UpdateSkin", "Account");
@ -285,8 +285,9 @@ public class AccountsTab extends JPanel implements Tab, RelocalizationListener {
private void leftButtonActions() {
if (App.settings.isInOfflineMode()) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("common.offline"))
.setContent(Language.INSTANCE.localize("account.offlinemode")).setType(DialogManager.ERROR).show();
DialogManager.okDialog().setTitle(GetText.tr("You're In Offline Mode")).setContent(GetText.tr(
"Cannot change/add account as you're in offline mode. Please connect to the internet and try again."))
.setType(DialogManager.ERROR).show();
} else {
Account account;
String clientToken = UUID.randomUUID().toString().replace("-", "");
@ -294,14 +295,14 @@ public class AccountsTab extends JPanel implements Tab, RelocalizationListener {
String password = new String(passwordField.getPassword());
boolean remember = rememberField.isSelected();
if (App.settings.isAccountByName(username) && accountsComboBox.getSelectedIndex() == 0) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("account.notadded"))
.setContent(Language.INSTANCE.localize("account.exists")).setType(DialogManager.ERROR).show();
DialogManager.okDialog().setTitle(GetText.tr("Account Not Added"))
.setContent(GetText.tr("This account already exists.")).setType(DialogManager.ERROR).show();
return;
}
LogManager.info("Logging into Minecraft!");
final ProgressDialog dialog = new ProgressDialog(Language.INSTANCE.localize("account.loggingin"), 0,
Language.INSTANCE.localize("account.loggingin"), "Aborting login for " + usernameField.getText());
final ProgressDialog dialog = new ProgressDialog(GetText.tr("Logging Into Minecraft"), 0,
GetText.tr("Logging Into Minecraft"), "Aborting login for " + usernameField.getText());
dialog.addThread(new Thread(() -> {
LoginResponse resp = Authentication.checkAccount(usernameField.getText(),
new String(passwordField.getPassword()), clientToken);
@ -319,10 +320,10 @@ public class AccountsTab extends JPanel implements Tab, RelocalizationListener {
Analytics.sendEvent("Add", "Account");
LogManager.info("Added Account " + account);
int ret = DialogManager.optionDialog().setTitle(Language.INSTANCE.localize("account.added"))
.setContent(Language.INSTANCE.localize("account.addedswitch")).setType(DialogManager.INFO)
.addOption(Language.INSTANCE.localize("common.yes"), true)
.addOption(Language.INSTANCE.localize("common.no")).show();
int ret = DialogManager.optionDialog().setTitle(GetText.tr("Account Added"))
.setContent(GetText.tr("Account added successfully. Switch to it now?"))
.setType(DialogManager.INFO).addOption(GetText.tr("Yes"), true).addOption(GetText.tr("No"))
.show();
if (ret == 0) {
App.settings.switchAccount(account);
@ -340,9 +341,8 @@ public class AccountsTab extends JPanel implements Tab, RelocalizationListener {
account.setStore(response.getAuth().saveForStorage());
Analytics.sendEvent("Edit", "Account");
LogManager.info("Edited Account " + account);
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("account.edited"))
.setContent(Language.INSTANCE.localize("account.editeddone")).setType(DialogManager.INFO)
.show();
DialogManager.okDialog().setTitle(GetText.tr("Account Edited"))
.setContent(GetText.tr("Account edited successfully")).setType(DialogManager.INFO).show();
}
App.settings.saveAccounts();
App.settings.reloadAccounts();
@ -354,9 +354,10 @@ public class AccountsTab extends JPanel implements Tab, RelocalizationListener {
accountsComboBox.setSelectedItem(account);
} else {
LogManager.error(response.getErrorMessage());
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("account.notadded"))
.setContent(HTMLUtils.centerParagraph(Language.INSTANCE.localize("account.incorrect")
+ "<br/><br/>" + response.getErrorMessage()))
DialogManager.okDialog().setTitle(GetText.tr("Account Not Added")).setContent(HTMLUtils.centerParagraph(
// #. {0} is the error message from Mojang as to why we couldn't login
GetText.tr("Account not added as login details were incorrect.<br/><br/>{0}",
response.getErrorMessage())))
.setType(DialogManager.INFO).show();
}
}
@ -364,24 +365,24 @@ public class AccountsTab extends JPanel implements Tab, RelocalizationListener {
@Override
public String getTitle() {
return Language.INSTANCE.localize("tabs.accounts");
return GetText.tr("Accounts");
}
@Override
public void onRelocalization() {
fillerAccount.setMinecraftUsername(Language.INSTANCE.localize("account.add"));
fillerAccount.setMinecraftUsername(GetText.tr("Add An Account"));
if (accountsComboBox.getSelectedIndex() == 0) {
leftButton.setText(Language.INSTANCE.localize("common.add"));
rightButton.setText(Language.INSTANCE.localize("common.clear"));
leftButton.setText(GetText.tr("Add"));
rightButton.setText(GetText.tr("Clear"));
} else {
leftButton.setText(Language.INSTANCE.localize("common.save"));
rightButton.setText(Language.INSTANCE.localize("common.delete"));
leftButton.setText(GetText.tr("Save"));
rightButton.setText(GetText.tr("Delete"));
}
usernameLabel.setText(Language.INSTANCE.localize("account.usernameemail") + ":");
passwordLabel.setText(Language.INSTANCE.localize("account.password") + ":");
rememberLabel.setText(Language.INSTANCE.localize("account.remember") + ":");
updateSkin.setText(Language.INSTANCE.localize("account.reloadskin"));
usernameLabel.setText(GetText.tr("Username/Email") + ":");
passwordLabel.setText(GetText.tr("Password") + ":");
rememberLabel.setText(GetText.tr("Remember Password") + ":");
updateSkin.setText(GetText.tr("Reload Skin"));
}
}

View file

@ -34,7 +34,6 @@ import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import com.atlauncher.evnt.listener.RelocalizationListener;
import com.atlauncher.evnt.manager.RelocalizationManager;
import com.atlauncher.gui.card.InstanceCard;
@ -42,6 +41,8 @@ import com.atlauncher.gui.card.InstanceV2Card;
import com.atlauncher.gui.card.NilCard;
import com.atlauncher.network.Analytics;
import org.mini2Dx.gettext.GetText;
public class InstancesTab extends JPanel implements Tab, RelocalizationListener {
private static final long serialVersionUID = -969812552965390610L;
private JPanel topPanel;
@ -70,7 +71,7 @@ public class InstancesTab extends JPanel implements Tab, RelocalizationListener
topPanel = new JPanel();
topPanel.setLayout(new FlowLayout(FlowLayout.LEFT));
clearButton = new JButton(Language.INSTANCE.localize("common.clear"));
clearButton = new JButton(GetText.tr("Clear"));
clearButton.addActionListener(e -> {
searchBox.setText("");
hasUpdate.setSelected(false);
@ -92,7 +93,7 @@ public class InstancesTab extends JPanel implements Tab, RelocalizationListener
});
topPanel.add(searchBox);
searchButton = new JButton(Language.INSTANCE.localize("common.search"));
searchButton = new JButton(GetText.tr("Search"));
searchButton.addActionListener(e -> {
Analytics.sendEvent(searchBox.getText(), "Search", "Instance");
reload();
@ -104,7 +105,7 @@ public class InstancesTab extends JPanel implements Tab, RelocalizationListener
hasUpdate.addActionListener(e -> reload());
topPanel.add(hasUpdate);
hasUpdateLabel = new JLabel(Language.INSTANCE.localize("instance.hasupdate"));
hasUpdateLabel = new JLabel(GetText.tr("Has Update"));
topPanel.add(hasUpdateLabel);
add(topPanel, BorderLayout.NORTH);
@ -176,7 +177,7 @@ public class InstancesTab extends JPanel implements Tab, RelocalizationListener
});
if (panel.getComponentCount() == 0) {
nilCard = new NilCard(Language.INSTANCE.localizeWithReplace("instance.nodisplay", "\n\n"));
nilCard = new NilCard(GetText.tr("There are no packs to display.\n\nPlease check back another time."));
panel.add(nilCard, gbc);
}
@ -199,17 +200,17 @@ public class InstancesTab extends JPanel implements Tab, RelocalizationListener
@Override
public String getTitle() {
return Language.INSTANCE.localize("tabs.instances");
return GetText.tr("Instances");
}
@Override
public void onRelocalization() {
clearButton.setText(Language.INSTANCE.localize("common.clear"));
searchButton.setText(Language.INSTANCE.localize("common.search"));
hasUpdateLabel.setText(Language.INSTANCE.localize("instance.hasupdate"));
clearButton.setText(GetText.tr("Clear"));
searchButton.setText(GetText.tr("Search"));
hasUpdateLabel.setText(GetText.tr("Has Update"));
if (nilCard != null) {
nilCard.setMessage(Language.INSTANCE.localizeWithReplace("instance.nodisplay", "\n\n"));
nilCard.setMessage(GetText.tr("There are no packs to display.\n\nPlease check back another time."));
}
}
}

View file

@ -32,10 +32,11 @@ import javax.swing.event.HyperlinkEvent;
import javax.swing.text.html.HTMLEditorKit;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import com.atlauncher.utils.OS;
import com.atlauncher.utils.Resources;
import org.mini2Dx.gettext.GetText;
/**
* This class extends {@link JPanel} and provides a Panel for displaying the
* latest news.
@ -103,12 +104,12 @@ public class NewsTab extends JPanel implements Tab {
@Override
public String getTitle() {
return Language.INSTANCE.localize("tabs.news");
return GetText.tr("News");
}
@SuppressWarnings("serial")
private final class ContextMenu extends JPopupMenu {
private final JMenuItem COPY_ITEM = new JMenuItem(Language.INSTANCE.localize("common.copy"));
private final JMenuItem COPY_ITEM = new JMenuItem(GetText.tr("Copy"));
public ContextMenu() {
super();

View file

@ -37,7 +37,6 @@ import javax.swing.JScrollPane;
import javax.swing.JTextField;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import com.atlauncher.data.Pack;
import com.atlauncher.evnt.listener.RelocalizationListener;
import com.atlauncher.evnt.manager.RelocalizationManager;
@ -49,20 +48,22 @@ import com.atlauncher.gui.dialogs.AddPackDialog;
import com.atlauncher.gui.panels.LoadingPanel;
import com.atlauncher.network.Analytics;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public final class PacksTab extends JPanel implements Tab, RelocalizationListener {
private final JPanel topPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
private final JPanel contentPanel = new JPanel(new GridBagLayout());
private final JPanel bottomPanel = new JPanel(new FlowLayout(FlowLayout.CENTER));
private final JButton addButton = new JButton(Language.INSTANCE.localize("pack.addpack"));
private final JButton clearButton = new JButton(Language.INSTANCE.localize("common.clear"));
private final JButton expandAllButton = new JButton(Language.INSTANCE.localize("pack.expandall"));
private final JButton collapseAllButton = new JButton(Language.INSTANCE.localize("pack.collapseall"));
private final JButton addButton = new JButton(GetText.tr("Add Pack"));
private final JButton clearButton = new JButton(GetText.tr("Clear"));
private final JButton expandAllButton = new JButton(GetText.tr("Expand All"));
private final JButton collapseAllButton = new JButton(GetText.tr("Collapse All"));
private final JTextField searchField = new JTextField(16);
private final JButton searchButton = new JButton(Language.INSTANCE.localize("common.search"));
private final JCheckBox serversBox = new JCheckBox(Language.INSTANCE.localize("pack.cancreateserver"));
private final JCheckBox privateBox = new JCheckBox(Language.INSTANCE.localize("pack.privatepacksonly"));
private final JCheckBox searchDescBox = new JCheckBox(Language.INSTANCE.localize("pack.searchdescription"));
private final JButton searchButton = new JButton(GetText.tr("Search"));
private final JCheckBox serversBox = new JCheckBox(GetText.tr("Can Create Server"));
private final JCheckBox privateBox = new JCheckBox(GetText.tr("Private Packs Only"));
private final JCheckBox searchDescBox = new JCheckBox(GetText.tr("Search Description"));
private NilCard nilCard;
private boolean isVanilla;
private boolean isFeatured;
@ -199,7 +200,8 @@ public final class PacksTab extends JPanel implements Tab, RelocalizationListene
this.contentPanel.removeAll();
if (count == 0) {
this.contentPanel.add(new NilCard(Language.INSTANCE.localizeWithReplace("pack.nodisplay", "\n\n")), gbc);
this.contentPanel.add(
new NilCard(GetText.tr("There are no packs to display.\n\nPlease check back another time.")), gbc);
} else {
this.cards.stream().forEach(card -> {
this.contentPanel.add(card, gbc);
@ -262,10 +264,10 @@ public final class PacksTab extends JPanel implements Tab, RelocalizationListene
}
}
((LauncherFrame) App.settings.getParent()).updateTitle("Packs - " + count);
((LauncherFrame) App.settings.getParent()).updateTitle(this.getTitle() + " - " + count);
if (count == 0) {
nilCard = new NilCard(Language.INSTANCE.localizeWithReplace("instance.nodisplay", "\n\n"));
nilCard = new NilCard(GetText.tr("There are no packs to display.\n\nPlease check back another time."));
this.contentPanel.add(nilCard, gbc);
}
}
@ -288,22 +290,22 @@ public final class PacksTab extends JPanel implements Tab, RelocalizationListene
@Override
public String getTitle() {
return (this.isFeatured ? "Featured " : "") + (this.isVanilla ? "Vanilla " : "")
+ Language.INSTANCE.localize("tabs.packs");
return (this.isFeatured ? GetText.tr("Featured Packs")
: (this.isVanilla ? GetText.tr("Vanilla Packs") : GetText.tr("Packs")));
}
@Override
public void onRelocalization() {
addButton.setText(Language.INSTANCE.localize("pack.addpack"));
clearButton.setText(Language.INSTANCE.localize("common.clear"));
expandAllButton.setText(Language.INSTANCE.localize("pack.expandall"));
collapseAllButton.setText(Language.INSTANCE.localize("pack.collapseall"));
serversBox.setText(Language.INSTANCE.localize("pack.cancreateserver"));
privateBox.setText(Language.INSTANCE.localize("pack.privatepacksonly"));
searchDescBox.setText(Language.INSTANCE.localize("pack.searchdescription"));
addButton.setText(GetText.tr("Add Pack"));
clearButton.setText(GetText.tr("Clear"));
expandAllButton.setText(GetText.tr("Expand All"));
collapseAllButton.setText(GetText.tr("Collapse All"));
serversBox.setText(GetText.tr("Can Create Server"));
privateBox.setText(GetText.tr("Private Packs Only"));
searchDescBox.setText(GetText.tr("Search Description"));
if (nilCard != null) {
nilCard.setMessage(Language.INSTANCE.localizeWithReplace("pack.nodisplay", "\n\n"));
nilCard.setMessage(GetText.tr("There are no packs to display.\n\nPlease check back another time."));
}
}
}

View file

@ -35,20 +35,18 @@ import javax.swing.ListSelectionModel;
import javax.swing.event.ListSelectionListener;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import com.atlauncher.data.MinecraftServer;
import com.atlauncher.gui.dialogs.AddEditServerForCheckerDialog;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings({"rawtypes", "unchecked"})
public class ServersForCheckerTab extends JPanel implements ActionListener {
/**
* Auto generated serial.
*/
private static final long serialVersionUID = 3385411077046354453L;
private final JPopupMenu CONTEXT_MENU = new JPopupMenu();
private final JMenuItem EDIT_BUTTON = new JMenuItem(Language.INSTANCE.localize("common.edit"));
private final JMenuItem DELETE_BUTTON = new JMenuItem(Language.INSTANCE.localize("common.delete"));
private final JMenuItem EDIT_BUTTON = new JMenuItem(GetText.tr("Edit"));
private final JMenuItem DELETE_BUTTON = new JMenuItem(GetText.tr("Delete"));
private DefaultListModel<MinecraftServer> listModel;
private JList serverList;

View file

@ -28,7 +28,6 @@ import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import com.atlauncher.evnt.listener.RelocalizationListener;
import com.atlauncher.evnt.manager.RelocalizationManager;
import com.atlauncher.evnt.manager.SettingsManager;
@ -40,6 +39,8 @@ import com.atlauncher.gui.tabs.settings.ToolsSettingsTab;
import com.atlauncher.network.Analytics;
import com.atlauncher.utils.OS;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public class SettingsTab extends JPanel implements Tab, RelocalizationListener {
@ -52,7 +53,7 @@ public class SettingsTab extends JPanel implements Tab, RelocalizationListener {
this.networkSettingsTab, this.loggingSettingsTab, this.toolsSettingsTab });
private JTabbedPane tabbedPane;
private JPanel bottomPanel;
private JButton saveButton = new JButton(Language.INSTANCE.localize("common.save"));
private JButton saveButton = new JButton(GetText.tr("Save"));
public SettingsTab() {
RelocalizationManager.addListener(this);
@ -85,7 +86,7 @@ public class SettingsTab extends JPanel implements Tab, RelocalizationListener {
&& networkSettingsTab.isValidConcurrentConnections() && networkSettingsTab.isValidProxyPort()
&& networkSettingsTab.canConnectWithProxy() && toolsSettingsTab.isValidServerCheckerWait()) {
boolean reloadTheme = generalSettingsTab.needToReloadTheme();
boolean reloadLocalizationTable = generalSettingsTab.reloadLocalizationTable();
boolean reloadLanguage = generalSettingsTab.needToReloadLanguage();
boolean reloadPacksPanel = generalSettingsTab.needToReloadPacksPanel();
boolean restartServerChecker = toolsSettingsTab.needToRestartServerChecker();
generalSettingsTab.save();
@ -95,16 +96,13 @@ public class SettingsTab extends JPanel implements Tab, RelocalizationListener {
toolsSettingsTab.save();
App.settings.saveProperties();
SettingsManager.post();
if (reloadLocalizationTable) {
RelocalizationManager.post();
}
if (reloadPacksPanel) {
App.settings.reloadPacksPanel();
}
if (restartServerChecker) {
App.settings.startCheckingServers();
}
if (reloadTheme) {
if (reloadTheme || reloadLanguage) {
OS.restartLauncher();
}
App.TOASTER.pop("Settings Saved");
@ -114,7 +112,7 @@ public class SettingsTab extends JPanel implements Tab, RelocalizationListener {
@Override
public String getTitle() {
return Language.INSTANCE.localize("tabs.settings");
return GetText.tr("Settings");
}
@Override
@ -122,7 +120,7 @@ public class SettingsTab extends JPanel implements Tab, RelocalizationListener {
for (int i = 0; i < this.tabbedPane.getTabCount(); i++) {
this.tabbedPane.setTitleAt(i, this.tabs.get(i).getTitle());
}
this.saveButton.setText(Language.INSTANCE.localize("common.save"));
this.saveButton.setText(GetText.tr("Save"));
}
}

View file

@ -22,7 +22,6 @@ import java.awt.GridLayout;
import javax.swing.JPanel;
import com.atlauncher.data.Language;
import com.atlauncher.gui.components.BlankToolPanel;
import com.atlauncher.gui.components.LogClearerToolPanel;
import com.atlauncher.gui.components.NetworkCheckerToolPanel;
@ -30,6 +29,8 @@ import com.atlauncher.gui.components.RelaunchInDebugModePanel;
import com.atlauncher.gui.components.RuntimeDownloaderToolPanel;
import com.atlauncher.gui.components.ServerCheckerToolPanel;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public class ToolsTab extends JPanel implements Tab {
private JPanel mainPanel;
@ -53,6 +54,6 @@ public class ToolsTab extends JPanel implements Tab {
@Override
public String getTitle() {
return Language.INSTANCE.localize("tabs.tools");
return GetText.tr("Tools");
}
}

View file

@ -26,15 +26,17 @@ import javax.swing.JPanel;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import com.atlauncher.evnt.listener.RelocalizationListener;
import com.atlauncher.evnt.manager.RelocalizationManager;
import com.atlauncher.gui.components.JLabelWithHover;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public class GeneralSettingsTab extends AbstractSettingsTab implements RelocalizationListener {
public class GeneralSettingsTab extends AbstractSettingsTab {
private JLabelWithHover languageLabel;
private JComboBox<String> language;
private JLabelWithHover languageLabelRestart;
private JPanel languagePanel;
private JLabelWithHover themeLabel;
private JComboBox<String> theme;
private JLabelWithHover themeLabelRestart;
@ -55,23 +57,30 @@ public class GeneralSettingsTab extends AbstractSettingsTab implements Relocaliz
private JCheckBox enablePackTags;
public GeneralSettingsTab() {
RelocalizationManager.addListener(this);
// Language
gbc.gridx = 0;
gbc.gridy = 0;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
languageLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.language") + ":", HELP_ICON,
Language.INSTANCE.localize("settings.languagehelp"));
languageLabelRestart = new JLabelWithHover(ERROR_ICON,
GetText.tr("Changing this setting will automatically restart the launcher."), RESTART_BORDER);
add(languageLabel, gbc);
languageLabel = new JLabelWithHover(GetText.tr("Language") + ":", HELP_ICON,
GetText.tr("This specifies the Language used by the Launcher."));
languagePanel = new JPanel();
languagePanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
languagePanel.add(languageLabelRestart);
languagePanel.add(languageLabel);
languagePanel.add(languageLabel);
add(languagePanel, gbc);
gbc.gridx++;
gbc.insets = FIELD_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_LEADING;
language = new JComboBox<>(Language.available());
language.setSelectedItem(Language.current());
language = new JComboBox<>(Language.languages.keySet().toArray(new String[Language.languages.size()]));
language.setSelectedItem(Language.selected);
add(language, gbc);
// Theme
@ -82,10 +91,10 @@ public class GeneralSettingsTab extends AbstractSettingsTab implements Relocaliz
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
themeLabelRestart = new JLabelWithHover(ERROR_ICON,
Language.INSTANCE.localize("settings" + "" + ".requiresrestart"), RESTART_BORDER);
GetText.tr("Changing this setting will automatically restart the launcher."), RESTART_BORDER);
themeLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.theme") + ":", HELP_ICON,
Language.INSTANCE.localize("settings.themehelp"));
themeLabel = new JLabelWithHover(GetText.tr("Theme") + ":", HELP_ICON,
GetText.tr("This sets the theme that the launcher will use."));
themeLabelPanel = new JPanel();
themeLabelPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
@ -112,8 +121,8 @@ public class GeneralSettingsTab extends AbstractSettingsTab implements Relocaliz
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
dateFormatLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.dateformat") + ":", HELP_ICON,
Language.INSTANCE.localize("settings.dateformathelp"));
dateFormatLabel = new JLabelWithHover(GetText.tr("Date Format") + ":", HELP_ICON, GetText.tr(
"This controls the format that dates are displayed in the launcher with the value dd meaning the day, M being the month and yyy being the year."));
add(dateFormatLabel, gbc);
@ -134,9 +143,8 @@ public class GeneralSettingsTab extends AbstractSettingsTab implements Relocaliz
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
sortPacksAlphabeticallyLabel = new JLabelWithHover(
Language.INSTANCE.localize("settings" + "" + ".sortpacksalphabetically") + "?", HELP_ICON,
Language.INSTANCE.localize("settings" + "" + ".sortpacksalphabeticallyhelp"));
sortPacksAlphabeticallyLabel = new JLabelWithHover(GetText.tr("Sort Packs Alphabetically") + "?", HELP_ICON,
GetText.tr("If you want to sort the packs in the packs panel alphabetically by default or not."));
add(sortPacksAlphabeticallyLabel, gbc);
gbc.gridx++;
@ -154,8 +162,8 @@ public class GeneralSettingsTab extends AbstractSettingsTab implements Relocaliz
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
keepLauncherOpenLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.keeplauncheropen") + "?",
HELP_ICON, Language.INSTANCE.localize("settings.keeplauncheropenhelp"));
keepLauncherOpenLabel = new JLabelWithHover(GetText.tr("Keep Launcher Open") + "?", HELP_ICON,
GetText.tr("This determines if ATLauncher should stay open or exit after Minecraft has exited"));
add(keepLauncherOpenLabel, gbc);
gbc.gridx++;
@ -173,8 +181,8 @@ public class GeneralSettingsTab extends AbstractSettingsTab implements Relocaliz
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
enableConsoleLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.console") + "?", HELP_ICON,
Language.INSTANCE.localize("settings.consolehelp"));
enableConsoleLabel = new JLabelWithHover(GetText.tr("Enable Console") + "?", HELP_ICON,
GetText.tr("If you want the console to be visible when opening the Launcher."));
add(enableConsoleLabel, gbc);
gbc.gridx++;
@ -192,8 +200,9 @@ public class GeneralSettingsTab extends AbstractSettingsTab implements Relocaliz
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
enableTrayIconLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.traymenu") + "?", HELP_ICON,
"<html>" + Language.INSTANCE.localizeWithReplace("settings.traymenuhelp", "<br/>") + "</html>");
enableTrayIconLabel = new JLabelWithHover(GetText.tr("Enable Tray Menu") + "?", HELP_ICON, "<html>" + GetText
.tr("The Tray Menu is a little icon that shows in your system taskbar which<br/>allows you to perform different functions to do various things with the launcher<br/>such as hiding or showing the console, killing Minecraft or closing ATLauncher.")
+ "</html>");
add(enableTrayIconLabel, gbc);
gbc.gridx++;
@ -211,10 +220,8 @@ public class GeneralSettingsTab extends AbstractSettingsTab implements Relocaliz
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
enableDiscordIntegrationLabel = new JLabelWithHover(
Language.INSTANCE.localize("settings.discordintegration") + "?", HELP_ICON,
"<html>" + Language.INSTANCE.localizeWithReplace("settings.discordintegrationhelp", "<br/>")
+ "</html>");
enableDiscordIntegrationLabel = new JLabelWithHover(GetText.tr("Enable Discord Integration") + "?", HELP_ICON,
GetText.tr("This will enable showing which pack you're playing in Discord."));
add(enableDiscordIntegrationLabel, gbc);
gbc.gridx++;
@ -230,8 +237,8 @@ public class GeneralSettingsTab extends AbstractSettingsTab implements Relocaliz
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
enablePackTagsLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.packtags"), HELP_ICON,
Language.INSTANCE.localize("settings.packtagshelp"));
enablePackTagsLabel = new JLabelWithHover(GetText.tr("Enable Pack Tags"), HELP_ICON,
GetText.tr("Pack tags shows you if a pack is public, semi public or private"));
add(enablePackTagsLabel, gbc);
gbc.gridx++;
@ -250,8 +257,8 @@ public class GeneralSettingsTab extends AbstractSettingsTab implements Relocaliz
return sortPacksAlphabetically.isSelected() != App.settings.sortPacksAlphabetically();
}
public boolean reloadLocalizationTable() {
return !((String) language.getSelectedItem()).equalsIgnoreCase(Language.current());
public boolean needToReloadLanguage() {
return !((String) language.getSelectedItem()).equalsIgnoreCase(Language.selected);
}
public void save() {
@ -268,39 +275,6 @@ public class GeneralSettingsTab extends AbstractSettingsTab implements Relocaliz
@Override
public String getTitle() {
return Language.INSTANCE.localize("settings.generaltab");
}
@Override
public void onRelocalization() {
this.languageLabel.setText(Language.INSTANCE.localize("settings.language") + ":");
this.languageLabel.setToolTipText(Language.INSTANCE.localize("settings.languagehelp"));
this.themeLabelRestart.setToolTipText(Language.INSTANCE.localize("settings.requiresrestart"));
this.themeLabel.setText(Language.INSTANCE.localize("settings.theme") + ":");
this.themeLabel.setToolTipText(Language.INSTANCE.localize("settings.themehelp"));
this.dateFormatLabel.setText(Language.INSTANCE.localize("settings.dateformat") + ":");
this.dateFormatLabel.setToolTipText(Language.INSTANCE.localize("settings.dateformathelp"));
this.sortPacksAlphabeticallyLabel.setText(Language.INSTANCE.localize("settings.sortpacksalphabetically") + "?");
this.sortPacksAlphabeticallyLabel
.setToolTipText(Language.INSTANCE.localize("settings" + "" + ".sortpacksalphabeticallyhelp"));
this.keepLauncherOpenLabel.setText(Language.INSTANCE.localize("settings.keeplauncheropen") + "?");
this.keepLauncherOpenLabel.setToolTipText(Language.INSTANCE.localize("settings.keeplauncheropenhelp"));
this.enableConsoleLabel.setText(Language.INSTANCE.localize("settings.console") + "?");
this.enableConsoleLabel.setToolTipText(Language.INSTANCE.localize("settings.consolehelp"));
this.enableTrayIconLabel.setText(Language.INSTANCE.localize("settings.traymenu") + "?");
this.enableTrayIconLabel.setToolTipText("<html>"
+ Language.INSTANCE.localizeWithReplace("settings" + "" + ".traymenuhelp", "<br/>") + "</html>");
this.enableDiscordIntegrationLabel.setText(Language.INSTANCE.localize("settings.discordintegration") + "?");
this.enableDiscordIntegrationLabel.setToolTipText(
"<html>" + Language.INSTANCE.localizeWithReplace("settings" + "" + ".discordintegrationhelp", "<br/>")
+ "</html>");
return GetText.tr("General");
}
}

View file

@ -35,7 +35,6 @@ import javax.swing.JTextField;
import javax.swing.SpinnerNumberModel;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import com.atlauncher.evnt.listener.RelocalizationListener;
import com.atlauncher.evnt.listener.SettingsListener;
import com.atlauncher.evnt.manager.RelocalizationManager;
@ -47,6 +46,8 @@ import com.atlauncher.utils.OS;
import com.atlauncher.utils.Utils;
import com.atlauncher.utils.javafinder.JavaInfo;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public class JavaSettingsTab extends AbstractSettingsTab implements RelocalizationListener, SettingsListener {
private JLabelWithHover initialMemoryLabel;
@ -96,13 +97,14 @@ public class JavaSettingsTab extends AbstractSettingsTab implements Relocalizati
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
initialMemoryLabelWarning = new JLabelWithHover(WARNING_ICON, "<html>"
+ Utils.splitMultilinedString(Language.INSTANCE.localize("settings.32bitmemorywarning"), 80, "<br/>")
+ "</html>", RESTART_BORDER);
initialMemoryLabelWarning = new JLabelWithHover(WARNING_ICON, "<html>" + Utils.splitMultilinedString(GetText.tr(
"You are running a 32 bit Java and therefore cannot use more than 1GB of Ram. Please see http://atl.pw/32bit for help."),
80, "<br/>") + "</html>", RESTART_BORDER);
initialMemoryLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.initialmemory") + ":", HELP_ICON,
"<html>" + Utils.splitMultilinedString(Language.INSTANCE.localize("settings.initialmemoryhelp"), 80,
"<br/>") + "</html>");
initialMemoryLabel = new JLabelWithHover(GetText.tr("Initial Memory/Ram") + ":", HELP_ICON,
"<html>" + Utils.splitMultilinedString(GetText.tr(
"Initial memory/ram is the starting amount of memory/ram to use when starting Minecraft. This should be left at the default of 512 MB unless you know what your doing."),
80, "<br/>") + "</html>");
initialMemoryPanel = new JPanel();
initialMemoryPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
@ -130,19 +132,18 @@ public class JavaSettingsTab extends AbstractSettingsTab implements Relocalizati
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
maximumMemoryLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.maximummemory") + ":", HELP_ICON,
"<html>" + Utils.splitMultilinedString(Language.INSTANCE.localize("settings.maximummemoryhelp"), 80,
maximumMemoryLabel = new JLabelWithHover(GetText.tr("Maximum Memory/Ram") + ":", HELP_ICON,
"<html>" + Utils.splitMultilinedString(
GetText.tr("The maximum amount of memory/ram to allocate when starting Minecraft."), 80,
"<br/>") + "</html>");
add(maximumMemoryLabel, gbc);
maximumMemoryPanel = new JPanel();
maximumMemoryPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
if (!OS.is64Bit()) {
maximumMemoryPanel
.add(new JLabelWithHover(WARNING_ICON,
"<html>" + Utils.splitMultilinedString(
Language.INSTANCE.localize("settings.32bitmemorywarning"), 80, "<br/>") + "</html>",
RESTART_BORDER));
maximumMemoryPanel.add(new JLabelWithHover(WARNING_ICON, "<html>" + Utils.splitMultilinedString(GetText.tr(
"You are running a 32 bit Java and therefore cannot use more than 1GB of Ram. Please see http://atl.pw/32bit for help."),
80, "<br/>") + "</html>", RESTART_BORDER));
}
maximumMemoryPanel.add(maximumMemoryLabel);
@ -164,8 +165,8 @@ public class JavaSettingsTab extends AbstractSettingsTab implements Relocalizati
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
permGenLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.permgen") + ":", HELP_ICON,
Language.INSTANCE.localize("settings.permgenhelp"));
permGenLabel = new JLabelWithHover(GetText.tr("PermGen Size") + ":", HELP_ICON,
GetText.tr("The PermGen Size for java to use when launching Minecraft in MB."));
add(permGenLabel, gbc);
gbc.gridx++;
@ -184,8 +185,8 @@ public class JavaSettingsTab extends AbstractSettingsTab implements Relocalizati
gbc.gridwidth = 1;
gbc.insets = LABEL_INSETS_SMALL;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
windowSizeLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.windowsize") + ":", HELP_ICON,
Language.INSTANCE.localize("settings.windowsizehelp"));
windowSizeLabel = new JLabelWithHover(GetText.tr("Window Size") + ":", HELP_ICON,
GetText.tr("The size that the Minecraft window should open as, Width x Height, in pixels."));
add(windowSizeLabel, gbc);
gbc.gridx++;
@ -232,8 +233,9 @@ public class JavaSettingsTab extends AbstractSettingsTab implements Relocalizati
gbc.gridwidth = 1;
gbc.insets = LABEL_INSETS_SMALL;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
javaPathLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.javapath") + ":", HELP_ICON,
"<html>" + Language.INSTANCE.localizeWithReplace("settings.javapathhelp", "<br/>") + "</html>");
javaPathLabel = new JLabelWithHover(GetText.tr("Java Path") + ":", HELP_ICON, "<html>" + GetText.tr(
"This setting allows you to specify where your Java Path is.<br/><br/>This should be left as default, but if you know what your doing just set<br/><br/>this to the path where the bin folder is for the version of Java you want to use<br/><br/>If you mess up, click the Reset button to go back to the default")
+ "</html>");
add(javaPathLabel, gbc);
gbc.gridx++;
@ -252,13 +254,13 @@ public class JavaSettingsTab extends AbstractSettingsTab implements Relocalizati
javaPath = new JTextField(32);
javaPath.setText(App.settings.getJavaPath());
javaPathResetButton = new JButton(Language.INSTANCE.localize("settings.javapathreset"));
javaPathResetButton = new JButton(GetText.tr("Reset"));
javaPathResetButton.addActionListener(e -> javaPath.setText(OS.getDefaultJavaPath()));
javaBrowseButton = new JButton(Language.INSTANCE.localize("common.browse"));
javaBrowseButton = new JButton(GetText.tr("Browse"));
javaBrowseButton.addActionListener(e -> {
JFileChooser chooser = new JFileChooser();
chooser.setCurrentDirectory(new File(javaPath.getText()));
chooser.setDialogTitle(Language.INSTANCE.localize("settings.selectjavapath"));
chooser.setDialogTitle(GetText.tr("Select"));
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
chooser.setAcceptAllFileFilterUsed(false);
@ -280,8 +282,8 @@ public class JavaSettingsTab extends AbstractSettingsTab implements Relocalizati
gbc.gridwidth = 1;
gbc.insets = LABEL_INSETS_SMALL;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
javaParametersLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.javaparameters") + ":",
HELP_ICON, Language.INSTANCE.localize("settings.javaparametershelp"));
javaParametersLabel = new JLabelWithHover(GetText.tr("Java Parameters") + ":", HELP_ICON,
GetText.tr("Extra Java command line paramaters can be added here."));
add(javaParametersLabel, gbc);
gbc.gridx++;
@ -291,7 +293,7 @@ public class JavaSettingsTab extends AbstractSettingsTab implements Relocalizati
javaParametersPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
javaParameters = new JTextField(40);
javaParameters.setText(App.settings.getJavaParameters());
javaParametersResetButton = new JButton(Language.INSTANCE.localize("settings.javapathreset"));
javaParametersResetButton = new JButton(GetText.tr("Reset"));
javaParametersResetButton.addActionListener(e -> javaParameters.setText(
"-XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M"));
javaParametersPanel.add(javaParameters);
@ -304,9 +306,9 @@ public class JavaSettingsTab extends AbstractSettingsTab implements Relocalizati
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
startMinecraftMaximisedLabel = new JLabelWithHover(
Language.INSTANCE.localize("settings.startminecraftmaximised") + "?", HELP_ICON,
Language.INSTANCE.localize("settings.startminecraftmaximisedhelp"));
startMinecraftMaximisedLabel = new JLabelWithHover(GetText.tr("Start Minecraft Maximised") + "?", HELP_ICON,
GetText.tr(
"Enabling this will start Minecraft maximised so that it takes up the full size of your screen."));
add(startMinecraftMaximisedLabel, gbc);
gbc.gridx++;
@ -324,8 +326,8 @@ public class JavaSettingsTab extends AbstractSettingsTab implements Relocalizati
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
saveCustomModsLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.savecustommods") + "?",
HELP_ICON, Language.INSTANCE.localize("settings.savecustommodshelp"));
saveCustomModsLabel = new JLabelWithHover(GetText.tr("Save Custom Mods") + "?", HELP_ICON, GetText
.tr("This enables the saving of custom mods added to an instance when it's updated or reinstalled."));
add(saveCustomModsLabel, gbc);
gbc.gridx++;
@ -343,9 +345,9 @@ public class JavaSettingsTab extends AbstractSettingsTab implements Relocalizati
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
ignoreJavaOnInstanceLaunchLabel = new JLabelWithHover(
Language.INSTANCE.localize("settings.ignorejavaoninstancelaunch") + "?", HELP_ICON,
Language.INSTANCE.localize("settings.ignorejavaoninstancelaunchhelp"));
ignoreJavaOnInstanceLaunchLabel = new JLabelWithHover(GetText.tr("Ignore Java checks On Launch") + "?",
HELP_ICON, GetText.tr(
"This enables ignoring errors when launching a pack that you don't have a compatable Java version for."));
add(ignoreJavaOnInstanceLaunchLabel, gbc);
gbc.gridx++;
@ -361,10 +363,9 @@ public class JavaSettingsTab extends AbstractSettingsTab implements Relocalizati
public boolean isValidJavaPath() {
File jPath = new File(javaPath.getText(), "bin");
if (!jPath.exists()) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("settings.help")).setContent("<html>"
+ Language.INSTANCE.localizeWithReplace("settings.javapathincorrect", "<br/><br/>") + "</html>")
.setType(DialogManager.ERROR).addOption(Language.INSTANCE.localize("instance.ivedownloaded"), true)
.show();
DialogManager.okDialog().setTitle(GetText.tr("Help")).setContent("<html>" + GetText.tr(
"The Java Path you set is incorrect.<br/><br/>Please verify it points to the folder where the bin folder is and try again.")
+ "</html>").setType(DialogManager.ERROR).show();
return false;
}
return true;
@ -374,11 +375,9 @@ public class JavaSettingsTab extends AbstractSettingsTab implements Relocalizati
if (javaParameters.getText().contains("-Xms") || javaParameters.getText().contains("-Xmx")
|| javaParameters.getText().contains("-XX:PermSize")
|| javaParameters.getText().contains("-XX:MetaspaceSize")) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("settings.help"))
.setContent("<html>"
+ Language.INSTANCE.localizeWithReplace("settings.javaparametersincorrect", "<br/><br/>")
+ "</html>")
.setType(DialogManager.ERROR).show();
DialogManager.okDialog().setTitle(GetText.tr("Help")).setContent("<html>" + GetText.tr(
"The entered Java Parameters were incorrect.<br/>Please remove any references to Xmx, Xms or XX:PermSize.")
+ "</html>").setType(DialogManager.ERROR).show();
return false;
}
return true;
@ -399,58 +398,62 @@ public class JavaSettingsTab extends AbstractSettingsTab implements Relocalizati
@Override
public String getTitle() {
return Language.INSTANCE.localize("settings.javatab");
return GetText.tr("Java/Minecraft");
}
@Override
public void onRelocalization() {
this.initialMemoryLabelWarning.setToolTipText("<html>"
+ Utils.splitMultilinedString(Language.INSTANCE.localize("settings.32bitmemorywarning"), 80, "<br/>")
this.initialMemoryLabelWarning.setToolTipText("<html>" + Utils.splitMultilinedString(GetText.tr(
"You are running a 32 bit Java and therefore cannot use more than 1GB of Ram. Please see http://atl.pw/32bit for help."),
80, "<br/>") + "</html>");
this.initialMemoryLabel.setText(GetText.tr("Initial Memory/Ram") + ":");
this.initialMemoryLabel.setToolTipText("<html>" + Utils.splitMultilinedString(GetText.tr(
"Initial memory/ram is the starting amount of memory/ram to use when starting Minecraft. This should be left at the default of 512 MB unless you know what your doing."),
80, "<br/>") + "</html>");
this.maximumMemoryLabelWarning.setToolTipText("<html>" + Utils.splitMultilinedString(GetText.tr(
"You are running a 32 bit Java and therefore cannot use more than 1GB of Ram. Please see http://atl.pw/32bit for help."),
80, "<br/>") + "</html>");
this.maximumMemoryLabel.setText(GetText.tr("Maximum Memory/Ram") + ":");
this.maximumMemoryLabel.setToolTipText("<html>" + Utils.splitMultilinedString(
GetText.tr("The maximum amount of memory/ram to allocate when starting Minecraft."), 80, "<br/>")
+ "</html>");
this.initialMemoryLabel.setText(Language.INSTANCE.localize("settings.initialmemory") + ":");
this.initialMemoryLabel.setToolTipText("<html>" + Utils.splitMultilinedString(
Language.INSTANCE.localize("settings" + ".initialmemoryhelp"), 80, "<br/>") + "</html>");
this.permGenLabel.setText(GetText.tr("PermGen Size") + ":");
this.permGenLabel
.setToolTipText(GetText.tr("The PermGen Size for java to use when launching Minecraft in MB."));
this.maximumMemoryLabelWarning.setToolTipText("<html>"
+ Utils.splitMultilinedString(Language.INSTANCE.localize("settings.32bitmemorywarning"), 80, "<br/>")
this.windowSizeLabel.setText(GetText.tr("Window Size") + ":");
this.windowSizeLabel.setToolTipText(
GetText.tr("The size that the Minecraft window should open as, Width x Height, in pixels."));
this.javaPathLabel.setText(GetText.tr("Java Path") + ":");
this.javaPathLabel.setToolTipText("<html>" + GetText.tr(
"This setting allows you to specify where your Java Path is.<br/><br/>This should be left as default, but if you know what your doing just set<br/><br/>this to the path where the bin folder is for the version of Java you want to use<br/><br/>If you mess up, click the Reset button to go back to the default")
+ "</html>");
this.maximumMemoryLabel.setText(Language.INSTANCE.localize("settings.maximummemory") + ":");
this.maximumMemoryLabel.setToolTipText("<html>"
+ Utils.splitMultilinedString(Language.INSTANCE.localize("settings.maximummemoryhelp"), 80, "<br/>")
+ "</html>");
this.javaPathResetButton.setText(GetText.tr("Reset"));
this.permGenLabel.setText(Language.INSTANCE.localize("settings.permgen") + ":");
this.permGenLabel.setToolTipText(Language.INSTANCE.localize("settings.permgenhelp"));
this.javaBrowseButton.setText(GetText.tr("Browse"));
this.windowSizeLabel.setText(Language.INSTANCE.localize("settings.windowsize") + ":");
this.windowSizeLabel.setToolTipText(Language.INSTANCE.localize("settings.windowsizehelp"));
this.javaParametersLabel.setText(GetText.tr("Java Parameters") + ":");
this.javaParametersLabel.setToolTipText(GetText.tr("Extra Java command line paramaters can be added here."));
this.javaPathLabel.setText(Language.INSTANCE.localize("settings.javapath") + ":");
this.javaPathLabel.setToolTipText(
"<html>" + Language.INSTANCE.localizeWithReplace("settings.javapathhelp", "<br/>") + "</html>");
this.javaParametersResetButton.setText(GetText.tr("Reset"));
this.javaPathResetButton.setText(Language.INSTANCE.localize("settings.javapathreset"));
this.startMinecraftMaximisedLabel.setText(GetText.tr("Start Minecraft Maximised") + "?");
this.startMinecraftMaximisedLabel.setToolTipText(GetText
.tr("Enabling this will start Minecraft maximised so that it takes up the full size of your screen."));
this.javaBrowseButton.setText(Language.INSTANCE.localize("common.browse"));
this.saveCustomModsLabel.setText(GetText.tr("Save Custom Mods") + "?");
this.saveCustomModsLabel.setToolTipText(GetText
.tr("This enables the saving of custom mods added to an instance when it's updated or reinstalled."));
this.javaParametersLabel.setText(Language.INSTANCE.localize("settings.javaparameters") + ":");
this.javaParametersLabel.setToolTipText(Language.INSTANCE.localize("settings.javaparametershelp"));
this.javaParametersResetButton.setText(Language.INSTANCE.localize("settings.javapathreset"));
this.startMinecraftMaximisedLabel.setText(Language.INSTANCE.localize("settings.startminecraftmaximised") + "?");
this.startMinecraftMaximisedLabel
.setToolTipText(Language.INSTANCE.localize("settings.startminecraftmaximisedhelp"));
this.saveCustomModsLabel.setText(Language.INSTANCE.localize("settings.savecustommods") + "?");
this.saveCustomModsLabel.setToolTipText(Language.INSTANCE.localize("settings.savecustommodshelp"));
this.ignoreJavaOnInstanceLaunchLabel
.setText(Language.INSTANCE.localize("settings.ignorejavaoninstancelaunch") + "?");
this.ignoreJavaOnInstanceLaunchLabel
.setToolTipText(Language.INSTANCE.localize("settings.ignorejavaoninstancelaunch"));
this.ignoreJavaOnInstanceLaunchLabel.setText(GetText.tr("Ignore Java checks On Launch") + "?");
this.ignoreJavaOnInstanceLaunchLabel.setToolTipText(GetText.tr(
"This enables ignoring errors when launching a pack that you don't have a compatable Java version for."));
}
public void addInstalledJavas() {

View file

@ -26,14 +26,13 @@ import javax.swing.SpinnerModel;
import javax.swing.SpinnerNumberModel;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import com.atlauncher.evnt.listener.RelocalizationListener;
import com.atlauncher.evnt.manager.RelocalizationManager;
import com.atlauncher.gui.components.JLabelWithHover;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public class LoggingSettingsTab extends AbstractSettingsTab implements RelocalizationListener {
public class LoggingSettingsTab extends AbstractSettingsTab {
private JLabelWithHover forgeLoggingLevelLabel;
private JComboBox<String> forgeLoggingLevel;
@ -54,16 +53,13 @@ public class LoggingSettingsTab extends AbstractSettingsTab implements Relocaliz
private JCheckBox enableOpenEyeReporting;
public LoggingSettingsTab() {
RelocalizationManager.addListener(this);
// Forge Logging Level
gbc.gridx = 0;
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
forgeLoggingLevelLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.forgelogginglevel") + ":",
HELP_ICON,
"<html>" + Language.INSTANCE.localizeWithReplace("settings.forgelogginglevelhelp", "<br/><br/>")
+ "</html>");
forgeLoggingLevelLabel = new JLabelWithHover(GetText.tr("Forge Logging Level") + ":", HELP_ICON, "<html>"
+ GetText.tr("This determines the type of logging that Forge should report back to you.") + "</html>");
add(forgeLoggingLevelLabel, gbc);
gbc.gridx++;
@ -86,8 +82,8 @@ public class LoggingSettingsTab extends AbstractSettingsTab implements Relocaliz
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
daysOfLogsToKeepLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.daysoflogstokeep") + ":",
HELP_ICON, Language.INSTANCE.localize("settings.daysoflogstokeephelp"));
daysOfLogsToKeepLabel = new JLabelWithHover(GetText.tr("Days Of Logs To Keep") + ":", HELP_ICON,
GetText.tr("This setting controls how many days worth of ATLauncher logs you wish to keep."));
add(daysOfLogsToKeepLabel, gbc);
daysOfLogsToKeepModel = new SpinnerNumberModel(App.settings.getDaysOfLogsToKeep(), 1, 30, 1);
@ -105,8 +101,8 @@ public class LoggingSettingsTab extends AbstractSettingsTab implements Relocaliz
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
enableLeaderboardsLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.leaderboards") + "?",
HELP_ICON, Language.INSTANCE.localize("settings.leaderboardshelp"));
enableLeaderboardsLabel = new JLabelWithHover(GetText.tr("Enable Leaderboards") + "?", HELP_ICON,
GetText.tr("If you want to participate in the Leaderboards."));
add(enableLeaderboardsLabel, gbc);
gbc.gridx++;
@ -127,8 +123,9 @@ public class LoggingSettingsTab extends AbstractSettingsTab implements Relocaliz
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
enableLoggingLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.logging") + "?", HELP_ICON,
"<html>" + Language.INSTANCE.localizeWithReplace("settings.logginghelp", "<br/>" + "</html>"));
enableLoggingLabel = new JLabelWithHover(GetText.tr("Enable Logging") + "?", HELP_ICON, "<html>" + GetText.tr(
"The Launcher sends back anonymous usage and error logs<br/>to our servers in order to make the Launcher and Packs<br/>better. If you don't want this to happen then simply<br/>disable this option.")
+ "</html>");
add(enableLoggingLabel, gbc);
gbc.gridx++;
@ -159,8 +156,10 @@ public class LoggingSettingsTab extends AbstractSettingsTab implements Relocaliz
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
enableAnalyticsLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.analytics") + "?", HELP_ICON,
"<html>" + Language.INSTANCE.localizeWithReplace("settings.analyticshelp", "<br/>") + "</html>");
enableAnalyticsLabel = new JLabelWithHover(GetText.tr("Enable Anonymous Analytics") + "?", HELP_ICON,
"<html>" + GetText.tr(
"The Launcher sends back anonymous analytics to Google Analytics<br/>in order to track what people do and don't use in the launcher.<br/>This helps determine what new features we implement in the future.<br/>All analytics are anonymous and contain no user/instance information in it at all.<br/>If you don't want to send anonymous analytics, you can disable this option.")
+ "</html>");
add(enableAnalyticsLabel, gbc);
gbc.gridx++;
@ -178,10 +177,10 @@ public class LoggingSettingsTab extends AbstractSettingsTab implements Relocaliz
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
enableOpenEyeReportingLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.openeye") + "?",
HELP_ICON,
"<html>" + Utils.splitMultilinedString(Language.INSTANCE.localize("settings.openeyehelp"), 80, "<br/>")
+ "</html>");
enableOpenEyeReportingLabel = new JLabelWithHover(GetText.tr("Enable OpenEye Reporting") + "?", HELP_ICON,
"<html>" + Utils.splitMultilinedString(GetText.tr(
"OpenEye is a mod/project created by the OpenMods team which aims to help gather statistics and crash logs from Minecraft in order to help users and modders discover and fix issues with mods. With the OpenEye mod installed (each ModPack chooses if they wish to install it or not, it's not installed by default to all packs by the Launcher) everytime Minecraft crashes the OpenEye report is sent to OpenEye for analysis and if a note from the modder has been added on the cause/fix it will be displayed to you. For more information please see http://openeye.openblocks.info"),
80, "<br/>") + "</html>");
add(enableOpenEyeReportingLabel, gbc);
gbc.gridx++;
@ -208,32 +207,6 @@ public class LoggingSettingsTab extends AbstractSettingsTab implements Relocaliz
@Override
public String getTitle() {
return Language.INSTANCE.localize("settings.loggingtab");
}
@Override
public void onRelocalization() {
this.forgeLoggingLevelLabel.setText(Language.INSTANCE.localize("settings" + ".forgelogginglevel") + ":");
this.forgeLoggingLevelLabel.setToolTipText("<html>"
+ Language.INSTANCE.localizeWithReplace("settings.forgelogginglevelhelp", "<br/><br/>") + "</html>");
this.daysOfLogsToKeepLabel.setText(Language.INSTANCE.localize("settings.daysoflogstokeep") + "?");
this.daysOfLogsToKeepLabel.setToolTipText(Language.INSTANCE.localize("settings.daysoflogstokeephelp"));
this.enableLeaderboardsLabel.setText(Language.INSTANCE.localize("settings.leaderboards") + "?");
this.enableLeaderboardsLabel.setToolTipText(Language.INSTANCE.localize("settings.leaderboardshelp"));
this.enableLoggingLabel.setText(Language.INSTANCE.localize("settings.logging") + "?");
this.enableLoggingLabel.setToolTipText(
"<html>" + Language.INSTANCE.localizeWithReplace("settings.logginghelp", "<br/>" + "</html>"));
this.enableAnalyticsLabel.setText(Language.INSTANCE.localize("settings.analytics") + "?");
this.enableAnalyticsLabel.setToolTipText(
"<html>" + Language.INSTANCE.localizeWithReplace("settings.analyticshelp", "<br/>" + "</html>"));
this.enableOpenEyeReportingLabel.setText(Language.INSTANCE.localize("settings.openeye") + "?");
this.enableOpenEyeReportingLabel.setToolTipText(
"<html>" + Utils.splitMultilinedString(Language.INSTANCE.localize("settings.openeyehelp"), 80, "<br/>")
+ "</html>");
return GetText.tr("Logging");
}
}

View file

@ -27,7 +27,6 @@ import javax.swing.JComboBox;
import javax.swing.JTextField;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import com.atlauncher.evnt.listener.RelocalizationListener;
import com.atlauncher.evnt.manager.RelocalizationManager;
import com.atlauncher.gui.components.JLabelWithHover;
@ -35,6 +34,8 @@ import com.atlauncher.gui.dialogs.ProgressDialog;
import com.atlauncher.managers.DialogManager;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public class NetworkSettingsTab extends AbstractSettingsTab implements RelocalizationListener {
private JLabelWithHover concurrentConnectionsLabel;
@ -59,10 +60,8 @@ public class NetworkSettingsTab extends AbstractSettingsTab implements Relocaliz
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
concurrentConnectionsLabel = new JLabelWithHover(
Language.INSTANCE.localize("settings.concurrentconnections") + ":", HELP_ICON,
"<html>" + Language.INSTANCE.localizeWithReplace("settings.concurrentconnectionshelp", "<br/><br/>")
+ "</html>");
concurrentConnectionsLabel = new JLabelWithHover(GetText.tr("Concurrent Connections") + ":", HELP_ICON, "<html>"
+ GetText.tr("This determines how many connections will be made when downloading files.") + "</html>");
add(concurrentConnectionsLabel, gbc);
gbc.gridx++;
@ -78,8 +77,8 @@ public class NetworkSettingsTab extends AbstractSettingsTab implements Relocaliz
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
enableProxyLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.enableproxy") + "?", HELP_ICON,
Language.INSTANCE.localize("settings.enableproxyhelp"));
enableProxyLabel = new JLabelWithHover(GetText.tr("Enable Proxy") + "?", HELP_ICON,
GetText.tr("If you use a proxy to connect to the internet you can enable it here."));
add(enableProxyLabel, gbc);
gbc.gridx++;
@ -107,8 +106,8 @@ public class NetworkSettingsTab extends AbstractSettingsTab implements Relocaliz
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
proxyHostLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.proxyhost") + ":", HELP_ICON,
Language.INSTANCE.localize("settings.proxyhosthelp"));
proxyHostLabel = new JLabelWithHover(GetText.tr("Proxy Host") + ":", HELP_ICON,
GetText.tr("This is the IP/hostname used to connect to the proxy."));
add(proxyHostLabel, gbc);
gbc.gridx++;
@ -126,8 +125,8 @@ public class NetworkSettingsTab extends AbstractSettingsTab implements Relocaliz
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
proxyPortLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.proxyport") + ":", HELP_ICON,
Language.INSTANCE.localize("settings.proxyporthelp"));
proxyPortLabel = new JLabelWithHover(GetText.tr("Proxy Port") + ":", HELP_ICON,
GetText.tr("This is the port used to connect to the proxy."));
add(proxyPortLabel, gbc);
gbc.gridx++;
@ -145,8 +144,8 @@ public class NetworkSettingsTab extends AbstractSettingsTab implements Relocaliz
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
proxyTypeLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.proxytype") + ":", HELP_ICON,
Language.INSTANCE.localize("settings.proxytypehelp"));
proxyTypeLabel = new JLabelWithHover(GetText.tr("Proxy Type") + ":", HELP_ICON,
GetText.tr("This is the type of connection the proxy uses. Either HTTP, SOCKS or DIRECT."));
add(proxyTypeLabel, gbc);
gbc.gridx++;
@ -165,8 +164,9 @@ public class NetworkSettingsTab extends AbstractSettingsTab implements Relocaliz
public boolean isValidConcurrentConnections() {
if (Integer.parseInt(concurrentConnections.getText().replaceAll("[^0-9]", "")) < 1) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("settings.help"))
.setContent(Language.INSTANCE.localize("settings.concurrentconnectionsinvalid"))
DialogManager.okDialog().setTitle(GetText.tr("Help"))
.setContent(GetText
.tr("The concurrent connections you specified is invalid. Please check it and try again."))
.setType(DialogManager.ERROR).show();
return false;
}
@ -179,9 +179,9 @@ public class NetworkSettingsTab extends AbstractSettingsTab implements Relocaliz
}
if (proxyPort.getText().isEmpty() || Integer.parseInt(proxyPort.getText().replaceAll("[^0-9]", "")) < 1
|| Integer.parseInt(proxyPort.getText().replaceAll("[^0-9]", "")) > 65535) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("settings.help"))
.setContent(Language.INSTANCE.localize("settings.proxyportinvalid")).setType(DialogManager.ERROR)
.show();
DialogManager.okDialog().setTitle(GetText.tr("Help"))
.setContent(GetText.tr("The port you specified is invalid. Please check it and try again."))
.setType(DialogManager.ERROR).show();
return false;
}
return true;
@ -207,8 +207,8 @@ public class NetworkSettingsTab extends AbstractSettingsTab implements Relocaliz
}
final Type theType = type;
final ProgressDialog dialog = new ProgressDialog(Language.INSTANCE.localize("settings.checkingproxytitle"), 0,
Language.INSTANCE.localize("settings.checkingproxy"), "Cancelled Proxy " + "Test!");
final ProgressDialog dialog = new ProgressDialog(GetText.tr("Checking Proxy"), 0,
GetText.tr("Checking the proxy entered."), "Cancelled Proxy Test!");
dialog.addThread(new Thread(() -> {
dialog.setReturnValue(Utils.testProxy(new Proxy(theType, new InetSocketAddress(proxyHost.getText(),
Integer.parseInt(proxyPort.getText().replaceAll("[^0-9]", ""))))));
@ -221,9 +221,9 @@ public class NetworkSettingsTab extends AbstractSettingsTab implements Relocaliz
}
if (!(Boolean) dialog.getReturnValue()) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("settings.help"))
.setContent(Language.INSTANCE.localize("settings.proxycannotconnect")).setType(DialogManager.ERROR)
.show();
DialogManager.okDialog().setTitle(GetText.tr("Help"))
.setContent(GetText.tr("Cannot connect to proxy. Please check the settings and try again."))
.setType(DialogManager.ERROR).show();
return false;
}
@ -243,26 +243,27 @@ public class NetworkSettingsTab extends AbstractSettingsTab implements Relocaliz
@Override
public String getTitle() {
return Language.INSTANCE.localize("settings.networktab");
return GetText.tr("Network");
}
@Override
public void onRelocalization() {
this.concurrentConnectionsLabel.setText(Language.INSTANCE.localize("settings.concurrentconnections") + ":");
this.concurrentConnectionsLabel.setToolTipText(
"<html>" + Language.INSTANCE.localizeWithReplace("settings.concurrentconnectionshelp", "<br/><br/>")
+ "</html>");
this.concurrentConnectionsLabel.setText(GetText.tr("Concurrent Connections") + ":");
this.concurrentConnectionsLabel.setToolTipText("<html>"
+ GetText.tr("This determines how many connections will be made when downloading files.") + "</html>");
this.enableProxyLabel.setText(Language.INSTANCE.localize("settings.enableproxy") + "?");
this.enableProxyLabel.setToolTipText(Language.INSTANCE.localize("settings.enableproxyhelp"));
this.enableProxyLabel.setText(GetText.tr("Enable Proxy") + "?");
this.enableProxyLabel
.setToolTipText(GetText.tr("If you use a proxy to connect to the internet you can enable it here."));
this.proxyHostLabel.setText(Language.INSTANCE.localize("settings.proxyhost") + ":");
this.proxyHostLabel.setToolTipText(Language.INSTANCE.localize("settings.proxyhosthelp"));
this.proxyHostLabel.setText(GetText.tr("Proxy Host") + ":");
this.proxyHostLabel.setToolTipText(GetText.tr("This is the IP/hostname used to connect to the proxy."));
this.proxyPortLabel.setText(Language.INSTANCE.localize("settings.proxyport") + ":");
this.proxyPortLabel.setToolTipText(Language.INSTANCE.localize("settings.proxyporthelp"));
this.proxyPortLabel.setText(GetText.tr("Proxy Port") + ":");
this.proxyPortLabel.setToolTipText(GetText.tr("This is the port used to connect to the proxy."));
this.proxyTypeLabel.setText(Language.INSTANCE.localize("settings.proxytype") + ":");
this.proxyTypeLabel.setToolTipText(Language.INSTANCE.localize("settings.proxytypehelp"));
this.proxyTypeLabel.setText(GetText.tr("Proxy Type") + ":");
this.proxyTypeLabel.setToolTipText(
GetText.tr("This is the type of connection the proxy uses. Either HTTP, SOCKS or DIRECT."));
}
}

View file

@ -23,13 +23,14 @@ import javax.swing.JCheckBox;
import javax.swing.JTextField;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import com.atlauncher.evnt.listener.RelocalizationListener;
import com.atlauncher.evnt.manager.RelocalizationManager;
import com.atlauncher.gui.components.JLabelWithHover;
import com.atlauncher.managers.DialogManager;
import com.atlauncher.utils.Utils;
import org.mini2Dx.gettext.GetText;
@SuppressWarnings("serial")
public class ToolsSettingsTab extends AbstractSettingsTab implements RelocalizationListener {
private JLabelWithHover enableServerCheckerLabel;
@ -45,9 +46,8 @@ public class ToolsSettingsTab extends AbstractSettingsTab implements Relocalizat
gbc.gridy = 0;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
enableServerCheckerLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.serverchecker") + "?",
HELP_ICON,
"<html>" + Language.INSTANCE.localizeWithReplace("settings.servercheckerhelp", "<br/>" + "</html>"));
enableServerCheckerLabel = new JLabelWithHover(GetText.tr("Enable Server Checker") + "?", HELP_ICON, GetText
.tr("This setting enables or disables the checking of added servers in the Server Checker Tool."));
add(enableServerCheckerLabel, gbc);
gbc.gridx++;
@ -71,10 +71,10 @@ public class ToolsSettingsTab extends AbstractSettingsTab implements Relocalizat
gbc.gridy++;
gbc.insets = LABEL_INSETS;
gbc.anchor = GridBagConstraints.BASELINE_TRAILING;
serverCheckerWaitLabel = new JLabelWithHover(Language.INSTANCE.localize("settings.servercheckerwait") + ":",
HELP_ICON,
"<html>" + Utils.splitMultilinedString(Language.INSTANCE.localize("settings.servercheckerwaithelp"), 75,
"<br/>") + "</html>");
serverCheckerWaitLabel = new JLabelWithHover(GetText.tr("Time Between Checks") + ":", HELP_ICON,
"<html>" + Utils.splitMultilinedString(GetText.tr(
"This option controls how long the launcher should wait between checking servers in the server checker. This value is in minutes and should be between 1 and 30, with the default being 5."),
75, "<br/>") + "</html>");
add(serverCheckerWaitLabel, gbc);
gbc.gridx++;
@ -91,8 +91,9 @@ public class ToolsSettingsTab extends AbstractSettingsTab implements Relocalizat
public boolean isValidServerCheckerWait() {
if (Integer.parseInt(serverCheckerWait.getText().replaceAll("[^0-9]", "")) < 1
|| Integer.parseInt(serverCheckerWait.getText().replaceAll("[^0-9]", "")) > 30) {
DialogManager.okDialog().setTitle(Language.INSTANCE.localize("settings.help"))
.setContent(Language.INSTANCE.localize("settings.servercheckerwaitinvalid"))
DialogManager.okDialog().setTitle(GetText.tr("Help"))
.setContent(GetText.tr(
"The server checker wait time you specified is invalid. Please check it and try again."))
.setType(DialogManager.ERROR).show();
return false;
}
@ -111,18 +112,18 @@ public class ToolsSettingsTab extends AbstractSettingsTab implements Relocalizat
@Override
public String getTitle() {
return Language.INSTANCE.localize("tabs.tools");
return GetText.tr("Tools");
}
@Override
public void onRelocalization() {
this.enableServerCheckerLabel.setText(Language.INSTANCE.localize("settings.serverchecker") + "?");
this.enableServerCheckerLabel.setToolTipText(
"<html>" + Language.INSTANCE.localizeWithReplace("settings.servercheckerhelp", "<br/>" + "</html>"));
this.enableServerCheckerLabel.setText(GetText.tr("Enable Server Checker") + "?");
this.enableServerCheckerLabel.setToolTipText(GetText
.tr("This setting enables or disables the checking of added servers in the Server Checker Tool."));
this.serverCheckerWaitLabel.setText(Language.INSTANCE.localize("settings.servercheckerwait") + ":");
this.serverCheckerWaitLabel.setToolTipText("<html>"
+ Utils.splitMultilinedString(Language.INSTANCE.localize("settings.servercheckerwaithelp"), 75, "<br/>")
+ "</html>");
this.serverCheckerWaitLabel.setText(GetText.tr("Time Between Checks") + ":");
this.serverCheckerWaitLabel.setToolTipText("<html>" + Utils.splitMultilinedString(GetText.tr(
"This option controls how long the launcher should wait between checking servers in the server checker. This value is in minutes and should be between 1 and 30, with the default being 5."),
75, "<br/>") + "</html>");
}
}

View file

@ -25,7 +25,8 @@ import javax.swing.Icon;
import javax.swing.JOptionPane;
import com.atlauncher.App;
import com.atlauncher.data.Language;
import org.mini2Dx.gettext.GetText;
public final class DialogManager {
public static final int OPTION_TYPE = 0;
@ -73,7 +74,7 @@ public final class DialogManager {
public static DialogManager okDialog() {
DialogManager dialog = new DialogManager(DialogManager.CONFIRM_TYPE);
dialog.addOption(Language.INSTANCE.localize("common.ok"), true);
dialog.addOption(GetText.tr("Ok"), true);
return dialog;
}
@ -81,8 +82,8 @@ public final class DialogManager {
public static DialogManager okCancelDialog() {
DialogManager dialog = new DialogManager(DialogManager.CONFIRM_TYPE);
dialog.addOption(Language.INSTANCE.localize("common.ok"), true);
dialog.addOption(Language.INSTANCE.localize("common.cancel"));
dialog.addOption(GetText.tr("Ok"), true);
dialog.addOption(GetText.tr("Cancel"));
return dialog;
}
@ -90,8 +91,8 @@ public final class DialogManager {
public static DialogManager yesNoDialog() {
DialogManager dialog = new DialogManager(DialogManager.CONFIRM_TYPE);
dialog.addOption(Language.INSTANCE.localize("common.yes"), true);
dialog.addOption(Language.INSTANCE.localize("common.no"));
dialog.addOption(GetText.tr("Yes"), true);
dialog.addOption(GetText.tr("No"));
return dialog;
}

View file

@ -39,7 +39,6 @@ import com.atlauncher.data.DisableableMod;
import com.atlauncher.data.Instance;
import com.atlauncher.data.InstanceV2;
import com.atlauncher.data.InstanceV2Launcher;
import com.atlauncher.data.Language;
import com.atlauncher.data.json.Delete;
import com.atlauncher.data.json.Deletes;
import com.atlauncher.data.json.DownloadType;
@ -70,6 +69,7 @@ import com.atlauncher.utils.Utils;
import com.atlauncher.utils.walker.CaseFileVisitor;
import com.google.gson.reflect.TypeToken;
import org.mini2Dx.gettext.GetText;
import org.zeroturnaround.zip.ZipUtil;
import okhttp3.OkHttpClient;
@ -195,7 +195,7 @@ public class InstanceInstaller extends SwingWorker<Boolean, Void> implements Net
private void downloadPackVersionJson() {
addPercent(5);
fireTask(Language.INSTANCE.localize("instance.downloadingpackverisondefinition"));
fireTask(GetText.tr("Downloading Pack Version Definition"));
fireSubProgressUnknown();
this.packVersion = com.atlauncher.network.Download.build().cached()
@ -208,7 +208,7 @@ public class InstanceInstaller extends SwingWorker<Boolean, Void> implements Net
private void downloadMinecraftVersionJson() throws Exception {
addPercent(5);
fireTask(Language.INSTANCE.localize("instance.downloadingminecraftdefinition"));
fireTask(GetText.tr("Downloading Minecraft Definition"));
fireSubProgressUnknown();
VersionManifest versionManifest = com.atlauncher.network.Download.build().cached()
@ -232,7 +232,7 @@ public class InstanceInstaller extends SwingWorker<Boolean, Void> implements Net
private void downloadLoader() throws Exception {
addPercent(5);
fireTask(Language.INSTANCE.localize("instance.downloadingloader"));
fireTask(GetText.tr("Downloading Loader"));
fireSubProgressUnknown();
this.loader.downloadAndExtractInstaller();
@ -538,7 +538,7 @@ public class InstanceInstaller extends SwingWorker<Boolean, Void> implements Net
return;
}
fireTask(Language.INSTANCE.localize("instance.downloadingresources"));
fireTask(GetText.tr("Downloading Resources"));
fireSubProgressUnknown();
this.totalBytes = this.downloadedBytes = 0;
@ -584,7 +584,7 @@ public class InstanceInstaller extends SwingWorker<Boolean, Void> implements Net
private void downloadMinecraft() throws Exception {
addPercent(5);
fireTask(Language.INSTANCE.localize("instance.downloadingminecraft"));
fireTask(GetText.tr("Downloading Minecraft"));
fireSubProgressUnknown();
totalBytes = 0;
downloadedBytes = 0;
@ -626,7 +626,7 @@ public class InstanceInstaller extends SwingWorker<Boolean, Void> implements Net
return;
}
fireTask(Language.INSTANCE.localize("instance.downloadingloggingconfig"));
fireTask(GetText.tr("Downloading Logging Client"));
fireSubProgressUnknown();
LoggingFile loggingFile = this.minecraftVersion.logging.client.file;
@ -733,7 +733,7 @@ public class InstanceInstaller extends SwingWorker<Boolean, Void> implements Net
private void downloadLibraries() {
addPercent(5);
fireTask(Language.INSTANCE.localize("instance.downloadinglibraries"));
fireTask(GetText.tr("Downloading Libraries"));
fireSubProgressUnknown();
OkHttpClient httpClient = Network.createProgressClient(this);
@ -784,7 +784,7 @@ public class InstanceInstaller extends SwingWorker<Boolean, Void> implements Net
private void organiseLibraries() {
addPercent(5);
fireTask(Language.INSTANCE.localize("instance.organisinglibraries"));
fireTask(GetText.tr("Organising Libraries"));
fireSubProgressUnknown();
if (isServer) {
@ -841,7 +841,7 @@ public class InstanceInstaller extends SwingWorker<Boolean, Void> implements Net
return;
}
fireTask(Language.INSTANCE.localize("instance.installingloader"));
fireTask(GetText.tr("Installing Loader"));
fireSubProgressUnknown();
// run any processors that the loader needs
@ -857,7 +857,7 @@ public class InstanceInstaller extends SwingWorker<Boolean, Void> implements Net
return;
}
fireTask(Language.INSTANCE.localize("instance.downloadingmods"));
fireTask(GetText.tr("Downloading Mods"));
fireSubProgressUnknown();
OkHttpClient httpClient = Network.createProgressClient(this);
@ -890,7 +890,7 @@ public class InstanceInstaller extends SwingWorker<Boolean, Void> implements Net
return;
}
fireTask(Language.INSTANCE.localize("instance.installingmods"));
fireTask(GetText.tr("Installing Mods"));
fireSubProgressUnknown();
double subPercentPerMod = 100.0 / this.selectedMods.size();
@ -933,7 +933,7 @@ public class InstanceInstaller extends SwingWorker<Boolean, Void> implements Net
return;
}
fireTask(Language.INSTANCE.localize("instance.downloadingconfigs"));
fireTask(GetText.tr("Downloading Configs"));
File configs = this.temp.resolve("Configs.zip").toFile();
String path = "packs/" + pack.getSafeName() + "/versions/" + version.version + "/Configs.zip";
@ -955,7 +955,7 @@ public class InstanceInstaller extends SwingWorker<Boolean, Void> implements Net
}
fireSubProgressUnknown();
fireTask(Language.INSTANCE.localize("instance.extractingconfigs"));
fireTask(GetText.tr("Extracting Configs"));
ZipUtil.unpack(configs, this.root.toFile());
Utils.delete(configs);

View file

@ -1,414 +0,0 @@
account.add=Add An Account
account.added=Account Added
account.addedswitch=Account Added Successfully. Switch to it now?
account.checkingtoken=Checking Access Token
account.delete=Delete Account
account.deletesure=Are you sure you want to delete the user %s?
account.downloadingminecraftskin=Downloading Skin For %s
account.downloadingskin=Downloading Skin
account.edited=Account Edited
account.editeddone=Account Edited Successfully
account.exists=This account already exists
account.incorrect=Account not added as login details were incorrect
account.loggingin=Logging Into Minecraft
account.notadded=Account Not Added
account.offlinemode=Cannot change/add account as you're in offline mode. Please connect to the internet and try again
account.password=Password
account.refreshingtoken=Refreshing Access Token
account.reloadskin=Reload Skin
account.remember=Remember Password
account.rememberpasswordwarning=WARNING: By clicking Remember Password you potentially expose your password to bad people.%sThis saves your encrypted password to disk and can be decrypted by bad people.%sAre you sure you want to do this?
account.removepasswords=Remove Passwords
account.securitywarning=WARNING: You have accounts added with a remembered password.%s%sThis can possibly expose your password to bad people. To remove this please go to the%sAccounts tab and edit the account with the Remember Password box unticked.%s%sAlternatively click the Remove Passwords button below to remove them immediately.
account.securitywarningtitle=Security Warning
account.select=Select An Account
account.skinerror=Error downloading skin. Please try again later!
account.username=Username
account.usernameemail=Email\\/Username
account.infotext=In order to login and use ATLauncher modpacks, you must authenticate with your existing Minecraft/Mojang account. You must own and have paid for the Minecraft Java edition (not the Windows 10 edition) and use the same login here.<br><br>If you don't have an existing account, you can get one <a href="https://my.minecraft.net/en-us/store/minecraft/#register">by buying Minecraft here</a>. The launcher doesn't work with cracked accounts.
addon.nodisplay=There are no addons to display.%sPlease check back another time.
backup.backingup=Backing Up %s
backup.backupcomplete=Backup is complete. Your backup was saved to the following location:%s
backup.complete=Backup Complete
backup.dialog.title=Backup & Restore
backup.label.autobackup=Auto Backup
backup.label.autobackup.tooltip=Whether a backup should be created on instance close
backup.label.backupchoose=Choose world to backup
backup.label.notify=Popup on Success
backup.label.notify.tooltip=Create a notification dialog if a backup or restore has been successfully done
backup.label.restorechoose=Choose backup to restore
backup.message.backupexists=A backup with the name %s already exists!
backup.message.backupexists.title=Backup Already Exists
backup.message.backupfailed=Failed to create the backup!
backup.message.backupfailed.missingdirectory=Unable to find the correct save directory for the backup!
backup.message.backupfailed.title=Backup Failed
backup.message.backupname=Enter a name for the backup
backup.message.backupname.title=Backup Name
backup.message.backupoverwrite=A folder with the name %s already exists. Are you sure you wish to overwrite?
backup.message.backupoverwrite.title=Confirm Overwrite
backup.message.deleteconfirm=Deleting a backup is not reversible! Are you sure you wish to delete %s?
backup.message.deleteconfirm.title=Delete Confirm
backup.message.restoresuccess=Restoration complete!
backup.message.restoresuccess.title=Restore Success
backup.nosaves=Can't backup instance as no saves were found
backup.nosavestitle=No Saves Found
backup.sure=Backups saves all your worlds so you can restore them later or just keep a backup%sOnce backed up you can find the zip file in the Backups/ folder%sDo you want to backup this instance?
backup.tab.backup.tooltip=Create a Backup
backup.tab.restore.tooltip=Restore a backup
backup.tab.settings.tooltip=Edit settings
common.add=Add
common.view=View
common.backup=Backup
common.cancel=Cancel
common.checkingforupdates=Checking For Updates
common.clear=Clear
common.close=Close
common.copy=Copy
common.createserver=Create Server
common.delete=Delete
common.download=Download
common.downloading=Downloading
common.extracting=Extracting
common.addmods=Add Mods
common.edit=Edit
common.editmods=Edit Mods
common.error=Error
common.success=Success
common.forcequit=Force Quit
common.hasbeen=Has Been
common.install=Install
common.installed=Installed
common.installing=Installing
common.mod=Mod
common.moreinfo=More Info
common.newinstance=New Instance
common.no=No
common.not=Not
common.nothingtoshow=Nothing To Show
common.offline=Your In Offline Mode
common.ok=Ok
common.opencrashreport=Open Crash Report
common.openfolder=Open Folder
common.play=Play
common.quit=Quit
common.reinstall=Reinstall
common.reinstalled=Reinstalled
common.reinstalling=Reinstalling
common.rename=Rename
common.renaming=Renaming %s
common.restore=Restore
common.save=Save
common.search=Search
common.select=Select
common.server=Server
common.support=Support
common.tasksdone=Tasks Done
common.update=Update
common.updatedata=Update Data
common.wasnt=Wasn't
common.website=Website
common.yes=Yes
common.browse=Browse
common.downloadingupdates=Downloading Updates
console.clear=Clear
console.copy=Copy Log
console.hide=Hide Console
console.kill=Kill Minecraft
console.killsure=Are you sure you want to kill the Minecraft process?%sDoing so can cause corruption of your saves
console.show=Show Console
console.upload=Upload Log
console.uploadinglog=Uploading Log
dropbox.button.location=Choose Dropbox location
dropbox.label.location=Please select Dropbox folder
dropbox.notfound.title=Dropbox Folder Not Found
instance.aboutyourcrash=About your Crash
instance.actioncancelled=Action was cancelled by user
instance.addmod=Add Mod
instance.alreadyinstance=There is already an instance called %s Rename it and try again
instance.alreadyinstance1=There is already an instance called %s Do you want to delete that instance and install this pack?
instance.browseropened=Browser opened to download file %s
instance.cannotcreate=Cannot create instance as you have no Account selected
instance.cantreinstall=Cannot reinstall pack as you have no Account selected
instance.cantupdate=Cannot update pack as you have no Account selected
instance.changeimage=Change Image
instance.checkerrorlogs=Check error logs for the error
instance.clearall=Clear All
instance.clone=Clone
instance.clonedsuccessfully=Cloned Instance %s Successfully
instance.cloneenter=Enter a new name for this cloned instance
instance.clonetitle=Cloning Instance
instance.cloninginstance=Cloning Instance. Please wait...
instance.corrupt=Instance Corrupt
instance.corruptbackup=Cannot backup instance as it's corrupted. Please reinstall, update or delete it
instance.corruptclone=Cannot clone instance as it's corrupted. Please reinstall, update or delete it
instance.corruptplay=Cannot play instance as it's corrupted. Please reinstall, update or delete it
instance.createshortcut=Create Shortcut
instance.deletedsuccessfully=Deleted Instance %s Successfully
instance.deleteinstance=Delete Instance
instance.deletesure=Are you sure you want to delete this instance?
instance.deletetitle=Deleting Instance
instance.deletinginstance=Deleting Instance. Please wait...
instance.disabledmods=Disabled Mods
instance.disablemod=Disable Mod
instance.dontremindmeagain=Don't Remind Me Again
instance.downloadingpackverisondefinition=Downloading Pack Version Definition
instance.downloadingminecraftdefinition=Downloading Minecraft Definition
instance.downloadingminecraft=Downloading Minecraft
instance.downloadingloggingconfig=Downloading Logging Client
instance.downloadingconfigs=Downloading Configs
instance.downloadingloader=Downloading Loader
instance.downloadingloaderlibraries=Downloading Loader Libraries
instance.installingloader=Installing Loader (May Take A While)
instance.downloadinglibraries=Downloading Libraries
instance.downloadingmods=Downloading Mods
instance.installingmods=Installing Mods
instance.downloadingresources=Downloading Resources (May Take A While)
instance.addingmods=Adding Mods For %s
instance.editingmods=Editing Mods For %s
instance.enabledmods=Enabled Mods
instance.enablemod=Enable Mod
instance.enterpassword=Enter password for %s
instance.enterpasswordtitle=Enter Password
instance.errorclone=An error occurred while cloning the instance %sPlease check the console and try again
instance.errorloggingin=Couldn't login to minecraft servers%s
instance.errorloggingintitle=Error Logging in
instance.errorrenaming=An error occurred renaming the instance %sPlease check the console and try again
instance.extractingconfigs=Extracting Configs
instance.findit=Find it in your 'Instances' tab
instance.finditserver=Server Installed. Find it in the below directory:%s
instance.hasupdate=Has Update
instance.installjustforme=Install Just For Me
instance.insufficientpermgen=This pack has set a minimum amount of PermGen to %sDo you want to continue loading the instance regardless?
instance.insufficientpermgentitle=Insufficient PermGen
instance.insufficientram=This pack has set a minimum amount of Ram to %sDo you want to continue loading the instance regardless?
instance.insufficientramtitle=Insufficient Ram
instance.invalidname=The name %s is invalid. It must contain at least 1 letter or number.
instance.ivedownloaded=I've Downloaded This File
instance.moddescription=Mod Description
instance.name=Instance Name
instance.noaccount=Cannot play instance as you have no Account selected
instance.noaccountselected=No Account Selected
instance.nodisplay=There are no instances to display.%sPlease check back another time.
instance.nolongerplayable=Instance is no longer playable
instance.notauthorized=Not Authorized
instance.notauthorizedplay=You are not authorized to play this pack
instance.notauthorizedplaydev=You cannot play dev versions of this pack.%sPlease reinstall this instance to be able to play it again
instance.offlinereinstall=Cannot reinstall instance as you're in offline mode. Please connect to the internet and try again
instance.offlineupdate=Cannot update instance as you're in offline mode. Please connect to the internet and try again
instance.openeyehasnote=A note attached to the crash can be seen below:
instance.openeyenonote=There is no note attached to this crash.
instance.openeyereport1=We detected a previous unreported crash generated by the OpenEye mod.%sThis has now been sent off to OpenEye and you can open the crash report below or continue without viewing it.%s
instance.openeyereport2=You can turn this off by unchecking the OpenEye Reporting setting in the Settings tab. Click Ok to continue.
instance.optionalmods=Optional Mods
instance.organisinglibraries=Organising Libraries
instance.pleasesave=Please save this file to the following location
instance.preparingforlaunch=Preparing For Launch
instance.removemod=Remove Mod
instance.rename=Rename
instance.renaminginstance=Renaming Instance
instance.requiredmods=Required Mods
instance.selectall=Select All
instance.selectmods=Select Mods To Install
instance.selectmodtype=Select Mod Type
instance.selectrecommended=Select Recommended
instance.startingprocess=Starting %s Process
instance.typeofmod=Type Of Mod
instance.updateavailable=Update Available
instance.updatenow=An update is available for this instance%sDo you want to update now?
instance.uselatestlwjgl=Use Latest LWJGL
instance.versiontoinstall=Version To Install
instance.loaderversion=Loader Version
instance.gettingloaderversions=Getting loader versions...
instance.warning=Warning
instance.warningsure=Are you sure you want to enable this mod?
instance.zippingresourcepackfiles=Zipping Resource Pack Files
instance.zippingtexturepackfiles=Zipping Texture Pack Files
instance.incorrectjavatitle=Cannot launch instance due to your Java version
instance.incorrectjava=There was an issue launching this instance.%sThis version of the pack requires a Java version which you are not using.%sPlease install that version of Java and try again.%sJava version needed:
pack.addpack=Add Pack
pack.cancreateserver=Can Create Server
pack.collapseall=Collapse All
pack.dev=Dev
pack.expandall=Expand All
pack.mods=Mods in %s
pack.nodescription=No Description
pack.nodisplay=There are no packs to display.%sPlease check back another time.
pack.offlinecreateserver=Cannot create server as you're in offline mode. Please connect to the internet and try again
pack.offlinenewinstance=Cannot create new instance as you're in offline mode. Please connect to the internet and try again
pack.packadded=Pack Added
pack.packaddederror=Error Adding Pack
pack.packaddedmessage=The pack has been added!
pack.packalreadyadded=Pack Already Added
pack.packalreadyaddedmessage=The pack was already added!
pack.packcode=Pack Code
pack.packdoesntexist=A pack with that code doesn't exist!
pack.private=Private
pack.privatepacksonly=Private Packs Only
pack.public=Public
pack.removepack=Remove Pack
pack.searchdescription=Search Description
pack.semipublic=Semi Public
pack.viewmods=View Mods
server.extractingjar=Extracting Minecraft.jar
server.zippingjar=Zipping Minecraft.jar
settings.32bitmemorywarning=You are running a 32 bit Java and therefore cannot use more than 1GB of Ram. Please see http://atl.pw/32bit for help.
settings.advancedbackup=Advanced Backup
settings.advancedbackuphelp=Advanced Backup allows you to backup, restore and sync you instances%ssaves with a selected service such as DropBox%s%sIf unchecked then the standard Backup will save your instances%ssaves folder to a zip in the location of your choice
settings.checkingproxy=Checking the proxy entered
settings.checkingproxytitle=Checking Proxy
settings.concurrentconnections=Concurrent Connections
settings.concurrentconnectionshelp=This determines how many connections will be made when downloading a list of file.%sLeave at the default of 8 if you don't know what your doing.
settings.concurrentconnectionsinvalid=The concurrent connections you specified is invalid. Please check it and try again
settings.connectiontimeout=Connection Timeout
settings.connectiontimeouthelp=This is the amount of time in seconds the launcher should wait when connecting to a server%sLeaving this as the default of 10 is recommended and shouldn't be changed unless you notice alot of connection timeout issues
settings.connectiontimeoutinvalid=The connection timeout you specified is invalid. Please check it and try again
settings.console=Enable Console
settings.consolehelp=If you want the console to be visible when opening the Launcher.
settings.dateformat=Date Format
settings.dateformathelp=This controls the format that dates are displayed in the launcher with the value dd meaning the day, M being the month and yyy being the year.
settings.daysoflogstokeep=Days Of Logs To Keep
settings.daysoflogstokeephelp=This setting controls how many days worth of ATLauncher logs you wish to keep.
settings.debugconsole=Enable Debug Console
settings.debugconsolehelp=When selected this option will log more information to the console for debugging purposes
settings.disabletimeout=Disable Timeout
settings.disabletimeouthelp=This option disables the timeout period and instructs the launcher to wait an unlimited amount of time to make a connection to servers.
settings.downloadserver=Download Server
settings.downloadserverhelp=The server to download files from. Keep on Auto for best results.
settings.enableproxy=Enable Proxy
settings.enableproxyhelp=If you use a proxy to connect to the internet you can enable it here
settings.forgelogginglevel=Forge Logging Level
settings.forgelogginglevelhelp=This determins the type of logging that Forge should report back to you.%sThis should be left at the default of INFO
settings.generaltab=General
settings.help=Help
settings.initialmemory=Initial Memory/Ram
settings.initialmemoryhelp=Initial memory/ram is the starting amount of memory/ram to use when starting Minecraft. This should be left at the default of 512 MB unless you know what your doing.
settings.initialmemorytoohigh=The Initial Memory/Ram setting must be lower than your Maximum Memory/Ram setting!
settings.java9warning=You're using Java 9 or newer! Older modpacks may not work.%sIf you have issues playing some packs, you may need to install Java 8 and set it to be used in the launchers java settings
settings.java9warningtitle=Warning! You may not be able to play Minecraft
settings.java8warning=You're running Java 8 which is incompatible with older versions of Minecraft Forge.%sIf you notice packs no longer loading, then that is most likely the problem and you should uninstall Java 8 and install Java 7.%sClick Download to go to the Java 7 downloads page.
settings.java8warningtitle=Java 8 Warning
settings.javaparameters=Java Parameters
settings.javaparametershelp=Extra Java command line paramaters can be added here.
settings.javaparametersincorrect=The entered Java Parameters were incorrect%sPlease remove any references to Xmx, Xms or XX:PermSize
settings.javapath=Java Path
settings.javapathhelp=This setting allows you to specify where your Java Path is.%s%sThis should be left as default, but if you know what your doing just set%sthis to the path where the bin folder is for the version of Java you want to use%s%sIf you mess up, click the Reset button to go back to the default
settings.javapathincorrect=The Java Path you set is incorrect%sPlease verify it points to the folder where the bin folder is and try again
settings.javapathreset=Reset
settings.selectjavapath=Select path to Java install
settings.javatab=Java/Minecraft
settings.keeplauncheropen=Keep Launcher Open
settings.keeplauncheropenhelp=This determines if ATLauncher should stay open or exit after Minecraft has exited
settings.language=Language
settings.languagehelp=This specifies the Language used by the Launcher
settings.leaderboards=Enable Leaderboards
settings.leaderboardshelp=If you want to participate in the Leaderboards.
settings.logging=Enable Logging
settings.logginghelp=The Launcher sends back anonymous usage and error logs%sto our servers in order to make the Launcher and Packs%sbetter. If you don't want this to happen then simply%sdisable this option.
settings.analytics=Enable Anonymous Analytics
settings.analyticshelp=The Launcher sends back anonymous analytics to Google Analytics%sin order to track what people do and don't use in the launcher.%sThis helps determine what new features we implement in the future.%sAll analytics are anonymous and contain no user/instance information in it at all.%sIf you don't want to send anonymous analytics, you can disable this option.
settings.loggingtab=Logging
settings.maximummemory=Maximum Memory/Ram
settings.maximummemoryhelp=The maximum amount of memory/ram to allocate when starting Minecraft.
settings.memory=Memory/Ram
settings.memoryhelp=The amount of RAM to use when launching Minecraft.
settings.memoryhelp32bit=The amount of RAM to use when launching Minecraft.%sYou can only allocate up to 1GB of RAM as you don't have%sa 64 bit system or you don't have Java 64 bit version installed.
settings.networktab=Network
settings.openeye=Enable OpenEye Reporting
settings.openeyehelp=OpenEye is a mod/project created by the OpenMods team which aims to help gather statistics and crash logs from Minecraft in order to help users and modders discover and fix issues with mods. With the OpenEye mod installed (each ModPack chooses if they wish to install it or not, it's not installed by default to all packs by the Launcher) everytime Minecraft crashes the OpenEye report is sent to OpenEye for analysis and if a note from the modder has been added on the cause/fix it will be displayed to you. For more information please see http://openeye.openblocks.info
settings.packtags=Enable Pack Tags
settings.packtagshelp=Pack tags shows you if a pack is public, semi public or private
settings.permgen=PermGen Size
settings.permgenhelp=The PermGen Size for java to use when launching Minecraft in MB.
settings.proxycannotconnect=Cannot connect to proxy. Please check the settings and try again
settings.proxyhost=Proxy Host
settings.proxyhosthelp=This is the IP/hostname used to connect to the proxy
settings.proxyport=Proxy Port
settings.proxyporthelp=This is the port used to connect to the proxy
settings.proxyportinvalid=The port you specified is invalid. Please check it and try again
settings.proxytype=Proxy Type
settings.proxytypehelp=This is the type of connection the proxy uses. Either HTTP, SOCKS or DIRECT
settings.rearrangingresources=Rearranging Resources Folder
settings.requiresrestart=Changing this setting will automatically restart the launcher
settings.running32bit=We have detected that you're running 64 bit Windows but not 64 bit Java.%sThis will cause severe issues playing all packs if not fixed.%sDo you want to close the launcher and learn how to fix this issue now?
settings.running32bittitle=Running 32 Bit Java on 64 Bit Windows
settings.savecustommods=Save Custom Mods
settings.savecustommodshelp=This enables the saving of custom mods added to an instance when it's updated or reinstalled
settings.ignorejavaoninstancelaunch=Ignore Java checks on launch
settings.ignorejavaoninstancelaunchhelp=This enables ignoring errors when launching a pack that you don't have a compatable Java version for
settings.saved=Settings Saved
settings.serverchecker=Enable Server Checker
settings.servercheckerhelp=This setting enables or disables the checking of added servers in the Server Checker Tool.
settings.servercheckerwait=Time Between Checks
settings.servercheckerwaithelp=This option controls how long the launcher should wait between checking servers in the server checker. This value is in minutes and should be between 1 and 30, with the default being 5.
settings.servercheckerwaitinvalid=The server checker wait time you specified is invalid. Please check it and try again
settings.sortpacksalphabetically=Sort Packs Alphabetically
settings.sortpacksalphabeticallyhelp=If you want to sort the packs in the packs panel alphabetically by default or not.
settings.startminecraftmaximised=Start Minecraft Maximised
settings.startminecraftmaximisedhelp=Enabling this will start Minecraft maximised so that it takes up the full size of your screen
settings.theme=Theme
settings.themehelp=This sets the theme that the launcher will use
settings.toomuchramallocated=You have allocated more than 4GB of ram.%sPlease note this may cause issues and is not recommended and you should lower the value to 4GB or less.
settings.traymenu=Enable Tray Menu
settings.traymenuhelp=The Tray Menu is a little icon that shows in your system taskbar which%sallows you to perform different functions to do various things with the launcher%ssuch as hiding or showing the console, killing Minecraft or closing ATLauncher
settings.discordintegration=Enable Discord Integration
settings.discordintegrationhelp=This will enable showing which pack you're playing in Discord
settings.unsupportedjava=You're using an unsupported version of Java. You should upgrade your Java to at minimum Java 7.%sWithout Java 7 some mods will refuse to load meaning you cannot play.%sClick Download to go to the Java downloads page
settings.unsupportedjavaletsencrypt=You're using an unsupported version of Java. You should upgrade your Java to at minimum Java 8 version 101.%sWithout doing this, some packs may not install.%sClick Download to go to the Java downloads page and install the latest Java
settings.unsupportedjavatitle=Unsupported Java Version
settings.windowsize=Window Size
settings.windowsizehelp=The size that the Minecraft window should open as, Width x Height, in pixels.
status.minecraft.checking=Checking Minecraft server status...
status.minecraft.offline=Minecraft servers are down
status.minecraft.online=All Minecraft servers are up!
status.minecraft.partial=Some Minecraft servers are down
tabs.account=Account
tabs.accounts=Accounts
tabs.addons=Addons
tabs.instances=Instances
tabs.news=News
tabs.packs=Packs
tabs.settings=Settings
tabs.tools=Tools
tools.addserver=Add Server
tools.editserver=Edit Server
tools.launch=Launch Tool
tools.logclearer=Log Clearer
tools.logclearer.info=This tool clears out all logs created by the launcher (not included those made by instances) to free up space and old junk.
tools.logclearer.success=Successfully cleared the logs.
tools.logclearer.error=Failed to clear the logs.
tools.cacheclearer=Cache Clearer
tools.cacheclearer.info=This tool clears out all the cached network reqeuests created by the launcher. Use this if you are having issues downloading files or want to free up some disk space.
tools.cacheclearer.success=Successfully cleared the cache.
tools.cacheclearer.error=Failed to clear the cache.
tools.networkchecker=Network Checker
tools.networkchecker.info=This tool does various tests on your network and determines any issues that may pop up with connecting to our file servers and to other servers.
tools.networkchecker.running=Network Checker Running. Please Wait!
tools.networkcheckererror=The network checker tool has found a possible error as described below. To see more info click the More Info button.%s
tools.networkcheckerpopup=Please note that the data from this tool is sent to ATLauncher so we can diagnose possible issues in your setup. This test may take up to 10 minutes or longer to complete and you will be unable to do anything while it's running. Please also keep in mind that this test will use some of your bandwidth, it will use approximately %sDo you wish to continue?
tools.networkheckercomplete=The network checker tool has completed and the data sent off to ATLauncher.%sThanks for your input to help understand and fix network related issues.
tools.serverchecker=Server Checker
tools.serverchecker.addeditservers=Add/Edit Servers
tools.serverchecker.checking=Checking
tools.serverchecker.checkingserver=Checking Server
tools.serverchecker.couldntconnect=Couldn't connect to server. All servers must be online and successfully checked once before adding.
tools.serverchecker.info=This tool checks specified Minecraft servers to see if they are up or not and how many players are logged in. Settings can be configured in the Settings tab under the Tools sub tab.
tools.serverchecker.ip=Host/IP
tools.serverchecker.name=Name
tools.serverchecker.notallfields=Not all fields were filled in. Please go back and fill them in!
tools.serverchecker.offline=Offline
tools.serverchecker.online=Online
tools.serverchecker.port=Port
tools.serverchecker.serveradded=Server Added Successfully
tools.serverchecker.serveredited=Server Edited Successfully
tools.serverchecker.serverexistshost=Already checking a server with the same host/ip and port. Please change the name and try again!
tools.serverchecker.serverexistsname=Already checking a server with the same name. Please change the name and try again!
tools.serverchecker.servers=Servers
tools.launchindebugmode=Launch in debug mode
tools.launchindebugmode.info=Use this to relaunch ATLauncher in debug mode. This can be used to get more debug logs in order to help diagnose issues with ATLauncher.
tools.runtimedownloader=Runtime Downloader
tools.runtimedownloader.info=Use this to automatically install and use a recommended version of Java to use with ATLauncher.
tools.runtimedownloader.running=Downloading. Please Wait!
tools.runtimedownloader.complete=The recommended version of Java has been installed and set to be used.
tools.runtimedownloader.error=An error occurred downloading the runtime. Please check the logs.
instancecrash.outofmemory=Minecraft has crashed due to insufficent memory being allocated.%sPlease go to the settings tab and increase the maximum memory option and then try launching the instance again.
instancecrash.concurrentmodificationerror16=Minecraft has crashed due to an incompatability with Forge and your version of Java.%sPlease reinstall the instance to automatically fix the problem, and then try launching the instance again.

File diff suppressed because it is too large Load diff