Skip to content

Commit

Permalink
Allow addition of external new resource bundles as well as replacemen…
Browse files Browse the repository at this point in the history
…t of existing ones

- Users may override bundled resource bundles or add entirely new ones by putting them in the 'lang' folder inside of MyWarp's plugin folder. Bundles must be placed in sub-folders that mirror MyWarp's package structure and named accordingly (e.g. 'me/taylorkelly/mywarp/lang/Commands_de.properties' overwrites the bundled german bundle).
- Custom files will not be updated in any way, missing keys are resolved via the standard bundle lookup order.
- The root resource bundle cannot be overwritten.
- Folder and files will not be created automatically. By default only bundled files will be used.

Adds #33.
  • Loading branch information
TheE committed Jun 18, 2015
1 parent d4b5ee1 commit b17de12
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 297 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

package me.taylorkelly.mywarp.bukkit;

import com.google.common.base.Charsets;
import com.google.common.collect.Iterables;
import com.google.common.util.concurrent.ListeningExecutorService;
import com.google.common.util.concurrent.MoreExecutors;
Expand Down Expand Up @@ -53,7 +52,6 @@
import me.taylorkelly.mywarp.bukkit.markers.DynmapMarkers;
import me.taylorkelly.mywarp.bukkit.timer.BukkitDurationProvider;
import me.taylorkelly.mywarp.bukkit.timer.BukkitTimerService;
import me.taylorkelly.mywarp.bukkit.util.EncodedControl;
import me.taylorkelly.mywarp.bukkit.util.jdbc.DataSourceFactory;
import me.taylorkelly.mywarp.bukkit.util.jdbc.SingleConnectionDataSource;
import me.taylorkelly.mywarp.bukkit.util.parametric.ActorAuthorizer;
Expand All @@ -77,6 +75,7 @@
import me.taylorkelly.mywarp.util.CommandUtils;
import me.taylorkelly.mywarp.util.MyWarpLogger;
import me.taylorkelly.mywarp.util.i18n.DynamicMessages;
import me.taylorkelly.mywarp.util.i18n.FolderSourcedControl;
import me.taylorkelly.mywarp.util.i18n.LocaleManager;

import net.milkbowl.vault.economy.Economy;
Expand Down Expand Up @@ -112,7 +111,7 @@ public class MyWarpPlugin extends JavaPlugin implements Platform {
private static final Logger log = MyWarpLogger.getLogger(MyWarpPlugin.class);

private final File bundleFolder = new File(getDataFolder(), "lang");
private final ResourceBundle.Control control = new EncodedControl(Charsets.UTF_8);
private final ResourceBundle.Control control = new FolderSourcedControl(bundleFolder);

private SingleConnectionDataService dataService;
private GroupResolverManager groupResolverManager;
Expand Down

This file was deleted.

This file was deleted.

0 comments on commit b17de12

Please sign in to comment.