diff --git a/source/medimancer/app.d b/source/medimancer/app.d index 7742b71..f13dff3 100644 --- a/source/medimancer/app.d +++ b/source/medimancer/app.d @@ -55,10 +55,10 @@ private void configure() public: this() { - super("install", 160, 72); + super("UI_INSTALL", 160, 72); - auto ibut = new Button(null, "install"); - auto ubut = new Button(null, "uninstall"); + auto ibut = new Button(null, "UI_INSTALL"); + auto ubut = new Button(null, "UI_UNINSTALL"); ibut.click = (widget){install(); window.close(); return true;}; ubut.click = (widget){uninstall(); window.close(); return true;}; @@ -74,7 +74,7 @@ private void configure() private void process(Action action) { if (!action.format) - new InputPopup("select_format", (format){ + new InputPopup("UI_SELECT_FORMAT", (format){ convertMedia(action.file_name, setExtension(action.file_name, format)); }); else diff --git a/source/medimancer/ffmpeg.d b/source/medimancer/ffmpeg.d index 4c363e7..80790c0 100644 --- a/source/medimancer/ffmpeg.d +++ b/source/medimancer/ffmpeg.d @@ -17,11 +17,11 @@ import medimancer.popup; void convertMedia(string from, string to) { - enforce!UserError(exists(from), "file_does_not_exist"); - enforce!UserError(from != to, "destination_is_source"); + enforce!UserError(exists(from), "UI_FILE_DOES_NOT_EXIST"); + enforce!UserError(from != to, "UI_DESTINATION_IS_SOURCE"); auto probe = execute(["ffprobe", from]); - enforce!UserError(!probe.status, "probe_failed"); + enforce!UserError(!probe.status, "UI_PROBE_FAILED"); Duration duration; int filled; @@ -35,7 +35,7 @@ void convertMedia(string from, string to) duration = hours(hrs) + minutes(min) + seconds(sec) + msecs(msc); break; } - enforce!UserError("probe_invalid"); + enforce!UserError("UI_PROBE_INVALID"); uint progress_end = cast(uint)duration.total!"msecs"; uint progress = 0; @@ -70,7 +70,7 @@ void convertMedia(string from, string to) }).executeInNewThread; ProgressPopup popup; - popup = new ProgressPopup("converting", { + popup = new ProgressPopup("UI_CONVERTING", { if (progress == 1000) popup.finish(); return progress; diff --git a/source/medimancer/popup.d b/source/medimancer/popup.d index 88fd7ed..42d48d9 100644 --- a/source/medimancer/popup.d +++ b/source/medimancer/popup.d @@ -34,7 +34,7 @@ class ErrorPopup : Popup public: this(string message, bool raw = false) { - super("error", 240, 64); + super("UI_ERROR", 240, 64); if (raw) window.mainWidget = new TextWidget(null, RUI(message)); else @@ -52,7 +52,7 @@ public: super(label, 240, 96); auto input = new EditLine(); - auto button = new Button(null, "enter"); + auto button = new Button(null, "UI_ENTER"); auto box = new GroupBox(null, label); box.addChild(input); box.addChild(button); @@ -76,7 +76,7 @@ public: this(string label, uint delegate() callback) { super(label, 512, 64); - window.mainWidget = new Progress("progress", callback); + window.mainWidget = new Progress("UI_PROGRESS", callback); timer = window.mainWidget.setTimer(Progress.updateRate); show(); } diff --git a/views/res/i18n/en.ini b/views/res/i18n/en.ini deleted file mode 100644 index abf1556..0000000 --- a/views/res/i18n/en.ini +++ /dev/null @@ -1,14 +0,0 @@ -install = Install -uninstall = Uninstall - -error = Error -enter = Enter -progress = Progress - -select_format = Select format - -file_does_not_exist = File does not exist -destination_is_source = Destination file is same as source -probe_failed = Probe failed -probe_invalid = Probe returned invalid data -converting = Converting... \ No newline at end of file diff --git a/views/res/i18n/lt.ini b/views/res/i18n/lt.ini deleted file mode 100644 index 871539d..0000000 --- a/views/res/i18n/lt.ini +++ /dev/null @@ -1,14 +0,0 @@ -install = Įrašyti -uninstall = Ištrinti - -error = Klaida -enter = Toliau -progress = Pažanga - -select_format = Pasirinkite formatą - -file_does_not_exist = Įrašas neegzistuoja -destination_is_source = Galutinis įrašas lygus duotam -probe_failed = Patikra nepavyko -probe_invalid = Patikra atsakė klaidingai -converting = Perašoma... \ No newline at end of file diff --git a/views/res/i18n/std_en.ini b/views/res/i18n/std_en.ini new file mode 100644 index 0000000..010cf0b --- /dev/null +++ b/views/res/i18n/std_en.ini @@ -0,0 +1,14 @@ +UI_INSTALL = Install +UI_UNINSTALL = Uninstall + +UI_ERROR = Error +UI_ENTER = Enter +UI_PROGRESS = Progress + +UI_SELECT_FORMAT = Select format + +UI_FILE_DOES_NOT_EXIST = File does not exist +UI_DESTINATION_IS_SOURCE = Destination file is same as source +UI_PROBE_FAILED = Probe failed +UI_PROBE_INVALID = Probe returned invalid data +UI_CONVERTING = Converting... \ No newline at end of file diff --git a/views/res/i18n/std_lt.ini b/views/res/i18n/std_lt.ini new file mode 100644 index 0000000..46287f3 --- /dev/null +++ b/views/res/i18n/std_lt.ini @@ -0,0 +1,14 @@ +UI_INSTALL = Įrašyti +UI_UNINSTALL = Ištrinti + +UI_ERROR = Klaida +UI_ENTER = Toliau +UI_PROGRESS = Pažanga + +UI_SELECT_FORMAT = Pasirinkite formatą + +UI_FILE_DOES_NOT_EXIST = Įrašas neegzistuoja +UI_DESTINATION_IS_SOURCE = Galutinis įrašas lygus duotam +UI_PROBE_FAILED = Patikra nepavyko +UI_PROBE_INVALID = Patikra atsakė klaidingai +UI_CONVERTING = Perašoma... \ No newline at end of file