-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #670 from hargata/Hargata/translation.getter
Add translation getter
- Loading branch information
Showing
7 changed files
with
212 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace CarCareTracker.Models | ||
{ | ||
public class Translations | ||
{ | ||
public List<string> Africa { get; set; } = new List<string>(); | ||
public List<string> Asia { get; set; } = new List<string>(); | ||
public List<string> Europe { get; set; } = new List<string>(); | ||
public List<string> NorthAmerica { get; set; } = new List<string>(); | ||
public List<string> SouthAmerica { get; set; } = new List<string>(); | ||
public List<string> Oceania { get; set; } = new List<string>(); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
@using CarCareTracker.Helper | ||
@inject IConfigHelper config | ||
@inject ITranslationHelper translator | ||
@model Translations | ||
@{ | ||
var userConfig = config.GetUserConfig(User); | ||
var userLanguage = userConfig.UserLanguage; | ||
} | ||
<div class="modal-header"> | ||
<h5 class="modal-title" id="translationDownloaderModalLabel">@translator.Translate(userLanguage, "Available Translations")</h5> | ||
<button type="button" class="btn-close" onclick="hideTranslationDownloader()" aria-label="Close"></button> | ||
</div> | ||
<div class="modal-body" onkeydown="handleEnter(this)"> | ||
<form class="form-inline"> | ||
<div class="form-group" style="max-height:50vh; overflow-x:hidden; overflow-y:scroll;"> | ||
@foreach(var translation in Model.Africa) | ||
{ | ||
<div class="row mb-2"> | ||
<div class="col-10">@StaticHelper.GetTranslationName(translation)</div> | ||
<div class="col-2"> | ||
<button type="button" class="btn btn-primary" onclick="downloadTranslation('Africa','@translation')"><i class="bi bi-download"></i></button> | ||
</div> | ||
</div> | ||
} | ||
@foreach (var translation in Model.Asia) | ||
{ | ||
<div class="row mb-2"> | ||
<div class="col-10">@StaticHelper.GetTranslationName(translation)</div> | ||
<div class="col-2"> | ||
<button type="button" class="btn btn-primary" onclick="downloadTranslation('Asia','@translation')"><i class="bi bi-download"></i></button> | ||
</div> | ||
</div> | ||
} | ||
@foreach (var translation in Model.Europe) | ||
{ | ||
<div class="row mb-2"> | ||
<div class="col-10">@StaticHelper.GetTranslationName(translation)</div> | ||
<div class="col-2"> | ||
<button type="button" class="btn btn-primary" onclick="downloadTranslation('Europe','@translation')"><i class="bi bi-download"></i></button> | ||
</div> | ||
</div> | ||
} | ||
@foreach (var translation in Model.NorthAmerica) | ||
{ | ||
<div class="row mb-2"> | ||
<div class="col-10">@StaticHelper.GetTranslationName(translation)</div> | ||
<div class="col-2"> | ||
<button type="button" class="btn btn-primary" onclick="downloadTranslation('NorthAmerica','@translation')"><i class="bi bi-download"></i></button> | ||
</div> | ||
</div> | ||
} | ||
@foreach (var translation in Model.SouthAmerica) | ||
{ | ||
<div class="row mb-2"> | ||
<div class="col-10">@StaticHelper.GetTranslationName(translation)</div> | ||
<div class="col-2"> | ||
<button type="button" class="btn btn-primary" onclick="downloadTranslation('SouthAmerica','@translation')"><i class="bi bi-download"></i></button> | ||
</div> | ||
</div> | ||
} | ||
@foreach (var translation in Model.Oceania) | ||
{ | ||
<div class="row mb-2"> | ||
<div class="col-10">@StaticHelper.GetTranslationName(translation)</div> | ||
<div class="col-2"> | ||
<button type="button" class="btn btn-primary" onclick="downloadTranslation('Oceania','@translation')"><i class="bi bi-download"></i></button> | ||
</div> | ||
</div> | ||
} | ||
</div> | ||
</form> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-secondary" onclick="hideTranslationDownloader()">@translator.Translate(userLanguage, "Cancel")</button> | ||
</div> |
Oops, something went wrong.