Skip to content

Commit

Permalink
Merge pull request #849 from hishamco/section-localization
Browse files Browse the repository at this point in the history
Localize section component
  • Loading branch information
sbwalker authored Oct 25, 2020
2 parents 90de394 + 5948e7b commit 570b885
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Oqtane.Client/Modules/Controls/Section.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@namespace Oqtane.Modules.Controls
@inherits ModuleControlBase
@namespace Oqtane.Modules.Controls
@inherits LocalizableComponent

<div class="d-flex">
<div>
Expand Down Expand Up @@ -41,4 +41,16 @@
_heading = (!string.IsNullOrEmpty(Heading)) ? Heading : Name;
_expanded = (!string.IsNullOrEmpty(Expanded)) ? Expanded : "false";
}

protected override void OnParametersSet()
{
base.OnParametersSet();

if (IsLocalizable)
{
_heading = !string.IsNullOrEmpty(Heading)
? Localize(nameof(Heading))
: Localize(nameof(Name));
}
}
}

0 comments on commit 570b885

Please sign in to comment.