remove "i18n" since it complicates jar building lol
This commit is contained in:
parent
9fc873d9d9
commit
5767116a07
3 changed files with 0 additions and 46 deletions
|
|
@ -1,26 +0,0 @@
|
|||
package com.mykola2312.mptv;
|
||||
|
||||
import java.util.Locale;
|
||||
import java.util.MissingResourceException;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
public class I18n {
|
||||
private static ResourceBundle bundle;
|
||||
|
||||
public static String get(String key) {
|
||||
if (bundle == null) {
|
||||
String locale = Locale.getDefault().toString();
|
||||
bundle = ResourceBundle.getBundle("i18n_" + locale);
|
||||
if (bundle == null) {
|
||||
bundle = ResourceBundle.getBundle("i18n_en_US");
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
return bundle.getString(key);
|
||||
} catch (MissingResourceException e) {
|
||||
System.err.println(e.toString());
|
||||
return key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,5 @@
|
|||
package com.mykola2312.mptv.ui;
|
||||
|
||||
import com.mykola2312.mptv.I18n;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
|
|
@ -12,7 +10,6 @@ public class MainFrame {
|
|||
private void spawn(FrameConfig config) {
|
||||
Font font = new Font(config.fontName, Font.PLAIN, config.fontSize);
|
||||
|
||||
//frame = new JFrame(I18n.get("MainFrame_Title"));
|
||||
frame = new JFrame("MPTV");
|
||||
|
||||
menu = new MenuPanel(font);
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
package com.mykola2312.mptv;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
||||
public class TestI18n {
|
||||
@Test()
|
||||
public void testKeys() {
|
||||
assertEquals("Value1", I18n.get("Key1"));
|
||||
assertEquals("Value2", I18n.get("Key2"));
|
||||
}
|
||||
|
||||
@Test()
|
||||
public void testNotFound() {
|
||||
assertEquals("KeyNotFound", I18n.get("KeyNotFound"));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue