Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for spanish language #348

Merged
merged 6 commits into from
Sep 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions AnnoDesigner/Commons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ public class Commons : ICommons
public static Commons Instance
{
get { return lazy.Value; }
}
}

private Commons()
{ }
{ }

#endregion

Expand Down Expand Up @@ -56,8 +56,8 @@ public string CurrentLanguage
{ "Français","fra" },
{ "Polski", "pol" },
{ "Русский", "rus" },
{ "Español", "esp" },
/* We currently do not support these languages */
//{ "Español", "esp" },
//{ "Italiano", "ita" },
//{ "český", "cze" },
};
Expand Down
Binary file modified AnnoDesigner/Flags/France.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified AnnoDesigner/Flags/Germany.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified AnnoDesigner/Flags/Poland.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified AnnoDesigner/Flags/Russia.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added AnnoDesigner/Flags/Spain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified AnnoDesigner/Flags/United Kingdom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,105 changes: 1,155 additions & 950 deletions AnnoDesigner/Localization/Localization.cs

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion AnnoDesigner/Localization/TreeLocalization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ public string GetLocalization(string valueToTranslate, string languageCode = nul
languageCode = _commons.CurrentLanguageCode;
}

if (!_commons.LanguageCodeMap.ContainsValue(languageCode))
// use english as default language
if (!_commons.LanguageCodeMap.ContainsValue(languageCode) || !Translations.ContainsKey(languageCode))
{
_logger.Trace($"language ({languageCode}) has no translations or is not supported");
languageCode = "eng";
}

Expand Down
5 changes: 4 additions & 1 deletion AnnoDesigner/ViewModels/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@ public MainViewModel(ICommons commonsToUse,
{
FlagPath = "Flags/Russia.png"
});
//Languages.Add(new SupportedLanguage("Español"));
Languages.Add(new SupportedLanguage("Español")
{
FlagPath = "Flags/Spain.png"
});
//Languages.Add(new SupportedLanguage("Italiano"));
//Languages.Add(new SupportedLanguage("český"));

Expand Down
4 changes: 4 additions & 0 deletions AnnoDesigner/ViewModels/WelcomeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ public WelcomeViewModel(ICommons commonsToUse, IAppSettings appSettingsToUse)
{
FlagPath = "Flags/Russia.png"
});
Languages.Add(new SupportedLanguage("Español")
{
FlagPath = "Flags/Spain.png"
});

ContinueCommand = new RelayCommand(Continue, CanContinue);
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/AnnoDesigner.Tests/WelcomeViewModelTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public void Ctor_ShouldSetCorrectNumberOfLanguages()
var viewModel = GetViewModel();

// Assert
Assert.Equal(5, viewModel.Languages.Count);
Assert.Equal(6, viewModel.Languages.Count);
}

#endregion
Expand Down