2022-09-26 19:09:02 +02:00
|
|
|
package io.gitlab.jfronny.inceptum.gtk.util;
|
|
|
|
|
|
|
|
import ch.bailu.gtk.type.Str;
|
2022-11-04 17:02:24 +01:00
|
|
|
import org.jetbrains.annotations.PropertyKey;
|
2022-09-26 19:09:02 +02:00
|
|
|
|
|
|
|
import java.util.ResourceBundle;
|
|
|
|
|
|
|
|
public class I18n {
|
2022-11-04 17:02:24 +01:00
|
|
|
private static final String BUNDLE = "inceptum";
|
|
|
|
private static final ResourceBundle bundle = ResourceBundle.getBundle(BUNDLE);
|
2022-09-26 19:09:02 +02:00
|
|
|
|
2022-11-04 17:02:24 +01:00
|
|
|
public static String get(@PropertyKey(resourceBundle = BUNDLE) String key) {
|
2022-09-26 19:09:02 +02:00
|
|
|
return bundle.getString(key);
|
|
|
|
}
|
|
|
|
|
2022-11-04 17:02:24 +01:00
|
|
|
public static String get(@PropertyKey(resourceBundle = BUNDLE) String key, Object... args) {
|
2022-09-26 19:09:02 +02:00
|
|
|
return String.format(bundle.getString(key), args);
|
|
|
|
}
|
|
|
|
|
2022-11-04 17:02:24 +01:00
|
|
|
public static Str str(@PropertyKey(resourceBundle = BUNDLE) String key) {
|
2022-09-26 19:09:02 +02:00
|
|
|
return new Str(get(key));
|
|
|
|
}
|
|
|
|
|
2022-11-04 17:02:24 +01:00
|
|
|
public static Str str(@PropertyKey(resourceBundle = BUNDLE) String key, Object... args) {
|
2022-09-26 19:09:02 +02:00
|
|
|
return new Str(get(key, args));
|
|
|
|
}
|
|
|
|
}
|