-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90dbf66
commit 2e4258b
Showing
26 changed files
with
454 additions
and
9 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
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
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
33 changes: 33 additions & 0 deletions
33
LibgenDesktop/Models/Localization/Localizators/LibraryWindowLocalizator.cs
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,33 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace LibgenDesktop.Models.Localization.Localizators | ||
{ | ||
internal class LibraryWindowLocalizator : Localizator | ||
{ | ||
public LibraryWindowLocalizator(List<Translation> prioritizedTranslationList, LanguageFormatter formatter) | ||
: base(prioritizedTranslationList, formatter) | ||
{ | ||
WindowTitle = Format(translation => translation?.WindowTitle); | ||
Scan = Format(translation => translation?.Scan); | ||
BrowseDirectoryDialogTitle = Format(translation => translation?.BrowseDirectoryDialogTitle); | ||
CreatingIndexes = Format(translation => translation?.CreatingIndexes); | ||
NotFound = Format(translation => translation?.NotFound); | ||
} | ||
|
||
public string WindowTitle { get; } | ||
public string Scan { get; } | ||
public string BrowseDirectoryDialogTitle { get; } | ||
public string CreatingIndexes { get; } | ||
public string NotFound { get; } | ||
|
||
public string GetScanStartedString(string directory) => Format(translation => translation?.ScanStarted, new { directory }); | ||
public string GetScanCompleteString(int found, int notFound) => Format(translation => translation?.ScanComplete, | ||
new { found = Formatter.ToFormattedString(found), notFound = Formatter.ToFormattedString(notFound) }); | ||
|
||
private string Format(Func<Translation.LibraryTranslation, string> field, object templateArguments = null) | ||
{ | ||
return Format(translation => field(translation?.Library), templateArguments); | ||
} | ||
} | ||
} |
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
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.