Skip to content

Commit 57cb9d0

Browse files
authored
fix: Dynamic load copyright (#1030)
1 parent caca1dc commit 57cb9d0

13 files changed

+14
-13
lines changed

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2024 sourcegit
3+
Copyright (c) 2025 sourcegit
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of
66
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
1717
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
1818
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
1919
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20-
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

src/Resources/Locales/de_DE.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<x:String x:Key="Text.About.Menu" xml:space="preserve">Über SourceGit</x:String>
77
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Erstellt mit </x:String>
88
<x:String x:Key="Text.About.Chart" xml:space="preserve">• Grafik gerendert durch </x:String>
9-
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
109
<x:String x:Key="Text.About.Editor" xml:space="preserve">• Texteditor von </x:String>
1110
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• Monospace-Schriftarten von </x:String>
1211
<x:String x:Key="Text.About.SourceCode" xml:space="preserve">• Quelltext findest du auf </x:String>

src/Resources/Locales/en_US.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<x:String x:Key="Text.About.Menu" xml:space="preserve">About SourceGit</x:String>
44
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Build with </x:String>
55
<x:String x:Key="Text.About.Chart" xml:space="preserve">• Chart is rendered by </x:String>
6-
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
76
<x:String x:Key="Text.About.Editor" xml:space="preserve">• TextEditor from </x:String>
87
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• Monospace fonts come from </x:String>
98
<x:String x:Key="Text.About.SourceCode" xml:space="preserve">• Source code can be found at </x:String>

src/Resources/Locales/es_ES.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<x:String x:Key="Text.About.Menu" xml:space="preserve">Acerca de SourceGit</x:String>
77
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Construido con </x:String>
88
<x:String x:Key="Text.About.Chart" xml:space="preserve">• El gráfico es renderizado por </x:String>
9-
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
109
<x:String x:Key="Text.About.Editor" xml:space="preserve">• Editor de texto de </x:String>
1110
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• Las fuentes monoespaciadas provienen de </x:String>
1211
<x:String x:Key="Text.About.SourceCode" xml:space="preserve">• El código fuente se puede encontrar en </x:String>

src/Resources/Locales/fr_FR.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<x:String x:Key="Text.About.Menu" xml:space="preserve">À propos de SourceGit</x:String>
77
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Compilé avec </x:String>
88
<x:String x:Key="Text.About.Chart" xml:space="preserve">• Le graphique est rendu par </x:String>
9-
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
109
<x:String x:Key="Text.About.Editor" xml:space="preserve">• TextEditor de </x:String>
1110
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• Les polices Monospace proviennent de </x:String>
1211
<x:String x:Key="Text.About.SourceCode" xml:space="preserve">• Le code source est disponible sur </x:String>

src/Resources/Locales/it_IT.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<x:String x:Key="Text.About.Menu" xml:space="preserve">Informazioni su SourceGit</x:String>
77
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Creato con </x:String>
88
<x:String x:Key="Text.About.Chart" xml:space="preserve">• Il grafico è reso da </x:String>
9-
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
109
<x:String x:Key="Text.About.Editor" xml:space="preserve">• Editor di testo da </x:String>
1110
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• I font monospaziati provengono da </x:String>
1211
<x:String x:Key="Text.About.SourceCode" xml:space="preserve">• Il codice sorgente è disponibile su </x:String>

src/Resources/Locales/pt_BR.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
<x:String x:Key="Text.About.Menu" xml:space="preserve">Sobre o SourceGit</x:String>
3232
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Construído com </x:String>
3333
<x:String x:Key="Text.About.Chart" xml:space="preserve">• Gráfico desenhado por </x:String>
34-
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
3534
<x:String x:Key="Text.About.Editor" xml:space="preserve">• Editor de Texto de </x:String>
3635
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• Fontes monoespaçadas de </x:String>
3736
<x:String x:Key="Text.About.SourceCode" xml:space="preserve">• Código-fonte pode ser encontrado em </x:String>

src/Resources/Locales/ru_RU.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<x:String x:Key="Text.About.Menu" xml:space="preserve">О SourceGit</x:String>
77
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• Сборка с </x:String>
88
<x:String x:Key="Text.About.Chart" xml:space="preserve">• Диаграмма отображается с помощью</x:String>
9-
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
109
<x:String x:Key="Text.About.Editor" xml:space="preserve">• Текстовый редактор от </x:String>
1110
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• Моноширинные шрифты взяты из </x:String>
1211
<x:String x:Key="Text.About.SourceCode" xml:space="preserve">• Исходный код можно найти по адресу </x:String>

src/Resources/Locales/zh_CN.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<x:String x:Key="Text.About.Menu" xml:space="preserve">关于本软件</x:String>
77
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• 项目依赖于 </x:String>
88
<x:String x:Key="Text.About.Chart" xml:space="preserve">• 图表绘制组件来自 </x:String>
9-
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
109
<x:String x:Key="Text.About.Editor" xml:space="preserve">• 文本编辑器使用 </x:String>
1110
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• 等宽字体来自于 </x:String>
1211
<x:String x:Key="Text.About.SourceCode" xml:space="preserve">• 项目源代码地址 </x:String>

src/Resources/Locales/zh_TW.axaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<x:String x:Key="Text.About.Menu" xml:space="preserve">關於 SourceGit</x:String>
77
<x:String x:Key="Text.About.BuildWith" xml:space="preserve">• 專案依賴於 </x:String>
88
<x:String x:Key="Text.About.Chart" xml:space="preserve">• 圖表繪製元件來自 </x:String>
9-
<x:String x:Key="Text.About.Copyright" xml:space="preserve">© 2024 sourcegit-scm</x:String>
109
<x:String x:Key="Text.About.Editor" xml:space="preserve">• 文字編輯器使用 </x:String>
1110
<x:String x:Key="Text.About.Fonts" xml:space="preserve">• 等寬字型來自於 </x:String>
1211
<x:String x:Key="Text.About.SourceCode" xml:space="preserve">• 專案原始碼網址 </x:String>

src/SourceGit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<Product>SourceGit</Product>
1414
<Description>OpenSource GIT client</Description>
1515
<Company>sourcegit-scm</Company>
16-
<Copyright>Copyright © 2024 sourcegit-scm.</Copyright>
16+
<Copyright>Copyright © $([System.DateTime]::Now.Year) sourcegit-scm.</Copyright>
1717
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1818
<PackageProjectUrl>https://github.com/sourcegit-scm/sourcegit.git</PackageProjectUrl>
1919
<RepositoryUrl>https://github.com/sourcegit-scm/sourcegit.git</RepositoryUrl>

src/Views/About.axaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
<TextBlock Margin="2,0,0,0" Text="{DynamicResource Text.About.SubTitle}" FontSize="16"/>
5454

55-
<TextBlock Margin="2,8,0,0" Text="{DynamicResource Text.About.Copyright}" Foreground="{DynamicResource Brush.FG2}"/>
55+
<TextBlock Margin="2,8,0,0" Text="{Binding Copyright}" Foreground="{DynamicResource Brush.FG2}"/>
5656

5757
<StackPanel Orientation="Vertical" Margin="0,24,0,0">
5858
<StackPanel Orientation="Horizontal" Height="18">

src/Views/About.axaml.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,21 @@ public string Version
1111
private set;
1212
}
1313

14+
public string Copyright
15+
{
16+
get;
17+
private set;
18+
}
19+
1420
public About()
1521
{
1622
var ver = Assembly.GetExecutingAssembly().GetName().Version;
1723
if (ver != null)
1824
Version = $"{ver.Major}.{ver.Minor}";
25+
var attributes = Assembly.GetExecutingAssembly()
26+
.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
27+
if (attributes.Length > 0)
28+
Copyright = ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
1929

2030
DataContext = this;
2131
InitializeComponent();

0 commit comments

Comments
 (0)