From 7c849c57f0d5f455918e28103ff47450d36e1874 Mon Sep 17 00:00:00 2001 From: Gadfly Date: Thu, 27 Feb 2025 20:02:14 +0800 Subject: [PATCH] fix: Dynamic load copyright --- LICENSE | 4 ++-- src/Resources/Locales/de_DE.axaml | 1 - src/Resources/Locales/en_US.axaml | 1 - src/Resources/Locales/es_ES.axaml | 1 - src/Resources/Locales/fr_FR.axaml | 1 - src/Resources/Locales/it_IT.axaml | 1 - src/Resources/Locales/pt_BR.axaml | 1 - src/Resources/Locales/ru_RU.axaml | 1 - src/Resources/Locales/zh_CN.axaml | 1 - src/Resources/Locales/zh_TW.axaml | 1 - src/SourceGit.csproj | 2 +- src/Views/About.axaml | 2 +- src/Views/About.axaml.cs | 10 ++++++++++ 13 files changed, 14 insertions(+), 13 deletions(-) diff --git a/LICENSE b/LICENSE index dceab2d83..442ce085e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2024 sourcegit +Copyright (c) 2025 sourcegit Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in @@ -17,4 +17,4 @@ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml index c16c90b57..1d0ca8956 100644 --- a/src/Resources/Locales/de_DE.axaml +++ b/src/Resources/Locales/de_DE.axaml @@ -6,7 +6,6 @@ Über SourceGit • Erstellt mit • Grafik gerendert durch - © 2024 sourcegit-scm • Texteditor von • Monospace-Schriftarten von • Quelltext findest du auf diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 6c397ea0c..5208a2693 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -3,7 +3,6 @@ About SourceGit • Build with • Chart is rendered by - © 2024 sourcegit-scm • TextEditor from • Monospace fonts come from • Source code can be found at diff --git a/src/Resources/Locales/es_ES.axaml b/src/Resources/Locales/es_ES.axaml index ef98a1a24..bf635321b 100644 --- a/src/Resources/Locales/es_ES.axaml +++ b/src/Resources/Locales/es_ES.axaml @@ -6,7 +6,6 @@ Acerca de SourceGit • Construido con • El gráfico es renderizado por - © 2024 sourcegit-scm • Editor de texto de • Las fuentes monoespaciadas provienen de • El código fuente se puede encontrar en diff --git a/src/Resources/Locales/fr_FR.axaml b/src/Resources/Locales/fr_FR.axaml index b269424ab..59fe00a87 100644 --- a/src/Resources/Locales/fr_FR.axaml +++ b/src/Resources/Locales/fr_FR.axaml @@ -6,7 +6,6 @@ À propos de SourceGit • Compilé avec • Le graphique est rendu par - © 2024 sourcegit-scm • TextEditor de • Les polices Monospace proviennent de • Le code source est disponible sur diff --git a/src/Resources/Locales/it_IT.axaml b/src/Resources/Locales/it_IT.axaml index 1d0d353e1..42a7e334b 100644 --- a/src/Resources/Locales/it_IT.axaml +++ b/src/Resources/Locales/it_IT.axaml @@ -6,7 +6,6 @@ Informazioni su SourceGit • Creato con • Il grafico è reso da - © 2024 sourcegit-scm • Editor di testo da • I font monospaziati provengono da • Il codice sorgente è disponibile su diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml index a318cfa8e..78445bfbd 100644 --- a/src/Resources/Locales/pt_BR.axaml +++ b/src/Resources/Locales/pt_BR.axaml @@ -31,7 +31,6 @@ Sobre o SourceGit • Construído com • Gráfico desenhado por - © 2024 sourcegit-scm • Editor de Texto de • Fontes monoespaçadas de • Código-fonte pode ser encontrado em diff --git a/src/Resources/Locales/ru_RU.axaml b/src/Resources/Locales/ru_RU.axaml index a1c40764f..4468650b0 100644 --- a/src/Resources/Locales/ru_RU.axaml +++ b/src/Resources/Locales/ru_RU.axaml @@ -6,7 +6,6 @@ О SourceGit • Сборка с • Диаграмма отображается с помощью - © 2024 sourcegit-scm • Текстовый редактор от • Моноширинные шрифты взяты из • Исходный код можно найти по адресу diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index 09c46e95c..0e8b9f7d0 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -6,7 +6,6 @@ 关于本软件 • 项目依赖于 • 图表绘制组件来自 - © 2024 sourcegit-scm • 文本编辑器使用 • 等宽字体来自于 • 项目源代码地址 diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml index 0eb54676c..f4cfad08c 100644 --- a/src/Resources/Locales/zh_TW.axaml +++ b/src/Resources/Locales/zh_TW.axaml @@ -6,7 +6,6 @@ 關於 SourceGit • 專案依賴於 • 圖表繪製元件來自 - © 2024 sourcegit-scm • 文字編輯器使用 • 等寬字型來自於 • 專案原始碼網址 diff --git a/src/SourceGit.csproj b/src/SourceGit.csproj index 4183511ea..c001fca07 100644 --- a/src/SourceGit.csproj +++ b/src/SourceGit.csproj @@ -13,7 +13,7 @@ SourceGit OpenSource GIT client sourcegit-scm - Copyright © 2024 sourcegit-scm. + Copyright © $([System.DateTime]::Now.Year) sourcegit-scm. MIT https://github.com/sourcegit-scm/sourcegit.git https://github.com/sourcegit-scm/sourcegit.git diff --git a/src/Views/About.axaml b/src/Views/About.axaml index d781ee9e1..6e45ab705 100644 --- a/src/Views/About.axaml +++ b/src/Views/About.axaml @@ -52,7 +52,7 @@ - + diff --git a/src/Views/About.axaml.cs b/src/Views/About.axaml.cs index b02cd13f3..bbfd659ca 100644 --- a/src/Views/About.axaml.cs +++ b/src/Views/About.axaml.cs @@ -11,11 +11,21 @@ public string Version private set; } + public string Copyright + { + get; + private set; + } + public About() { var ver = Assembly.GetExecutingAssembly().GetName().Version; if (ver != null) Version = $"{ver.Major}.{ver.Minor}"; + var attributes = Assembly.GetExecutingAssembly() + .GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false); + if (attributes.Length > 0) + Copyright = ((AssemblyCopyrightAttribute)attributes[0]).Copyright; DataContext = this; InitializeComponent();