Skip to content

Instantly share code, notes, and snippets.

@syuchan1005
Last active May 31, 2016 09:25
Show Gist options
  • Save syuchan1005/2a5ddda839f4bfeb355b to your computer and use it in GitHub Desktop.
Save syuchan1005/2a5ddda839f4bfeb355b to your computer and use it in GitHub Desktop.
いろいろな言語へのサポートを補助するものです
DefaultLanguage: ja_JP
sampleplugin:
message: Test
ソースはこちら: https://github.com/syuchan1005/LanguageHelper
package test;
import org.apache.commons.codec.language.bm.Languages;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.plugin.java.JavaPlugin;
import java.io.IOException;
/**
* Created by syuchan on 2016/02/11.
*/
public class SamplePlugin extends JavaPlugin {
private static LanguageHelper langs;
@Override
public void onEnable() {
try {
langs = new LanguageHelper(this);
} catch (IOException e) {
e.printStackTrace();
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
System.out.println(langs.getString("ja_JP", "sampleplugin.message"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment