i18n two apps to test

This commit is contained in:
Willem Cazander 2022-02-15 00:17:57 +01:00
parent 1298b18b9e
commit e26fb77a7a
12 changed files with 80 additions and 31 deletions

View file

@ -231,7 +231,7 @@ public class GDXAppMain extends Game {
ImGui.setNextWindowPos(5, 30, sizeFlags);
ImGui.setNextWindowSize(Gdx.graphics.getWidth() - 10, Gdx.graphics.getHeight() - 35, sizeFlags);
int windowFlags = ImGuiWindowFlags.NoMove | ImGuiWindowFlags.NoResize;
if (ImGui.begin(appScreen.getDeskAppScreen().getCurrentDeskApp().getName(), openWindowFlag, windowFlags)) {
if (ImGui.begin(appScreen.getDeskAppScreen().getCurrentDeskApp().getTitle(), openWindowFlag, windowFlags)) {
DeskAppRenderer renderer = appScreen.getDeskAppScreen().getCurrentDeskApp().getContours().getContour(DeskAppContourSection.MAIN);
if (renderer != null) {
renderer.render();
@ -334,7 +334,7 @@ public class GDXAppMain extends Game {
desktop1.getDeskAppScreen().setCurrentDeskApp(null);
}
for (DeskApp app: desktop1.getDeskAppScreen().getDeskApps()) {
if (ImGui.menuItem(app.getName())) {
if (ImGui.menuItem(app.getTitle())) {
selectScreen(ScreenDesktop1.class);
desktop1.getDeskAppScreen().setCurrentDeskApp(app);
}
@ -347,7 +347,7 @@ public class GDXAppMain extends Game {
desktop2.getDeskAppScreen().setCurrentDeskApp(null);
}
for (DeskApp app: desktop2.getDeskAppScreen().getDeskApps()) {
if (ImGui.menuItem(app.getName())) {
if (ImGui.menuItem(app.getTitle())) {
selectScreen(ScreenDesktop2.class);
desktop2.getDeskAppScreen().setCurrentDeskApp(app);
}
@ -360,7 +360,7 @@ public class GDXAppMain extends Game {
desktop3.getDeskAppScreen().setCurrentDeskApp(null);
}
for (DeskApp app: desktop3.getDeskAppScreen().getDeskApps()) {
if (ImGui.menuItem(app.getName())) {
if (ImGui.menuItem(app.getTitle())) {
selectScreen(ScreenDesktop3.class);
desktop3.getDeskAppScreen().setCurrentDeskApp(app);
}
@ -373,7 +373,7 @@ public class GDXAppMain extends Game {
desktop4.getDeskAppScreen().setCurrentDeskApp(null);
}
for (DeskApp app: desktop4.getDeskAppScreen().getDeskApps()) {
if (ImGui.menuItem(app.getName())) {
if (ImGui.menuItem(app.getTitle())) {
selectScreen(ScreenDesktop4.class);
desktop4.getDeskAppScreen().setCurrentDeskApp(app);
}

View file

@ -5,19 +5,25 @@ import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public class DefaultDeskApp implements DeskApp {
private final String name;
private final String icon;
private String title;
private String icon;
private final DeskAppContour contours;
public DefaultDeskApp(String name, String icon) {
this.name = name;
this.icon = icon;
public DefaultDeskApp() {
this.contours = new DeskAppContour();
}
public void setTitle(String title) {
this.title = title;
}
@Override
public String getName() {
return name;
public String getTitle() {
return title;
}
public void setIcon(String icon) {
this.icon = icon;
}
@Override

View file

@ -5,7 +5,7 @@ import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface DeskApp {
String getName();
String getTitle();
String getIcon();

View file

@ -54,7 +54,7 @@ public class DeskAppScreen {
public final void renderMenu() {
for (DeskApp app: deskApps) {
if (ImGui.menuItem(app.getName())) {
if (ImGui.menuItem(app.getTitle())) {
//selectScreen(....class);
}
}

View file

@ -10,7 +10,7 @@ import love.distributedrebirth.gdxapp.desktop.DeskAppRenderer;
public class BasicConsoleApp extends DefaultDeskApp {
public BasicConsoleApp() {
super("Basic Console", "");
setTitle("Basic Conssole");
getContours().registrateContour(DeskAppContourSection.MAIN, new DeskAppRenderer() {
@Override

View file

@ -12,7 +12,7 @@ import love.distributedrebirth.numberxd.Gê̄ldGetậl;
public class HebrewWalletApp extends DefaultDeskApp implements DeskAppRenderer {
public HebrewWalletApp() {
super("Hebrew Wallet", "");
setTitle("Hebrew Wallet");
getContours().registrateContour(DeskAppContourSection.MAIN, this);
}

View file

@ -28,7 +28,7 @@ public class MusicPlayerApp extends DefaultDeskApp implements DeskAppRenderer {
private final NativeFileChooserConfiguration fileChooserConfig;
public MusicPlayerApp(GDXAppMain main) {
super("Music Player", "");
setTitle("Music Player");
getContours().registrateContour(DeskAppContourSection.MAIN, this);
getContours().registrateContour(DeskAppContourSection.FILE_NEW, new DeskAppRenderer() {

View file

@ -1,5 +1,8 @@
package love.distributedrebirth.gdxapp.desktop.apps;
import java.util.Locale;
import java.util.ResourceBundle;
import imgui.ImGui;
import imgui.flag.ImGuiTableFlags;
import imgui.type.ImBoolean;
@ -14,21 +17,26 @@ public class SystemBaseGlyphApp extends DefaultDeskApp {
private final ImBoolean showBase27 = new ImBoolean(false);
private String getTxt(String key) {
ResourceBundle bundle = ResourceBundle.getBundle("love.distributedrebirth.gdxapp.Main", new Locale("en"));
return bundle.getString("SystemBaseGlyphApp."+key);
}
public SystemBaseGlyphApp() {
super("Base Glyph Set", "");
setTitle(getTxt("title"));
getContours().registrateContour(DeskAppContourSection.MAIN, new DeskAppRenderer() {
@Override
public void render() {
ImGui.checkbox("Show base27", showBase27);
ImGui.checkbox(getTxt("showBase27"), showBase27);
int flags = ImGuiTableFlags.ScrollX | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersOuter | ImGuiTableFlags.BordersV | ImGuiTableFlags.Resizable;
ImGui.beginTable("base-part", 3, flags);
ImGui.tableSetupColumn("Script");
ImGui.tableSetupColumn("10Numbers");
ImGui.tableSetupColumn(getTxt("colScript"));
ImGui.tableSetupColumn(getTxt("col10Num"));
if (showBase27.get()) {
ImGui.tableSetupColumn("27Numbers");
ImGui.tableSetupColumn(getTxt("col27Num"));
} else {
ImGui.tableSetupColumn("16Numbers");
ImGui.tableSetupColumn(getTxt("col16Num"));
}
ImGui.tableHeadersRow();
for (BaseGlyphSet set:BaseGlyphSet.values()) {

View file

@ -2,6 +2,8 @@ package love.distributedrebirth.gdxapp.desktop.apps;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import java.util.ResourceBundle;
import imgui.ImGui;
import imgui.flag.ImGuiTableFlags;
@ -27,8 +29,13 @@ public class SystemBasePartApp extends DefaultDeskApp implements DeskAppRenderer
private final ImBoolean showBase16 = new ImBoolean(false);
private final ImBoolean showBase27 = new ImBoolean(false);
private String getTxt(String key) {
ResourceBundle bundle = ResourceBundle.getBundle("love.distributedrebirth.gdxapp.Main", new Locale("en"));
return bundle.getString("SystemBasePartApp."+key);
}
public SystemBasePartApp() {
super("Base Parts", "");
setTitle(getTxt("title"));
getContours().registrateContour(DeskAppContourSection.MAIN, this);
}
@ -44,19 +51,19 @@ public class SystemBasePartApp extends DefaultDeskApp implements DeskAppRenderer
Integer baseNumber = Integer.valueOf(selectedItem);
BãßBȍőnPartʸᴰ<?>[] baseParts = Base2PartsFactory.INSTANCE.BãßBuildPartsByBase(baseNumber);
ImGui.combo("Base", selectedBasePart, items);
ImGui.combo(getTxt("selectBase"), selectedBasePart, items);
ImGui.text("Name:");
ImGui.text(getTxt("selectName"));
ImGui.sameLine();
ImGui.text(baseParts[0].BãßClassNaam());
ImGui.text("Purpose:");
ImGui.text(getTxt("selectPurpose"));
ImGui.sameLine();
ImGui.text(baseParts[0].BãßClassPurpose());
ImGui.checkbox("Show base10", showBase10);
ImGui.checkbox("Show base16", showBase16);
ImGui.checkbox("Show base27", showBase27);
ImGui.checkbox(getTxt("showBase10"), showBase10);
ImGui.checkbox(getTxt("showBase16"), showBase16);
ImGui.checkbox(getTxt("showBase27"), showBase27);
int columns = 10;
if (showBase10.get()) {

View file

@ -13,7 +13,7 @@ import love.distributedrebirth.gdxapp.desktop.DeskAppRenderer;
public class Unicode4DApp extends DefaultDeskApp implements DeskAppRenderer {
public Unicode4DApp() {
super("Unicode4D", "");
setTitle("Unicode4D");
getContours().registrateContour(DeskAppContourSection.MAIN, this);
}

View file

@ -0,0 +1,14 @@
SystemBaseGlyphApp.title=Base Glyph Set
SystemBaseGlyphApp.showBase27=Show base27
SystemBaseGlyphApp.colScript=Script
SystemBaseGlyphApp.col10Num=10Numbers
SystemBaseGlyphApp.col16Num=16Numbers
SystemBaseGlyphApp.col27Num=27Numbers
SystemBasePartApp.title=Base Parts
SystemBasePartApp.selectBase=Base
SystemBasePartApp.selectName=Name:
SystemBasePartApp.selectPurpose=Purpose:
SystemBasePartApp.showBase10=Show base10
SystemBasePartApp.showBase16=Show base16
SystemBasePartApp.showBase27=Show base27

View file

@ -0,0 +1,14 @@
SystemBaseGlyphApp.title=\uE0C0\uE13F\uE2F4 \uE3BC\uE0ED\uE1CC\uE191 \uE2F4\uE20F
SystemBaseGlyphApp.showBase27=\uE219\uE362 \uE0C0\uE13F\uE2F4 \uE387 \uE400
SystemBaseGlyphApp.colScript=\uE2F4\uE3A1\uE08B\uE1CB\uE2AA\uE20F
SystemBaseGlyphApp.col10Num=\uE386 \uE216\uE171\uE153\uE0C0\uE08C\uE2F4
SystemBaseGlyphApp.col16Num=\uE386 \uE3FF \uE216\uE171\uE153\uE0C0\uE08C\uE2F4
SystemBaseGlyphApp.col27Num=\uE387 \uE400 \uE216\uE171\uE153\uE0C0\uE08C\uE2F4
SystemBasePartApp.title=\uE0C0\uE13F\uE2F4 \uE203\uE13F\uE08C\uE20F\uE2F4
SystemBasePartApp.selectBase=\uE0C0\uE13F\uE2F4
SystemBasePartApp.selectName=\uE216\uE13F\uE153 \uE3EC
SystemBasePartApp.selectPurpose=\uE203\uE171\uE08C\uE203\uE2F4 \uE3EC
SystemBasePartApp.showBase10=\uE219\uE362 \uE0C0\uE13F\uE2F4 \uE386
SystemBasePartApp.showBase16=\uE219\uE362 \uE0C0\uE13F\uE2F4 \uE386 \uE3FF
SystemBasePartApp.showBase27=\uE219\uE362 \uE0C0\uE13F\uE2F4 \uE387 \uE400