fix: Dynamic load copyright (#1030)

This commit is contained in:
GadflyFang 2025-02-27 21:14:24 +08:00 committed by GitHub
parent caca1dcaaf
commit 57cb9d0909
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 14 additions and 13 deletions

View file

@ -1,6 +1,6 @@
The MIT License (MIT) 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 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 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 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 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 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. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -6,7 +6,6 @@
<x:String x:Key="Text.About.Menu" xml:space="preserve">Über SourceGit</x:String> <x:String x:Key="Text.About.Menu" xml:space="preserve">Über SourceGit</x:String>
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Erstellt mit </x:String> <x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Erstellt mit </x:String>
<x:String x:Key="Text.About.Chart" xml:space="preserve">• Grafik gerendert durch </x:String> <x:String x:Key="Text.About.Chart" xml:space="preserve">• Grafik gerendert durch </x:String>
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
<x:String x:Key="Text.About.Editor" xml:space="preserve">• Texteditor von </x:String> <x:String x:Key="Text.About.Editor" xml:space="preserve">• Texteditor von </x:String>
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• Monospace-Schriftarten von </x:String> <x:String x:Key="Text.About.Fonts" xml:space="preserve">• Monospace-Schriftarten von </x:String>
<x:String x:Key="Text.About.SourceCode" xml:space="preserve">• Quelltext findest du auf </x:String> <x:String x:Key="Text.About.SourceCode" xml:space="preserve">• Quelltext findest du auf </x:String>

View file

@ -3,7 +3,6 @@
<x:String x:Key="Text.About.Menu" xml:space="preserve">About SourceGit</x:String> <x:String x:Key="Text.About.Menu" xml:space="preserve">About SourceGit</x:String>
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Build with </x:String> <x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Build with </x:String>
<x:String x:Key="Text.About.Chart" xml:space="preserve">• Chart is rendered by </x:String> <x:String x:Key="Text.About.Chart" xml:space="preserve">• Chart is rendered by </x:String>
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
<x:String x:Key="Text.About.Editor" xml:space="preserve">• TextEditor from </x:String> <x:String x:Key="Text.About.Editor" xml:space="preserve">• TextEditor from </x:String>
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• Monospace fonts come from </x:String> <x:String x:Key="Text.About.Fonts" xml:space="preserve">• Monospace fonts come from </x:String>
<x:String x:Key="Text.About.SourceCode" xml:space="preserve">• Source code can be found at </x:String> <x:String x:Key="Text.About.SourceCode" xml:space="preserve">• Source code can be found at </x:String>

View file

@ -6,7 +6,6 @@
<x:String x:Key="Text.About.Menu" xml:space="preserve">Acerca de SourceGit</x:String> <x:String x:Key="Text.About.Menu" xml:space="preserve">Acerca de SourceGit</x:String>
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Construido con </x:String> <x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Construido con </x:String>
<x:String x:Key="Text.About.Chart" xml:space="preserve">• El gráfico es renderizado por </x:String> <x:String x:Key="Text.About.Chart" xml:space="preserve">• El gráfico es renderizado por </x:String>
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
<x:String x:Key="Text.About.Editor" xml:space="preserve">• Editor de texto de </x:String> <x:String x:Key="Text.About.Editor" xml:space="preserve">• Editor de texto de </x:String>
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• Las fuentes monoespaciadas provienen de </x:String> <x:String x:Key="Text.About.Fonts" xml:space="preserve">• Las fuentes monoespaciadas provienen de </x:String>
<x:String x:Key="Text.About.SourceCode" xml:space="preserve">• El código fuente se puede encontrar en </x:String> <x:String x:Key="Text.About.SourceCode" xml:space="preserve">• El código fuente se puede encontrar en </x:String>

View file

@ -6,7 +6,6 @@
<x:String x:Key="Text.About.Menu" xml:space="preserve">À propos de SourceGit</x:String> <x:String x:Key="Text.About.Menu" xml:space="preserve">À propos de SourceGit</x:String>
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Compilé avec </x:String> <x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Compilé avec </x:String>
<x:String x:Key="Text.About.Chart" xml:space="preserve">• Le graphique est rendu par </x:String> <x:String x:Key="Text.About.Chart" xml:space="preserve">• Le graphique est rendu par </x:String>
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
<x:String x:Key="Text.About.Editor" xml:space="preserve">• TextEditor de </x:String> <x:String x:Key="Text.About.Editor" xml:space="preserve">• TextEditor de </x:String>
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• Les polices Monospace proviennent de </x:String> <x:String x:Key="Text.About.Fonts" xml:space="preserve">• Les polices Monospace proviennent de </x:String>
<x:String x:Key="Text.About.SourceCode" xml:space="preserve">• Le code source est disponible sur </x:String> <x:String x:Key="Text.About.SourceCode" xml:space="preserve">• Le code source est disponible sur </x:String>

View file

@ -6,7 +6,6 @@
<x:String x:Key="Text.About.Menu" xml:space="preserve">Informazioni su SourceGit</x:String> <x:String x:Key="Text.About.Menu" xml:space="preserve">Informazioni su SourceGit</x:String>
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Creato con </x:String> <x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Creato con </x:String>
<x:String x:Key="Text.About.Chart" xml:space="preserve">• Il grafico è reso da </x:String> <x:String x:Key="Text.About.Chart" xml:space="preserve">• Il grafico è reso da </x:String>
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
<x:String x:Key="Text.About.Editor" xml:space="preserve">• Editor di testo da </x:String> <x:String x:Key="Text.About.Editor" xml:space="preserve">• Editor di testo da </x:String>
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• I font monospaziati provengono da </x:String> <x:String x:Key="Text.About.Fonts" xml:space="preserve">• I font monospaziati provengono da </x:String>
<x:String x:Key="Text.About.SourceCode" xml:space="preserve">• Il codice sorgente è disponibile su </x:String> <x:String x:Key="Text.About.SourceCode" xml:space="preserve">• Il codice sorgente è disponibile su </x:String>

View file

@ -31,7 +31,6 @@
<x:String x:Key="Text.About.Menu" xml:space="preserve">Sobre o SourceGit</x:String> <x:String x:Key="Text.About.Menu" xml:space="preserve">Sobre o SourceGit</x:String>
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Construído com </x:String> <x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Construído com </x:String>
<x:String x:Key="Text.About.Chart" xml:space="preserve">• Gráfico desenhado por </x:String> <x:String x:Key="Text.About.Chart" xml:space="preserve">• Gráfico desenhado por </x:String>
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
<x:String x:Key="Text.About.Editor" xml:space="preserve">• Editor de Texto de </x:String> <x:String x:Key="Text.About.Editor" xml:space="preserve">• Editor de Texto de </x:String>
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• Fontes monoespaçadas de </x:String> <x:String x:Key="Text.About.Fonts" xml:space="preserve">• Fontes monoespaçadas de </x:String>
<x:String x:Key="Text.About.SourceCode" xml:space="preserve">• Código-fonte pode ser encontrado em </x:String> <x:String x:Key="Text.About.SourceCode" xml:space="preserve">• Código-fonte pode ser encontrado em </x:String>

View file

@ -6,7 +6,6 @@
<x:String x:Key="Text.About.Menu" xml:space="preserve">О SourceGit</x:String> <x:String x:Key="Text.About.Menu" xml:space="preserve">О SourceGit</x:String>
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Сборка с </x:String> <x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Сборка с </x:String>
<x:String x:Key="Text.About.Chart" xml:space="preserve">• Диаграмма отображается с помощью</x:String> <x:String x:Key="Text.About.Chart" xml:space="preserve">• Диаграмма отображается с помощью</x:String>
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
<x:String x:Key="Text.About.Editor" xml:space="preserve">• Текстовый редактор от </x:String> <x:String x:Key="Text.About.Editor" xml:space="preserve">• Текстовый редактор от </x:String>
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• Моноширинные шрифты взяты из </x:String> <x:String x:Key="Text.About.Fonts" xml:space="preserve">• Моноширинные шрифты взяты из </x:String>
<x:String x:Key="Text.About.SourceCode" xml:space="preserve">• Исходный код можно найти по адресу </x:String> <x:String x:Key="Text.About.SourceCode" xml:space="preserve">• Исходный код можно найти по адресу </x:String>

View file

@ -6,7 +6,6 @@
<x:String x:Key="Text.About.Menu" xml:space="preserve">关于本软件</x:String> <x:String x:Key="Text.About.Menu" xml:space="preserve">关于本软件</x:String>
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• 项目依赖于 </x:String> <x:String x:Key="Text.About.BuildWith" xml:space="preserve">• 项目依赖于 </x:String>
<x:String x:Key="Text.About.Chart" xml:space="preserve">• 图表绘制组件来自 </x:String> <x:String x:Key="Text.About.Chart" xml:space="preserve">• 图表绘制组件来自 </x:String>
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
<x:String x:Key="Text.About.Editor" xml:space="preserve">• 文本编辑器使用 </x:String> <x:String x:Key="Text.About.Editor" xml:space="preserve">• 文本编辑器使用 </x:String>
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• 等宽字体来自于 </x:String> <x:String x:Key="Text.About.Fonts" xml:space="preserve">• 等宽字体来自于 </x:String>
<x:String x:Key="Text.About.SourceCode" xml:space="preserve">• 项目源代码地址 </x:String> <x:String x:Key="Text.About.SourceCode" xml:space="preserve">• 项目源代码地址 </x:String>

View file

@ -6,7 +6,6 @@
<x:String x:Key="Text.About.Menu" xml:space="preserve">關於 SourceGit</x:String> <x:String x:Key="Text.About.Menu" xml:space="preserve">關於 SourceGit</x:String>
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• 專案依賴於 </x:String> <x:String x:Key="Text.About.BuildWith" xml:space="preserve">• 專案依賴於 </x:String>
<x:String x:Key="Text.About.Chart" xml:space="preserve">• 圖表繪製元件來自 </x:String> <x:String x:Key="Text.About.Chart" xml:space="preserve">• 圖表繪製元件來自 </x:String>
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
<x:String x:Key="Text.About.Editor" xml:space="preserve">• 文字編輯器使用 </x:String> <x:String x:Key="Text.About.Editor" xml:space="preserve">• 文字編輯器使用 </x:String>
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• 等寬字型來自於 </x:String> <x:String x:Key="Text.About.Fonts" xml:space="preserve">• 等寬字型來自於 </x:String>
<x:String x:Key="Text.About.SourceCode" xml:space="preserve">• 專案原始碼網址 </x:String> <x:String x:Key="Text.About.SourceCode" xml:space="preserve">• 專案原始碼網址 </x:String>

View file

@ -13,7 +13,7 @@
<Product>SourceGit</Product> <Product>SourceGit</Product>
<Description>OpenSource GIT client</Description> <Description>OpenSource GIT client</Description>
<Company>sourcegit-scm</Company> <Company>sourcegit-scm</Company>
<Copyright>Copyright © 2024 sourcegit-scm.</Copyright> <Copyright>Copyright © $([System.DateTime]::Now.Year) sourcegit-scm.</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression> <PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/sourcegit-scm/sourcegit.git</PackageProjectUrl> <PackageProjectUrl>https://github.com/sourcegit-scm/sourcegit.git</PackageProjectUrl>
<RepositoryUrl>https://github.com/sourcegit-scm/sourcegit.git</RepositoryUrl> <RepositoryUrl>https://github.com/sourcegit-scm/sourcegit.git</RepositoryUrl>

View file

@ -52,7 +52,7 @@
<TextBlock Margin="2,0,0,0" Text="{DynamicResource Text.About.SubTitle}" FontSize="16"/> <TextBlock Margin="2,0,0,0" Text="{DynamicResource Text.About.SubTitle}" FontSize="16"/>
<TextBlock Margin="2,8,0,0" Text="{DynamicResource Text.About.Copyright}" Foreground="{DynamicResource Brush.FG2}"/> <TextBlock Margin="2,8,0,0" Text="{Binding Copyright}" Foreground="{DynamicResource Brush.FG2}"/>
<StackPanel Orientation="Vertical" Margin="0,24,0,0"> <StackPanel Orientation="Vertical" Margin="0,24,0,0">
<StackPanel Orientation="Horizontal" Height="18"> <StackPanel Orientation="Horizontal" Height="18">

View file

@ -11,11 +11,21 @@ namespace SourceGit.Views
private set; private set;
} }
public string Copyright
{
get;
private set;
}
public About() public About()
{ {
var ver = Assembly.GetExecutingAssembly().GetName().Version; var ver = Assembly.GetExecutingAssembly().GetName().Version;
if (ver != null) if (ver != null)
Version = $"{ver.Major}.{ver.Minor}"; Version = $"{ver.Major}.{ver.Minor}";
var attributes = Assembly.GetExecutingAssembly()
.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
if (attributes.Length > 0)
Copyright = ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
DataContext = this; DataContext = this;
InitializeComponent(); InitializeComponent();