forked from unab0mb/7h
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update: add multi-language support in code-behind
- created ResourceHelper class to get strings from ResourceDictionary for supporting different languages - MainWindowViewModel updated to use ResourceHelper class - small refactors
- Loading branch information
1 parent
8d6d0c6
commit 0e2307f
Showing
11 changed files
with
515 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
using SeventhHeavenUI; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace SeventhHeaven.Classes | ||
{ | ||
public enum StringKey | ||
{ | ||
Play, | ||
PlayWithMods, | ||
StartedClickHereToViewAppLog, | ||
HintLabel, | ||
CheckingForUpdates, | ||
ModRequiresModsIsMissingWarning, | ||
UnsupportedModVersionsWarning, | ||
ThisModRequiresYouActivateFollowingMods, | ||
ModRequiresYouDeactivateTheFollowingMods, | ||
CannotActivateModBecauseItIsIncompatibleWithOtherMod, | ||
CannotActivateModBecauseDependentIsIncompatible, | ||
SelectAll, | ||
Unknown, | ||
UpdateAvailable, | ||
UpdateDownloading, | ||
NoUpdates, | ||
UpdatesIgnored, | ||
AutoUpdate, | ||
FollowingErrorsFoundInConfiguration, | ||
ErrorsFoundInGeneralSettingsViewAppLog, | ||
AppUpdateIsAvailableMessage, | ||
NewVersionAvailable, | ||
ThisModContainsDataThatCouldHarm, | ||
CannotOpenHelp, | ||
SubscriptionIsAlreadyAdded, | ||
AddedToSubscriptions, | ||
IrosLinkMayBeFormatedIncorrectly, | ||
FailedToSetBackgroundImageFromTheme | ||
} | ||
|
||
public static class ResourceHelper | ||
{ | ||
public static string GetString(StringKey key) | ||
{ | ||
try | ||
{ | ||
return App.Current.Resources[key.ToString()].ToString(); | ||
} | ||
catch (Exception) | ||
{ | ||
return ""; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.