Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Translations issues
  • Loading branch information
isax5 committed Jul 28, 2021
1 parent c0fcf2c commit f7d7a32
Show file tree
Hide file tree
Showing 11 changed files with 211 additions and 198 deletions.
6 changes: 6 additions & 0 deletions src/Hymnal.XF/Hymnal.XF.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,10 @@
<DependentUpon>LanguageResources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Resources\Languages\LanguageResources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>LanguageResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>
194 changes: 97 additions & 97 deletions src/Hymnal.XF/Resources/Languages/LanguageResources.Designer.cs

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions src/Hymnal.XF/Resources/Languages/LanguageResources.es.resx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<value>Himnario Adventista</value>
<comment>Tab:Number: Title</comment>
</data>
<data name="Close" xml:space="preserve">
<data name="Generic_Close" xml:space="preserve">
<value>Cerrar</value>
<comment>HymnPage: Close page</comment>
</data>
Expand Down Expand Up @@ -52,7 +52,7 @@
<value>Número</value>
<comment>Tab: Number</comment>
</data>
<data name="Open" xml:space="preserve">
<data name="Generic_Open" xml:space="preserve">
<value>Abrir</value>
<comment>Tab:Number: Open</comment>
</data>
Expand All @@ -72,7 +72,7 @@
<value>Tamaño de fuente</value>
<comment>Settings: FontSize</comment>
</data>
<data name="Cancel" xml:space="preserve">
<data name="Generic_Cancel" xml:space="preserve">
<value>Cancelar</value>
<comment>Alert: Cancel</comment>
</data>
Expand All @@ -88,11 +88,11 @@
<value>No hay conexión a Internet</value>
<comment>Alert: No internet</comment>
</data>
<data name="WeHadAProblem" xml:space="preserve">
<data name="Error_WeHadAProblem" xml:space="preserve">
<value>Tuvimos un problema</value>
<comment>Alert: We had a problem</comment>
</data>
<data name="Ok" xml:space="preserve">
<data name="Generic_Ok" xml:space="preserve">
<value>Ok</value>
<comment>Alert: Ok</comment>
</data>
Expand Down
10 changes: 5 additions & 5 deletions src/Hymnal.XF/Resources/Languages/LanguageResources.pt.resx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<value>Hinário Adventista</value>
<comment>Tab:Number: Title</comment>
</data>
<data name="Close" xml:space="preserve">
<data name="Generic_Close" xml:space="preserve">
<value>Fechar</value>
<comment>HymnPage: Close page</comment>
</data>
Expand Down Expand Up @@ -52,7 +52,7 @@
<value>Número</value>
<comment>Tab: Number</comment>
</data>
<data name="Open" xml:space="preserve">
<data name="Generic_Open" xml:space="preserve">
<value>Abrir</value>
<comment>Tab:Number: Open</comment>
</data>
Expand All @@ -72,7 +72,7 @@
<value>Tamanho da fonte</value>
<comment>Settings: FontSize</comment>
</data>
<data name="Cancel" xml:space="preserve">
<data name="Generic_Cancel" xml:space="preserve">
<value>Cancelar</value>
<comment>Alert: Cancel</comment>
</data>
Expand All @@ -88,11 +88,11 @@
<value>Não há conexão com a Internet</value>
<comment>Alert: No internet</comment>
</data>
<data name="WeHadAProblem" xml:space="preserve">
<data name="Error_WeHadAProblem" xml:space="preserve">
<value>Tivemos um problema</value>
<comment>Alert: We had a problem</comment>
</data>
<data name="Ok" xml:space="preserve">
<data name="Generic_Ok" xml:space="preserve">
<value>Está bem</value>
<comment>Alert: Ok</comment>
</data>
Expand Down
10 changes: 5 additions & 5 deletions src/Hymnal.XF/Resources/Languages/LanguageResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@
<data name="AutomationSettingsPageHelpTextChangeHymn" xml:space="preserve">
<value>Below check current version</value>
</data>
<data name="Cancel" xml:space="preserve">
<data name="Generic_Cancel" xml:space="preserve">
<value>Cancel</value>
<comment>Alert: Cancel</comment>
</data>
<data name="Close" xml:space="preserve">
<data name="Generic_Close" xml:space="preserve">
<value>Close</value>
<comment>HymnPage: Close page</comment>
</data>
Expand Down Expand Up @@ -272,11 +272,11 @@
<value>Number</value>
<comment>Tab: Number</comment>
</data>
<data name="Ok" xml:space="preserve">
<data name="Generic_Ok" xml:space="preserve">
<value>Ok</value>
<comment>Alert: Ok</comment>
</data>
<data name="Open" xml:space="preserve">
<data name="Generic_Open" xml:space="preserve">
<value>Open</value>
<comment>Tab:Number: Open</comment>
</data>
Expand Down Expand Up @@ -308,7 +308,7 @@
<value>Versions and languages</value>
<comment>Settings: Choose hymnal</comment>
</data>
<data name="WeHadAProblem" xml:space="preserve">
<data name="Error_WeHadAProblem" xml:space="preserve">
<value>We had a problem</value>
<comment>Alert: We had a problem</comment>
</data>
Expand Down
13 changes: 8 additions & 5 deletions src/Hymnal.XF/Resources/Languages/LanguageResources.ru.resx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<value>Адвентистская песнь</value>
<comment>Tab:Number: Title</comment>
</data>
<data name="Close" xml:space="preserve">
<data name="Generic_Close" xml:space="preserve">
<value>Закрыть</value>
<comment>HymnPage: Close page</comment>
</data>
Expand Down Expand Up @@ -52,7 +52,7 @@
<value>Номера</value>
<comment>Tab: Number</comment>
</data>
<data name="Open" xml:space="preserve">
<data name="Generic_Open" xml:space="preserve">
<value>Открыть</value>
<comment>Tab:Number: Open</comment>
</data>
Expand All @@ -72,7 +72,7 @@
<value>Размер Шрифта</value>
<comment>Settings: FontSize</comment>
</data>
<data name="Cancel" xml:space="preserve">
<data name="Generic_Cancel" xml:space="preserve">
<value>Отмена</value>
<comment>Alert: Cancel</comment>
</data>
Expand All @@ -88,11 +88,11 @@
<value>Нет подключения к интернету</value>
<comment>Alert: No internet</comment>
</data>
<data name="WeHadAProblem" xml:space="preserve">
<data name="Error_WeHadAProblem" xml:space="preserve">
<value>У нас была проблема</value>
<comment>Alert: We had a problem</comment>
</data>
<data name="Ok" xml:space="preserve">
<data name="Generic_Ok" xml:space="preserve">
<value>Хорошо</value>
<comment>Alert: Ok</comment>
</data>
Expand Down Expand Up @@ -183,4 +183,7 @@
<data name="AutomationIndexPageNumericalOrder" xml:space="preserve">
<value>Изменить на числовой порядок</value>
</data>
<data name="GitHub" xml:space="preserve">
<value>GitHub</value>
</data>
</root>
12 changes: 8 additions & 4 deletions src/Hymnal.XF/Resources/Languages/Languages.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ namespace Hymnal.XF.Resources.Languages
public static class Languages
{
#region Generic
public static string Generic_Close = "Cerrar";
public static string Generic_Close => LanguageResources.Generic_Close;
public static string Generic_Ok => LanguageResources.Generic_Ok;
public static string Generic_Cancel => LanguageResources.Generic_Cancel;
#endregion

#region Error
public static string Error_WeHadAProblem => LanguageResources.Error_WeHadAProblem;
#endregion

public static string ChooseYourHymnal => LanguageResources.VersionsAndLanguages;
public static string Cancel => LanguageResources.Cancel;
public static string WeHadAProblem => LanguageResources.WeHadAProblem;
public static string Ok => LanguageResources.Ok;
public static string NoInternetConnection => LanguageResources.NoInternetConnection;
public static string InstrumentalOrSung => LanguageResources.InstrumentalOrSung;
public static string Instrumental => LanguageResources.Instrumental;
Expand Down
146 changes: 73 additions & 73 deletions src/Hymnal.XF/ViewModels/!Base/BaseViewModel.Param.cs
Original file line number Diff line number Diff line change
@@ -1,74 +1,74 @@
using System.Threading.Tasks;
using Prism.Navigation;
using NavigationParameter = Hymnal.XF.Models.Parameters.NavigationParameter;

namespace Hymnal.XF.ViewModels
{
public abstract class BaseViewModelParameter<TParameter> : BaseViewModel where TParameter : NavigationParameter
{
private TParameter parameter;
public TParameter Parameter
{
get => parameter;
private set => SetProperty(ref parameter, value);
}

protected BaseViewModelParameter(INavigationService navigationService) : base(navigationService)
{ }

public override void Initialize(INavigationParameters parameters)
{
base.Initialize(parameters);

if (resolveParam(parameters, out TParameter value))
{
Initialize(parameters, value);
}
}

public override async Task InitializeAsync(INavigationParameters parameters)
{
await base.InitializeAsync(parameters);

if (resolveParam(parameters, out TParameter value))
{
await InitializeAsync(parameters, value);
}
}

public override void OnNavigatedTo(INavigationParameters parameters)
{
base.OnNavigatedTo(parameters);

if (resolveParam(parameters, out TParameter value))
{
OnNavigatedTo(parameters, value);
}
}

public virtual void Initialize(INavigationParameters parameters, TParameter parameter)
{ }

public virtual Task InitializeAsync(INavigationParameters parameters, TParameter parameter)
{ return Task.CompletedTask; }

public virtual void OnNavigatedTo(INavigationParameters parameters, TParameter parameter)
{ }

private bool resolveParam(INavigationParameters parameters, out TParameter value)
{
if (Parameter is not null)
{
value = Parameter;
return true;
}

var returnValue = parameters.TryGetValue(NavigationParameter.Key, out value)
|| parameters.TryGetValue(KnownNavigationParameters.XamlParam, out value);

Parameter = value;

return returnValue;
}
}
}
using Prism.Navigation;
using NavigationParameter = Hymnal.XF.Models.Parameters.NavigationParameter;

namespace Hymnal.XF.ViewModels
{
public abstract class BaseViewModelParameter<TParameter> : BaseViewModel where TParameter : NavigationParameter
{
private TParameter parameter;
public TParameter Parameter
{
get => parameter;
private set => SetProperty(ref parameter, value);
}

protected BaseViewModelParameter(INavigationService navigationService) : base(navigationService)
{ }

public override void Initialize(INavigationParameters parameters)
{
base.Initialize(parameters);

if (resolveParam(parameters, out TParameter value))
{
Initialize(parameters, value);
}
}

public override async Task InitializeAsync(INavigationParameters parameters)
{
await base.InitializeAsync(parameters);

if (resolveParam(parameters, out TParameter value))
{
await InitializeAsync(parameters, value);
}
}

public override void OnNavigatedTo(INavigationParameters parameters)
{
base.OnNavigatedTo(parameters);

if (resolveParam(parameters, out TParameter value))
{
OnNavigatedTo(parameters, value);
}
}

public virtual void Initialize(INavigationParameters parameters, TParameter parameter)
{ }

public virtual Task InitializeAsync(INavigationParameters parameters, TParameter parameter)
{ return Task.CompletedTask; }

public virtual void OnNavigatedTo(INavigationParameters parameters, TParameter parameter)
{ }

private bool resolveParam(INavigationParameters parameters, out TParameter value)
{
if (Parameter is not null)
{
value = Parameter;
return true;
}

var returnValue = parameters.TryGetValue(NavigationParameter.Key, out value)
|| parameters.TryGetValue(KnownNavigationParameters.XamlParam, out value);

Parameter = value;

return returnValue;
}
}
}
2 changes: 1 addition & 1 deletion src/Hymnal.XF/ViewModels/Tabs/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private async void ChooseLanguageExecuteAsync()
}

