check updates - translation strings.

This commit is contained in:
morkt 2017-02-14 09:16:12 +04:00
parent 987d57a4db
commit ccd4424b1b
8 changed files with 219 additions and 11 deletions

View File

@ -33,6 +33,7 @@ using System.Windows;
using System.Windows.Input;
using System.Xml;
using GameRes;
using GARbro.GUI.Strings;
namespace GARbro.GUI
{
@ -70,7 +71,7 @@ namespace GARbro.GUI
{
if (e.Error != null)
{
SetStatusText (string.Format ("{0} {1}", "Update failed.", e.Error.Message));
SetStatusText (string.Format ("{0} {1}", guiStrings.MsgUpdateFailed, e.Error.Message));
return;
}
else if (e.Cancelled)
@ -78,7 +79,7 @@ namespace GARbro.GUI
var result = e.Result as GarUpdateInfo;
if (null == result)
{
SetStatusText ("No updates currently available.");
SetStatusText (guiStrings.MsgNoUpdates);
return;
}
var app_version = Assembly.GetExecutingAssembly().GetName().Version;
@ -87,12 +88,12 @@ namespace GARbro.GUI
bool has_db_update = db_version < result.FormatsVersion && CheckAssemblies (result.Assemblies);
if (!has_app_update && !has_db_update)
{
SetStatusText ("GARbro version is up to date.");
SetStatusText (guiStrings.MsgUpToDate);
return;
}
var dialog = new UpdateDialog (result, has_app_update, has_db_update);
dialog.Owner = this;
dialog.FormatsDownload.Click = FormatsDownloadExec;
dialog.FormatsDownload.Click += FormatsDownloadExec;
dialog.ShowDialog();
}

View File

@ -151,7 +151,7 @@
</MenuItem>
<MenuItem Header="{x:Static s:guiStrings.MenuHelp}">
<MenuItem Header="{x:Static s:guiStrings.MenuAbout}" Command="{x:Static local:Commands.About}"/>
<MenuItem Header="Check for updates..." Command="{x:Static local:Commands.CheckUpdates}"/>
<MenuItem Header="{x:Static s:guiStrings.MenuCheckUpdates}" Command="{x:Static local:Commands.CheckUpdates}"/>
</MenuItem>
</Menu>
<Separator Height="1" Margin="0"/>

View File

@ -96,6 +96,15 @@ namespace GARbro.GUI.Strings {
}
}
/// <summary>
/// Looks up a localized string similar to _Download.
/// </summary>
public static string ButtonDownload {
get {
return ResourceManager.GetString("ButtonDownload", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Extract.
/// </summary>
@ -456,6 +465,15 @@ namespace GARbro.GUI.Strings {
}
}
/// <summary>
/// Looks up a localized string similar to Release notes.
/// </summary>
public static string LabelReleaseNotes {
get {
return ResourceManager.GetString("LabelReleaseNotes", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Skip incovertible files..
/// </summary>
@ -474,6 +492,15 @@ namespace GARbro.GUI.Strings {
}
}
/// <summary>
/// Looks up a localized string similar to _Check for updates....
/// </summary>
public static string MenuCheckUpdates {
get {
return ResourceManager.GetString("MenuCheckUpdates", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to E_xit.
/// </summary>
@ -771,6 +798,15 @@ namespace GARbro.GUI.Strings {
}
}
/// <summary>
/// Looks up a localized string similar to No updates currently available..
/// </summary>
public static string MsgNoUpdates {
get {
return ResourceManager.GetString("MsgNoUpdates", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to File {0}
///already exists.
@ -837,6 +873,33 @@ namespace GARbro.GUI.Strings {
}
}
/// <summary>
/// Looks up a localized string similar to Formats database update available..
/// </summary>
public static string MsgUpdateAvailable {
get {
return ResourceManager.GetString("MsgUpdateAvailable", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Update check failed..
/// </summary>
public static string MsgUpdateFailed {
get {
return ResourceManager.GetString("MsgUpdateFailed", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to GARbro version is up to date..
/// </summary>
public static string MsgUpToDate {
get {
return ResourceManager.GetString("MsgUpToDate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Version {0}.
/// </summary>
@ -1093,6 +1156,15 @@ namespace GARbro.GUI.Strings {
}
}
/// <summary>
/// Looks up a localized string similar to New version available:.
/// </summary>
public static string TextNewVersion {
get {
return ResourceManager.GetString("TextNewVersion", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Archive parameters.
/// </summary>
@ -1138,6 +1210,15 @@ namespace GARbro.GUI.Strings {
}
}
/// <summary>
/// Looks up a localized string similar to Visit download page.
/// </summary>
public static string TextVisitPage {
get {
return ResourceManager.GetString("TextVisitPage", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Either WAV, MP3 or OGG.
/// </summary>

View File

@ -493,4 +493,40 @@
<data name="TextFileAlreadyExists" xml:space="preserve">
<value>대상폴더에 파일 {0} 이(가) 이미 존재합니다.</value>
</data>
</root>
<data name="ButtonDownload" xml:space="preserve">
<value>Download</value>
<comment>translation pending</comment>
</data>
<data name="LabelReleaseNotes" xml:space="preserve">
<value>Release notes</value>
<comment>translation pending</comment>
</data>
<data name="MenuCheckUpdates" xml:space="preserve">
<value>Check for updates...</value>
<comment>translation pending</comment>
</data>
<data name="MsgNoUpdates" xml:space="preserve">
<value>No updates currently available.</value>
<comment>translation pending</comment>
</data>
<data name="MsgUpdateAvailable" xml:space="preserve">
<value>Formats database update available.</value>
<comment>translation pending</comment>
</data>
<data name="MsgUpdateFailed" xml:space="preserve">
<value>Update check failed.</value>
<comment>translation pending</comment>
</data>
<data name="MsgUpToDate" xml:space="preserve">
<value>GARbro version is up to date.</value>
<comment>translation pending</comment>
</data>
<data name="TextNewVersion" xml:space="preserve">
<value>New version available:</value>
<comment>translation pending</comment>
</data>
<data name="TextVisitPage" xml:space="preserve">
<value>Visit download page</value>
<comment>translation pending</comment>
</data>
</root>

View File

@ -497,4 +497,31 @@ Overwrite?</value>
<data name="TextFileAlreadyExists" xml:space="preserve">
<value>File {0} already exists in the destination folder.</value>
</data>
<data name="ButtonDownload" xml:space="preserve">
<value>_Download</value>
</data>
<data name="LabelReleaseNotes" xml:space="preserve">
<value>Release notes</value>
</data>
<data name="MenuCheckUpdates" xml:space="preserve">
<value>_Check for updates...</value>
</data>
<data name="MsgNoUpdates" xml:space="preserve">
<value>No updates currently available.</value>
</data>
<data name="MsgUpdateAvailable" xml:space="preserve">
<value>Formats database update available.</value>
</data>
<data name="MsgUpdateFailed" xml:space="preserve">
<value>Update check failed.</value>
</data>
<data name="MsgUpToDate" xml:space="preserve">
<value>GARbro version is up to date.</value>
</data>
<data name="TextNewVersion" xml:space="preserve">
<value>New version available:</value>
</data>
<data name="TextVisitPage" xml:space="preserve">
<value>Visit download page</value>
</data>
</root>

View File

@ -518,4 +518,31 @@
<data name="TextFileAlreadyExists" xml:space="preserve">
<value>Файл с именем {0} уже существует.</value>
</data>
<data name="ButtonDownload" xml:space="preserve">
<value>Обновить</value>
</data>
<data name="LabelReleaseNotes" xml:space="preserve">
<value>Примечания к выпуску</value>
</data>
<data name="MenuCheckUpdates" xml:space="preserve">
<value>Проверить обновления...</value>
</data>
<data name="MsgNoUpdates" xml:space="preserve">
<value>Обновления недоступны.</value>
</data>
<data name="MsgUpdateAvailable" xml:space="preserve">
<value>Доступна обновлённая база форматов.</value>
</data>
<data name="MsgUpdateFailed" xml:space="preserve">
<value>Сбой проверки обновлений.</value>
</data>
<data name="MsgUpToDate" xml:space="preserve">
<value>Установлена актуальная версия GARbro.</value>
</data>
<data name="TextNewVersion" xml:space="preserve">
<value>Доступна новая версия:</value>
</data>
<data name="TextVisitPage" xml:space="preserve">
<value>Перейти на страницу загрузки</value>
</data>
</root>

View File

@ -505,4 +505,40 @@
<data name="TextFileAlreadyExists" xml:space="preserve">
<value>文件{0}已经存在。</value>
</data>
<data name="ButtonDownload" xml:space="preserve">
<value>Download</value>
<comment>translation pending</comment>
</data>
<data name="LabelReleaseNotes" xml:space="preserve">
<value>Release notes</value>
<comment>translation pending</comment>
</data>
<data name="MenuCheckUpdates" xml:space="preserve">
<value>Check for updates...</value>
<comment>translation pending</comment>
</data>
<data name="MsgNoUpdates" xml:space="preserve">
<value>No updates currently available.</value>
<comment>translation pending</comment>
</data>
<data name="MsgUpdateAvailable" xml:space="preserve">
<value>Formats database update available.</value>
<comment>translation pending</comment>
</data>
<data name="MsgUpdateFailed" xml:space="preserve">
<value>Update check failed.</value>
<comment>translation pending</comment>
</data>
<data name="MsgUpToDate" xml:space="preserve">
<value>GARbro version is up to date.</value>
<comment>translation pending</comment>
</data>
<data name="TextNewVersion" xml:space="preserve">
<value>New version available:</value>
<comment>translation pending</comment>
</data>
<data name="TextVisitPage" xml:space="preserve">
<value>Visit download page</value>
<comment>translation pending</comment>
</data>
</root>

View File

@ -39,22 +39,22 @@ IN THE SOFTWARE.
<StackPanel DockPanel.Dock="Right" Orientation="Vertical">
<StackPanel x:Name="ReleasePane" Orientation="Vertical">
<StackPanel Orientation="Horizontal">
<TextBlock Text="New version available:" Margin="0,10,0,0"/>
<TextBlock Text="{x:Static s:guiStrings.TextNewVersion}" Margin="0,10,0,0"/>
<TextBlock x:Name="ReleaseVersion" Text="{Binding ReleaseVersion}" Margin="5,10,10,0"/>
</StackPanel>
<Expander x:Name="ReleaseNotes" Header="Release notes" ExpandDirection="Down" IsExpanded="False" Margin="0,0,10,0">
<Expander x:Name="ReleaseNotes" Header="{x:Static s:guiStrings.LabelReleaseNotes}" ExpandDirection="Down" IsExpanded="False" Margin="0,0,10,0">
<TextBlock Text="{Binding ReleaseNotes}"/>
</Expander>
<TextBlock Margin="0,5,10,10">
<Hyperlink NavigateUri="{Binding ReleaseUrl}" RequestNavigate="Hyperlink_RequestNavigate">
<TextBlock Text="Visit download page" ToolTip="{Binding ReleaseUrl}"/>
<TextBlock Text="{x:Static s:guiStrings.TextVisitPage}" ToolTip="{Binding ReleaseUrl}"/>
</Hyperlink>
</TextBlock>
</StackPanel>
<StackPanel x:Name="FormatsPane" Orientation="Vertical">
<Separator Visibility="{Binding ElementName=ReleasePane, Path=Visibility}"/>
<TextBlock Text="Formats database update available." Margin="0,10,10,0"/>
<Button x:Name="FormatsDownload" Content="_Download" MinWidth="75" Height="25" Margin="0,10,10,10"/>
<TextBlock Text="{x:Static s:guiStrings.MsgUpdateAvailable}" Margin="0,10,10,0"/>
<Button x:Name="FormatsDownload" Content="{x:Static s:guiStrings.ButtonDownload}" Width="75" Height="25" Margin="0,10,10,10" HorizontalAlignment="Left"/>
</StackPanel>
</StackPanel>
</DockPanel>