diff --git a/Cargo.lock b/Cargo.lock index 3351b0c..18d9da4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6,6 +6,7 @@ version = 3 name = "Roblox-assets-extractor" version = "0.1.4" dependencies = [ + "chrono", "clap", "eframe", "egui", @@ -97,6 +98,21 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anstream" version = "0.6.18" @@ -335,6 +351,20 @@ dependencies = [ "libc", ] +[[package]] +name = "chrono" +version = "0.4.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets 0.52.6", +] + [[package]] name = "clap" version = "4.5.23" @@ -1275,6 +1305,29 @@ dependencies = [ "tracing", ] +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "icu_collections" version = "1.5.0" @@ -3341,6 +3394,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-registry" version = "0.2.0" diff --git a/Cargo.toml b/Cargo.toml index c8992d8..5f7d288 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,7 @@ unic-langid = "0.9.5" whoami = { version = "1.5.2", default-features = false } [build-dependencies] +chrono = "0.4.39" winresource = "0.1.19" # Minimize executable size (Target size < 10MB) diff --git a/build.rs b/build.rs index c6a44d8..bbb7587 100644 --- a/build.rs +++ b/build.rs @@ -16,6 +16,9 @@ fn main() -> io::Result<()> { .set_icon("assets/icon.ico") .compile()?; } + + // Add compile date to the program's environment variables + println!("cargo:rustc-env=COMPILE_DATE={}", chrono::Utc::now().format("%Y-%m-%d %H:%M:%S").to_string()); // Embed path to locale files let locale_dir = Path::new("locales"); diff --git a/locales/de-DE.ftl b/locales/de-DE.ftl index 50426d0..a05dfa0 100644 --- a/locales/de-DE.ftl +++ b/locales/de-DE.ftl @@ -99,3 +99,6 @@ confirmation-ban-warning-description = Assets in Spielen zu bearbeiten kann dazu button-swap = Assets austauschen swap-choose-file = Doppelklicke eine Datei um sie auszutauschen swap-with = Doppelklicke eine Datei um sie mit "{ $asset }" auszutauschen + +support-sponsor = ♥ Sponsor # TODO: Translate +support-project-donate = ♥ Donate # TODO: Translate \ No newline at end of file diff --git a/locales/en-GB.ftl b/locales/en-GB.ftl index e1470e7..b56aed8 100644 --- a/locales/en-GB.ftl +++ b/locales/en-GB.ftl @@ -89,7 +89,7 @@ error-check-logs = ERROR: Check logs for more details. # Misc no-function = (Not functional yet) -version = Version: v{ $version } +version = Version: v{ $version } (compiled at { $date }) cache-directory = Cache directory: { $directory } welcome = Welcome download-update-question = Would you like to download the update? diff --git a/locales/ja-JP.ftl b/locales/ja-JP.ftl index d0b0b02..605ea6d 100644 --- a/locales/ja-JP.ftl +++ b/locales/ja-JP.ftl @@ -92,4 +92,6 @@ version = バージョン: v{ $version } cache-directory = キャッシュディレクトリ: { $directory } welcome = ようこそ download-update-question = アップデートをダウンロードしますか? -update-changelog = 以下に更新内容を表示 \ No newline at end of file +update-changelog = 以下に更新内容を表示 +support-sponsor = ♥ Sponsor # TODO: Translate +support-project-donate = ♥ Donate # TODO: Translate \ No newline at end of file diff --git a/locales/pl-PL.ftl b/locales/pl-PL.ftl index 02f6a10..a38c8be 100644 --- a/locales/pl-PL.ftl +++ b/locales/pl-PL.ftl @@ -87,6 +87,8 @@ error-extracting-file = BŁĄD: Nie udało się wyodrębnić plików: { $error } error-check-logs = BŁĄD: Sprawdż dziennik po więcej informacji. # Misc +support-project-donate = ♥ Donate # TODO: Translate +support-sponsor = ♥ Sponsor # TODO: Translate no-function = (Nie działa) version = Wersja: { $version } cache-directory = Katalog pamięci podręcznej: { $directory } diff --git a/src/gui.rs b/src/gui.rs index dfcf779..381374e 100644 --- a/src/gui.rs +++ b/src/gui.rs @@ -12,6 +12,7 @@ mod welcome; mod settings; const VERSION: &str = env!("CARGO_PKG_VERSION"); // Get version for use in the filename +const COMPILE_DATE: &str = env!("COMPILE_DATE"); const ICON: &[u8; 11400] = include_bytes!("../assets/icon.png"); const CONTRIBUTERS: [&str; 4] = [ "AeEn123", @@ -382,10 +383,14 @@ impl egui_dock::TabViewer for TabViewer<'_> { let mut args = fluent_bundle::FluentArgs::new(); args.set("version", VERSION); + args.set("date", COMPILE_DATE); + + ui.horizontal(|ui| { + ui.label(logic::get_message(self.locale, "version", Some(&args))); + + ui.hyperlink_to("Discord", "https://discord.gg/xqNA5jt6DN"); + }); - ui.label(logic::get_message(self.locale, "version", Some(&args))); - - ui.hyperlink_to("Discord", "https://discord.gg/xqNA5jt6DN"); ui.separator();