mirror of
https://github.com/AppleDash/SaneEconomy.git
synced 2024-06-26 06:24:47 +02:00
Merge branch 'master' of github.com:AppleDash/SaneEconomy
This commit is contained in:
commit
7f5740e5f1
|
@ -3,6 +3,7 @@ package org.appledash.saneeconomy.economy;
|
|||
import org.bukkit.configuration.ConfigurationSection;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
|
||||
/**
|
||||
* Created by AppleDash on 6/13/2016.
|
||||
|
@ -22,10 +23,24 @@ public class Currency {
|
|||
}
|
||||
|
||||
public static Currency fromConfig(ConfigurationSection config) {
|
||||
DecimalFormat format = new DecimalFormat(config.getString("format", "0.00"));
|
||||
|
||||
if (config.getInt("grouping", 0) > 0) {
|
||||
DecimalFormatSymbols symbols = format.getDecimalFormatSymbols();
|
||||
if (symbols.getDecimalSeparator() == ',') { // French
|
||||
symbols.setGroupingSeparator(' ');
|
||||
} else {
|
||||
symbols.setGroupingSeparator(',');
|
||||
}
|
||||
format.setDecimalFormatSymbols(symbols);
|
||||
format.setGroupingUsed(true);
|
||||
format.setGroupingSize(3);
|
||||
}
|
||||
|
||||
return new Currency(
|
||||
config.getString("name.singular", "dollar"),
|
||||
config.getString("name.plural", "dollars"),
|
||||
new DecimalFormat(config.getString("format", "0.00"))
|
||||
format
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ currency:
|
|||
singular: dollar
|
||||
plural: dollars
|
||||
format: '0.00'
|
||||
grouping: 3
|
||||
|
||||
chat:
|
||||
prefix: '&b[&9Economy&b]&r '
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# How to use this file:
|
||||
# Add a translation to the messages you wish to change, like this:
|
||||
# - message: That player is not online.
|
||||
# translation: Ce joueur est pas en ligne.
|
||||
# translation: Ce joueur n'est pas en ligne.
|
||||
messages:
|
||||
- message: You don't have permission to check the balance of %s.
|
||||
- message: That player is not online.
|
||||
|
|
Loading…
Reference in New Issue
Block a user