You can customize the language names in the language selector on every page of Help Center. This is useful if you want to use one language variant, such as "English (U.S.)", for all the language's variants, such as "English".
Applicable template
- Header
{{#if alternative_locales}}...{{/if}}
Recipe
- Replace the
{{current_locale.name}}
expression with the following conditional expression:{{#is current_locale.name 'English (US)'}} English {{else}} {{current_locale.name}} {{/is}}
Also replace the alternative locale
{{name}}
expression with the following conditional expression:{{#is name 'English (US)'}} English {{else}} {{name}} {{/is}}
Example
{{#if alternative_locales}}
<div class="dropdown language-selector" aria-haspopup="true">
<a class="dropdown-toggle">
{{#is current_locale.name 'English (US)'}}
English
{{else}}
{{current_locale.name}}
{{/is}}
</a>
<span class="dropdown-menu dropdown-menu-end" role="menu">
{{#each alternative_locales}}
<a href="{{url}}" dir="{{direction}}" rel="nofollow" role="menuitem">
{{#is name 'English (US)'}}
English
{{else}}
{{name}}
{{/is}}
</a>
{{/each}}
</span>
</div>
{{/if}}
Reference
Comments
0 comments
Please sign in to leave a comment.