Last active
May 31, 2016 09:25
-
-
Save syuchan1005/2a5ddda839f4bfeb355b to your computer and use it in GitHub Desktop.
いろいろな言語へのサポートを補助するものです
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DefaultLanguage: ja_JP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sampleplugin: | |
message: Test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ソースはこちら: https://github.com/syuchan1005/LanguageHelper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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