-
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.
Opening book details from the scan results
- Loading branch information
1 parent
37ba310
commit 3b35b27
Showing
19 changed files
with
486 additions
and
34 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
49 changes: 49 additions & 0 deletions
49
LibgenDesktop/Models/Localization/Localizators/LibraryTabLocalizator.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,49 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace LibgenDesktop.Models.Localization.Localizators | ||
{ | ||
internal class LibraryTabLocalizator : Localizator | ||
{ | ||
public LibraryTabLocalizator(List<Translation> prioritizedTranslationList, LanguageFormatter formatter) | ||
: base(prioritizedTranslationList, formatter) | ||
{ | ||
TabTitle = Format(translation => translation?.TabTitle); | ||
Scan = Format(translation => translation?.Scan); | ||
BrowseDirectoryDialogTitle = Format(translation => translation?.BrowseDirectoryDialogTitle); | ||
CreatingIndexes = Format(translation => translation?.CreatingIndexes); | ||
ScanLog = Format(translation => translation?.ScanLog); | ||
Error = Format(translation => translation?.Error); | ||
ColumnsFile = Format(translation => translation?.File); | ||
ColumnsAuthors = Format(translation => translation?.Authors); | ||
ColumnsTitle = Format(translation => translation?.Title); | ||
} | ||
|
||
public string TabTitle { get; } | ||
public string Scan { get; } | ||
public string BrowseDirectoryDialogTitle { get; } | ||
public string CreatingIndexes { get; } | ||
public string ScanLog { get; } | ||
public string Error { get; } | ||
public string ColumnsFile { get; } | ||
public string ColumnsAuthors { get; } | ||
public string ColumnsTitle { get; } | ||
|
||
public string GetScanStartedString(string directory) => Format(translation => translation?.ScanStarted, new { directory }); | ||
public string GetFoundString(int count) => Format(translation => translation?.Found, new { count }); | ||
public string GetNotFoundString(int count) => Format(translation => translation?.NotFound, new { count }); | ||
public string GetScanCompleteString(int found, int notFound, int errors) => Format(translation => translation?.ScanComplete, | ||
new { found = Formatter.ToFormattedString(found), notFound = Formatter.ToFormattedString(notFound), | ||
errors = Formatter.ToFormattedString(errors) }); | ||
|
||
private string Format(Func<Translation.LibraryTranslation, string> field, object templateArguments = null) | ||
{ | ||
return Format(translation => field(translation?.Library), templateArguments); | ||
} | ||
|
||
private string Format(Func<Translation.LibraryColumnsTranslation, string> field, object templateArguments = null) | ||
{ | ||
return Format(translation => field(translation?.Library?.Columns), 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
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.