Summary
Adds support to localize the everything with the
localize
tag.
- Namespace
- Localization
.AspNetCore .TagHelpers - Base Types
-
- TagHelper
- Generic
Localize Tag Helper
graph BT
Type-->Base0["GenericLocalizeTagHelper"]
click Base0 "/Localization.AspNetCore.TagHelpers/api/Localization.AspNetCore.TagHelpers/GenericLocalizeTagHelper"
Base0-->Base1["TagHelper"]
Type["LocalizeTagHelper"]
class Type type-node
Syntax
[HtmlTargetElement(LOCALIZE_TAG_NAME)]
public class LocalizeTagHelper : GenericLocalizeTagHelper
Examples
<localize>
To text to localize goes here
</localize>
Attributes
Type | Description |
---|---|
HtmlTargetElement |
Constructors
Name | Summary |
---|---|
LocalizeTagHelper |
Initializes a new instance of the LocalizeTagHelper class.
|
Properties
Name | Value | Summary |
---|---|---|
IsHtml | bool |
Gets or sets a value indicating whether the inner text should be treated as HTML (no encoding).
Inherited from Generic
|
Localizer | IHtmlLocalizer |
Gets or sets the localizer to use when resolving the specified strings.
Inherited from Generic
|
Name | string |
Gets or sets the name to optionally override the name/path of the resource file. If the name
is empty it resolves to the current path and name of the view. i.e the view located at
"~/Views/Home/About.cshtml" passes the following name to the html localizer as Views/Home/About .
Inherited from Generic
|
NewLineHandling | NewLineHandling |
Gets or sets the new line handing method.
Inherited from Generic
|
SupportsParameters | bool |
Gets a value indicating whether this localizer tag helper supports parameters.
Inherited from Generic
|
TrimEachLine | bool |
Gets or sets a value indicating whether to trim whitespace on each line.
Inherited from Generic
|
TrimWhitespace | bool |
Gets or sets a value indicating whether beginning and ending whitespace.
Inherited from Generic
|
Type | Type |
Gets or sets the type to use when looking up the resource file.
Inherited from Generic
|
ViewContext | ViewContext |
Gets or sets the view context (automatically set when using razor views).
Inherited from Generic
|
Methods
Name | Value | Summary |
---|---|---|
GetContentAsync |
Task |
Gets the content/text that are to be localized.
Inherited from Generic
|
GetParameters |
IEnumerable |
Gets the parameters to use when localizing the text.
Inherited from Generic
|
Init |
void |
Initializes this Localize Tag Helpers, setting the html localizer and creating a stack list
for child tag helpers to add parameters to.
Inherited from Generic
|
ProcessAsync |
Task |
This function first calls the base ProcessAsync method, then removes the tag name.
|
SetContent |
void |
Sets the localized content back to where the original content was.
Inherited from Generic
|
SetHtmlContent |
void |
Sets the localized content without encoding it back to where the original content was.
Inherited from Generic
|
See Also
- Microsoft.AspNetCore.Razor.TagHelpers.TagHelper
GenericLocalizeTagHelper