var title = Languages.ChooseYourHymnal;
var cancelButton = Languages.Cancel;
var cancelButton = Languages.Generic_Cancel;

var languageKey = await dialogService.DisplayActionSheetAsync(
title,
Expand Down
4 changes: 2 additions & 2 deletions src/Hymnal.XF/ViewModels/Viewers/HymnViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ private async void PlayExecuteAsync()
// Check internet connection
if (connectivity.NetworkAccess == NetworkAccess.None)
{
await dialogService.DisplayAlertAsync(Languages.WeHadAProblem, Languages.NoInternetConnection, Languages.Ok);
await dialogService.DisplayAlertAsync(Languages.Error_WeHadAProblem, Languages.NoInternetConnection, Languages.Generic_Ok);
return;
}

Expand Down Expand Up @@ -264,7 +264,7 @@ private async void PlayExecuteAsync()
var sungTitle = Languages.Sung;

var result = await dialogService.DisplayActionSheetAsync(
Languages.ChooseYourHymnal, Languages.Cancel,
Languages.ChooseYourHymnal, Languages.Generic_Cancel,
null, new[] { instrumentalTitle, sungTitle });

if (result.Equals(instrumentalTitle))
Expand Down
2 changes: 1 addition & 1 deletion src/Hymnal.XF/Views/Viewers/HymnPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
AutomationProperties.Name="{extensions:Translate AutomationHymnPageClose}"
Command="{Binding CloseCommand}"
Priority="-1"
Text="{extensions:Translate Close}" />
Text="{extensions:Translate Generic_Close}" />
<ToolbarItem
x:Name="MusicToolbar"
AutomationId="PlayPauseMusicToolbar"
Expand Down

0 comments on commit f7d7a32

Please sign in to comment.