mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-22 18:45:29 +01:00
Test
This commit is contained in:
parent
80aeaf5770
commit
1a3ebd0990
@ -152,6 +152,7 @@ public class Messages {
|
||||
public static final String VULNERABLE_STOPPED = "citizens.commands.npc.vulnerable.stopped";
|
||||
public static final String WAYPOINT_PROVIDER_SET = "citizens.waypoints.set-provider";
|
||||
public static final String WRITING_DEFAULT_SETTING = "citizens.settings.writing-default";
|
||||
public static final String MISSING_TRANSLATIONS = "citizens.notifications.missing-translations";
|
||||
|
||||
private static Properties getDefaultBundleProperties() {
|
||||
Properties defaults = new Properties();
|
||||
|
@ -28,6 +28,7 @@ public class Translator {
|
||||
Translator.class.getClassLoader(), resourceFile));
|
||||
} catch (MissingResourceException e) {
|
||||
preferredBundle = getDefaultBundle();
|
||||
Messaging.logTr(Messages.MISSING_TRANSLATIONS, locale);
|
||||
}
|
||||
}
|
||||
|
||||
@ -89,6 +90,11 @@ public class Translator {
|
||||
return file.toURI().toURL();
|
||||
} catch (MalformedURLException ex) {
|
||||
}
|
||||
} else {
|
||||
string = string.replaceFirst("/", "");
|
||||
URL test = Translator.class.getResource('/' + string);
|
||||
if (test != null)
|
||||
return test;
|
||||
}
|
||||
return super.getResource(string);
|
||||
}
|
||||
@ -101,6 +107,11 @@ public class Translator {
|
||||
return new FileInputStream(file);
|
||||
} catch (FileNotFoundException ex) {
|
||||
}
|
||||
} else {
|
||||
string = string.replaceFirst("/", "");
|
||||
InputStream stream = Translator.class.getResourceAsStream('/' + string);
|
||||
if (stream != null)
|
||||
return stream;
|
||||
}
|
||||
return super.getResourceAsStream(string);
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ citizens.commands.invalid-number=That is not a valid number.
|
||||
citizens.commands.npc.age.cannot-be-aged=The mob type '{0}' cannot be aged.
|
||||
citizens.commands.npc.age.invalid-age=Invalid age. Valid ages are adult, baby, number between -24000 and 0
|
||||
citizens.commands.npc.age.set=[[{0}]] is now [[{1}]].
|
||||
citizens.notifications.missing-translations=Missing translations file for locale {0}. Defaulting to en locale.
|
||||
citizens.commands.npc.behaviour.added=Behaviours added.
|
||||
citizens.commands.npc.behaviour.removed=Behaviours removed.
|
||||
citizens.commands.npc.controllable.not-controllable=[[{0}]] is not controllable.
|
||||
|
Loading…
Reference in New Issue
Block a user