Skip to content

Commit

Permalink
Various localization fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
impworks committed Apr 25, 2024
1 parent 1349624 commit b5a5274
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Bonsai/Areas/Admin/Views/Changesets/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
}
</td>
<td><span title="@c.Date.LocalDateTime.ToLocalizedFullDate()">@c.Date.Humanize()</span></td>
<td>@c.ChangeType.GetEnumDescription()</td>
<td>@c.ChangeType.GetLocaleEnumDescription()</td>
<td>@c.Author</td>
<td class="admin-row-actions">
@if (c.CanRevert)
Expand Down
4 changes: 2 additions & 2 deletions src/Bonsai/Areas/Admin/Views/Pages/Editor.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
@if (data.DraftLastUpdateDate is DateTimeOffset draftDate)
{
var today = draftDate.Date == DateTimeOffset.Now.Date;
<text>@string.Format(@Texts.Admin_Pages_Editor_DraftLoadedFormat, data.DraftLastUpdateDate.Value.ToString(today ? "T" : "G", LocaleProvider.GetCulture()))</text>
<text>@string.Format(Texts.Admin_Pages_Editor_DraftLoadedFormat, data.DraftLastUpdateDate.Value.ToString(today ? "T" : "G", LocaleProvider.GetCulture()))</text>
}
</span>
@if (data.DraftDisplayNotification)
Expand All @@ -194,7 +194,7 @@
@await Html.PartialAsync("~/Areas/Admin/Views/Components/PagePicker.cshtml")

<script type="text/x-template" id="date-picker-template">
<input type="text" class="form-control" placeholder="@Texts.Datepicker_Placeholder" />
<input type="text" class="form-control" placeholder="@Html.Raw(Texts.Datepicker_Placeholder)" />
</script>
<script type="text/x-template" id="duration-picker-template">
<div class="form-row">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@using Bonsai.Code.DomainModel.Facts.Models
@using Bonsai.Code.Services
@using Bonsai.Localization
@using Impworks.Utils.Format
<script type="text/x-template" data-kind="fact-template" id="ContactsFactModel">
<div class="fact-wrapper">
<h6>
Expand All @@ -16,7 +16,7 @@
<div class="form-group col-sm-4">
<label>@Texts.Admin_Pages_Facts_LinkType</label>
<select v-model="row.Type" class="form-control form-control-sm mr-2">
@foreach (var prof in EnumHelper.GetEnumDescriptions<ContactType>())
@foreach (var prof in LocaleProvider.GetLocaleEnumDescriptions<ContactType>())
{
<option value="@prof.Key">@prof.Value</option>
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@using Bonsai.Code.DomainModel.Facts.Models
@using Impworks.Utils.Format
@using Bonsai.Code.Services
@model ContactsFactModel

<tr class="fact">
Expand All @@ -9,7 +9,7 @@
<td class="fact-value big-icons">
@foreach (var item in Model.Values)
{
<a class="big-icon" href="@item.GetLink()" target="_blank" title="@item.Type.GetEnumDescription()">
<a class="big-icon" href="@item.GetLink()" target="_blank" title="@item.Type.GetLocaleEnumDescription()">
<span class="fa @(GetIcon(item.Type))"></span>
</a>
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@using Bonsai.Code.DomainModel.Facts.Models
@using Impworks.Utils.Format
@using Bonsai.Code.Services
@model LanguageFactModel

<tr class="fact">
Expand All @@ -11,7 +11,7 @@
<span class="fact-item-main">@item.Name</span>
@if (item.Proficiency != null)
{
<span class="fact-item-extra">(@item.Proficiency.Value.GetEnumDescription())</span>
<span class="fact-item-extra">(@item.Proficiency.Value.GetLocaleEnumDescription())</span>
}
@if (item.Duration != null)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Bonsai/Areas/Front/Views/Page/Facts/SkillFactModel.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@using Bonsai.Code.DomainModel.Facts.Models
@using Impworks.Utils.Format
@using Bonsai.Code.Services
@model SkillFactModel

<tr class="fact">
Expand All @@ -11,7 +11,7 @@
<span class="fact-item-main">@item.Name</span>
@if (item.Proficiency != null)
{
<span class="fact-item-extra">(@item.Proficiency.Value.GetEnumDescription())</span>
<span class="fact-item-extra">(@item.Proficiency.Value.GetLocaleEnumDescription())</span>
}
@if (item.Duration != null)
{
Expand Down
4 changes: 2 additions & 2 deletions src/Bonsai/Areas/Front/Views/Page/Tree.cshtml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@using Bonsai.Areas.Front.ViewModels.Page
@using Bonsai.Code.Services
@using Bonsai.Data.Models
@using Bonsai.Localization
@using Impworks.Utils.Format
@model PageVM<PageTreeVM>
@{
Layout = "~/Areas/Front/Views/Page/PageLayout.cshtml";
Expand All @@ -24,7 +24,7 @@
<div class="float-left btn-group btn-group-toggle">
@foreach (var kind in Model.Body.SupportedKinds)
{
<a href="@GetTreeUrl(kind)" class="btn btn-sm btn-outline-primary cmd-switch-tree @(kind == Model.Body.TreeKind ? "active" : "")" data-kind="@kind">@kind.GetEnumDescription()</a>
<a href="@GetTreeUrl(kind)" class="btn btn-sm btn-outline-primary cmd-switch-tree @(kind == Model.Body.TreeKind ? "active" : "")" data-kind="@kind">@kind.GetLocaleEnumDescription()</a>
}
</div>
<div class="float-right btn-group">
Expand Down
2 changes: 1 addition & 1 deletion src/Bonsai/Localization/Texts.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b5a5274

Please sign in to comment.