Skip to content

Commit

Permalink
Add compile date
Browse files Browse the repository at this point in the history
  • Loading branch information
AeEn123 committed Jan 8, 2025
1 parent 8954308 commit 7859d11
Show file tree
Hide file tree
Showing 8 changed files with 83 additions and 5 deletions.
62 changes: 62 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
3 changes: 3 additions & 0 deletions locales/de-DE.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,6 @@ confirmation-ban-warning-description = Assets in Spielen zu bearbeiten kann dazu
button-swap = Assets austauschen <F4>
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
2 changes: 1 addition & 1 deletion locales/en-GB.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
4 changes: 3 additions & 1 deletion locales/ja-JP.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,6 @@ version = バージョン: v{ $version }
cache-directory = キャッシュディレクトリ: { $directory }
welcome = ようこそ
download-update-question = アップデートをダウンロードしますか?
update-changelog = 以下に更新内容を表示
update-changelog = 以下に更新内容を表示
support-sponsor = ♥ Sponsor # TODO: Translate
support-project-donate = ♥ Donate # TODO: Translate
2 changes: 2 additions & 0 deletions locales/pl-PL.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
11 changes: 8 additions & 3 deletions src/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit 7859d11

Please sign in to comment.