mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Dedicated directory for locales
This commit is contained in:
parent
0f2e1ea740
commit
1ca48051ad
@ -104,7 +104,7 @@ public final class LocaleLoader {
|
|||||||
throw new IllegalStateException("Failed to parse locale string '" + Config.getInstance().getLocale() + "'");
|
throw new IllegalStateException("Failed to parse locale string '" + Config.getInstance().getLocale() + "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
Path localePath = Paths.get(mcMMO.getMainDirectory() + "locale_" + locale.toString() + ".properties");
|
Path localePath = Paths.get(mcMMO.getLocalesDirectory() + "locale_" + locale.toString() + ".properties");
|
||||||
if (Files.exists(localePath) && Files.isRegularFile(localePath)) {
|
if (Files.exists(localePath) && Files.isRegularFile(localePath)) {
|
||||||
try (Reader localeReader = Files.newBufferedReader(localePath)) {
|
try (Reader localeReader = Files.newBufferedReader(localePath)) {
|
||||||
filesystemBundle = new PropertyResourceBundle(localeReader);
|
filesystemBundle = new PropertyResourceBundle(localeReader);
|
||||||
|
@ -79,6 +79,7 @@ public class mcMMO extends JavaPlugin {
|
|||||||
|
|
||||||
/* File Paths */
|
/* File Paths */
|
||||||
private static String mainDirectory;
|
private static String mainDirectory;
|
||||||
|
private static String localesDirectory;
|
||||||
private static String flatFileDirectory;
|
private static String flatFileDirectory;
|
||||||
private static String usersFile;
|
private static String usersFile;
|
||||||
private static String modDirectory;
|
private static String modDirectory;
|
||||||
@ -357,6 +358,10 @@ public class mcMMO extends JavaPlugin {
|
|||||||
return mainDirectory;
|
return mainDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getLocalesDirectory() {
|
||||||
|
return localesDirectory;
|
||||||
|
}
|
||||||
|
|
||||||
public static String getFlatFileDirectory() {
|
public static String getFlatFileDirectory() {
|
||||||
return flatFileDirectory;
|
return flatFileDirectory;
|
||||||
}
|
}
|
||||||
@ -432,6 +437,7 @@ public class mcMMO extends JavaPlugin {
|
|||||||
private void setupFilePaths() {
|
private void setupFilePaths() {
|
||||||
mcmmo = getFile();
|
mcmmo = getFile();
|
||||||
mainDirectory = getDataFolder().getPath() + File.separator;
|
mainDirectory = getDataFolder().getPath() + File.separator;
|
||||||
|
localesDirectory = mainDirectory + "locales" + File.separator;
|
||||||
flatFileDirectory = mainDirectory + "flatfile" + File.separator;
|
flatFileDirectory = mainDirectory + "flatfile" + File.separator;
|
||||||
usersFile = flatFileDirectory + "mcmmo.users";
|
usersFile = flatFileDirectory + "mcmmo.users";
|
||||||
modDirectory = mainDirectory + "mods" + File.separator;
|
modDirectory = mainDirectory + "mods" + File.separator;
|
||||||
@ -485,6 +491,8 @@ public class mcMMO extends JavaPlugin {
|
|||||||
|
|
||||||
File currentFlatfilePath = new File(flatFileDirectory);
|
File currentFlatfilePath = new File(flatFileDirectory);
|
||||||
currentFlatfilePath.mkdirs();
|
currentFlatfilePath.mkdirs();
|
||||||
|
File localesDirectoryPath = new File(localesDirectory);
|
||||||
|
localesDirectoryPath.mkdirs();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void loadConfigFiles() {
|
private void loadConfigFiles() {
|
||||||
|
Loading…
Reference in New Issue
Block a user