Skip to content

Commit

Permalink
Improve localization page (#3130)
Browse files Browse the repository at this point in the history
  • Loading branch information
stsrki authored Nov 17, 2021
1 parent bbed7a1 commit e34b885
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 22 deletions.
12 changes: 7 additions & 5 deletions Documentation/Blazorise.Docs/Models/Snippets.generated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4998,17 +4998,19 @@ Task SelectCulture( string name )
}
}";

public const string ITextLocalizerServiceExample = @"<Field>
public const string ITextLocalizerServiceExample = @"@using System.Globalization
<Field>
<FileEdit />
</Field>
<Field>
<Addons>
<Addon AddonType=""AddonType.Start"">
<SelectList TItem=""string""
<SelectList TItem=""CultureInfo""
TValue=""string""
Data=""@Blazorise.Docs.Models.LocalizationCulture.AvailableCultures""
TextField=""@((item)=>item)""
ValueField=""@((item)=>item)""
Data=""@LocalizationService.AvailableCultures""
TextField=""@((item)=>item.IsNeutralCulture ? item.EnglishName : item.Parent.EnglishName)""
ValueField=""@((item)=>item.Name)""
@bind-SelectedValue=""selectedCulture""
DefaultItemText=""Choose your culture"" />
</Addon>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<div class="blazorise-codeblock">
<div class="html"><pre>
<span class="atSign">&#64;</span>using System.Globalization

<span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">Field</span><span class="htmlTagDelimiter">&gt;</span>
<span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">FileEdit</span> <span class="htmlTagDelimiter">/&gt;</span>
<span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">Field</span><span class="htmlTagDelimiter">&gt;</span>
<span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">Field</span><span class="htmlTagDelimiter">&gt;</span>
<span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">Addons</span><span class="htmlTagDelimiter">&gt;</span>
<span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">Addon</span> <span class="htmlAttributeName">AddonType</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="enum">AddonType</span><span class="enumValue">.Start</span><span class="quot">&quot;</span><span class="htmlTagDelimiter">&gt;</span>
<span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">SelectList</span> <span class="htmlAttributeName">TItem</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">string</span><span class="quot">&quot;</span>
<span class="htmlTagDelimiter">&lt;</span><span class="htmlElementName">SelectList</span> <span class="htmlAttributeName">TItem</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">CultureInfo</span><span class="quot">&quot;</span>
<span class="htmlAttributeName">TValue</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">string</span><span class="quot">&quot;</span>
<span class="htmlAttributeName">Data</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue"><span class="atSign">&#64;</span>Blazorise.Docs.Models.LocalizationCulture.AvailableCultures</span><span class="quot">&quot;</span>
<span class="htmlAttributeName">TextField</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue"><span class="atSign">&#64;</span>((item)=&gt;item)</span><span class="quot">&quot;</span>
<span class="htmlAttributeName">ValueField</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue"><span class="atSign">&#64;</span>((item)=&gt;item)</span><span class="quot">&quot;</span>
<span class="htmlAttributeName">Data</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue"><span class="atSign">&#64;</span>LocalizationService.AvailableCultures</span><span class="quot">&quot;</span>
<span class="htmlAttributeName">TextField</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue"><span class="atSign">&#64;</span>((item)=&gt;item.IsNeutralCulture ? item.EnglishName : item.Parent.EnglishName)</span><span class="quot">&quot;</span>
<span class="htmlAttributeName">ValueField</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue"><span class="atSign">&#64;</span>((item)=&gt;item.Name)</span><span class="quot">&quot;</span>
<span class="htmlAttributeName"><span class="atSign">&#64;</span>bind-SelectedValue</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">selectedCulture</span><span class="quot">&quot;</span>
<span class="htmlAttributeName">DefaultItemText</span><span class="htmlOperator">=</span><span class="quot">&quot;</span><span class="htmlAttributeValue">Choose your culture</span><span class="quot">&quot;</span> <span class="htmlTagDelimiter">/&gt;</span>
<span class="htmlTagDelimiter">&lt;/</span><span class="htmlElementName">Addon</span><span class="htmlTagDelimiter">&gt;</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
@namespace Blazorise.Docs.Docs.Examples
@using System.Globalization

<Field>
<FileEdit />
</Field>
<Field>
<Addons>
<Addon AddonType="AddonType.Start">
<SelectList TItem="string"
<SelectList TItem="CultureInfo"
TValue="string"
Data="@Blazorise.Docs.Models.LocalizationCulture.AvailableCultures"
TextField="@((item)=>item)"
ValueField="@((item)=>item)"
Data="@LocalizationService.AvailableCultures"
TextField="@((item)=>item.IsNeutralCulture ? item.EnglishName : item.Parent.EnglishName)"
ValueField="@((item)=>item.Name)"
@bind-SelectedValue="selectedCulture"
DefaultItemText="Choose your culture" />
</Addon>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@
<Paragraph>List of predefined language that comes with Blazorise is:</Paragraph>

<UnorderedList>
<UnorderedListItem><Code>de-DE</Code> German</UnorderedListItem>
<UnorderedListItem><Code>en-US</Code> English</UnorderedListItem>
<UnorderedListItem><Code>es-ES</Code> Spanish</UnorderedListItem>
<UnorderedListItem><Code>fr-FR</Code> French</UnorderedListItem>
<UnorderedListItem><Code>hr-HR</Code> Croatian</UnorderedListItem>
<UnorderedListItem><Code>nl-NL</Code> Dutch</UnorderedListItem>
<UnorderedListItem><Code>pt-PT</Code> Portuguese</UnorderedListItem>
<UnorderedListItem><Code>de</Code> German</UnorderedListItem>
<UnorderedListItem><Code>en</Code> English</UnorderedListItem>
<UnorderedListItem><Code>es</Code> Spanish</UnorderedListItem>
<UnorderedListItem><Code>fr</Code> French</UnorderedListItem>
<UnorderedListItem><Code>hr</Code> Croatian</UnorderedListItem>
<UnorderedListItem><Code>is</Code> Icelandic</UnorderedListItem>
<UnorderedListItem><Code>it</Code> Italian</UnorderedListItem>
<UnorderedListItem><Code>nl</Code> Dutch</UnorderedListItem>
<UnorderedListItem><Code>pl</Code> Polish</UnorderedListItem>
<UnorderedListItem><Code>pt</Code> Portuguese</UnorderedListItem>
<UnorderedListItem><Code>ru</Code> Russian</UnorderedListItem>
<UnorderedListItem><Code>sk</Code> Slovakian</UnorderedListItem>
<UnorderedListItem><Code>tr</Code> Turkish</UnorderedListItem>
</UnorderedList>

<Paragraph>
Expand Down Expand Up @@ -63,5 +69,4 @@
</DocsPageSectionHeader>
<DocsPageSectionContent><CustomLanguageExample /></DocsPageSectionContent>
<DocsPageSectionSource Code="CustomLanguageExample"></DocsPageSectionSource>
</DocsPageSection>

</DocsPageSection>

0 comments on commit e34b885

Please sign in to comment.