DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Language selector - Text just language not region

 8 Replies
 2 Subscribed to this topic
 25 Subscribed to this forum
Sort:
Author
Messages
New Around Here
Posts: 8
New Around Here
New Poster
New Poster
Congrats on posting!

Hi,

When displaying just text in the language selector is there anyway to display just the language name not the region

ie: Show 'English' instead of 'English (US)'. 

There used to be a module Apollo Language Selector that could do this but that does not seem available anymore

Thanks in advance for any help given

Tony

Senior Member
Posts: 1322
Senior Member
3 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
Lifesaver
Lifesaver
You're Life Saver!
New Poster
New Poster
Congrats on posting!
3 Engaged Reader
Engaged Reader
You are an engaged reader!

Hi Tony,

Here's a list of tokens you can use:

 

Token

Description

Core Token replace

You can use all the DNN core tokens in these templates

[CULTURE:DISPLAYNAME]

Gets the culture name in the format " ()" in the language of the localized version of .NET Framework.

[CULTURE:ENGLISHNAME]

Gets the culture name in the format " ()" in English.

[CULTURE:LCID]

Gets the culture identifier for the current CultureInfo

[CULTURE:NAME]

Gets the culture name in the format "-".

[CULTURE:NATIVENAME]

Gets the culture name, consisting of the language, the country/region, and the optional script, that the culture is set to display.

[CULTURE:TWOLETTERISOCODE]

Gets the ISO 639-2 three-letter code for the language of the current CultureInfo

[CULTURE:THREELETTERISOCODE]

Gets the ISO 639-1 two-letter code for the language of the current CultureInfo

[URL]

This will generate the correct URL for the current page in a specific culture

[FLAGSRC]   

The name of a flag image (.gif only) for a specific culture, in the format "-.gif".

[SELECTED]

Returns “True” if a specific culture is the current culture.

[LABEL]

Inserts the Label text from the resource file.

[I]

Returns the directory that holds the core country flag images (/images/Flags)

[P]

Returns the portal directory

[S]

Returns the directory of the current skin

[G]

Returns the global (host) skin folder

Examples:

Example Code

Description

<dnn:LANGUAGE runat="server" ID="dnnLANGUAGE" ShowMenu="False" ShowLinks="True" />

Default configuration in default DotNetNuke skin.

<dnn:LANGUAGE runat="server" ID="dnnLANGUAGE" ShowLinks="False" ShowMenu="True" />

Displays only dropdownlist

<dnn:LANGUAGE runat="server" ID="dnnLANGUAGE" ShowLinks="False" ShowMenu="True" CommonFooterTemplate=' <img src="&#91;I&#93;&#91;FLAGSRC&#93;" alt="&#91;CULTURE:NATIVENAME&#93;" border="0" />' />

Displays dropdownlist and flag of currently selected language

<dnn:LANGUAGE runat="server" ID="dnnLANGUAGE" ShowLinks="True" ShowMenu="False" ItemTemplate='<a href="&#91;URL&#93;" class="Language" title="&#91;CULTURE:NATIVENAME&#93;"><span class="Language&#91;SELECTED&#93;">&#91;CULTURE:NAME&#93;</span></a>'/>

Displays text links for languages. Selected language has different Classname

Veteran Member
Posts: 546
Veteran Member
MVP
MVP
You're an MVP!

there is also an extended language selector skin object from interzoic, but i didn't test compatibility with DNN 8 or 9 yet

https://www.interzoic.com/languageskinobject

New Around Here
Posts: 8
New Around Here
New Poster
New Poster
Congrats on posting!

Hi Timo,

Unfortunatly none of those tokens work they way I want. They show the region like 'English (Canada)'

Tony

New Around Here
Posts: 8
New Around Here
New Poster
New Poster
Congrats on posting!

Hi Sebasation,

I had tried registering on that site yesterday to download the object, unfortunatly the registration does not seem to work. I have contacted them to ask for help

I could create my own object if I knew how to get the different urls of a page for each language...any pointers ?

Regards

Tony

Veteran Member
Posts: 546
Veteran Member
MVP
MVP
You're an MVP!
Tony,
if you want to create the Language Selector SKO yourself, you should start with the skin object inside DNN Platform, rename and extend it according th your needs.
Senior Member
Posts: 1322
Senior Member
3 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
Lifesaver
Lifesaver
You're Life Saver!
New Poster
New Poster
Congrats on posting!
3 Engaged Reader
Engaged Reader
You are an engaged reader!
Posted By Tony Stallan on 14 Nov 2019 09:31 AM

Hi Timo,

Unfortunatly none of those tokens work they way I want. They show the region like 'English (Canada)'

Tony

Hmm, right.
I think that needs to be added to the core then.
A quick and dirty solution would be:

< span class="[CULTURE:TWOLETTERISOCODE]">< /span>

CSS:

.EN:after{
content:English;

}

 

 

 

New Around Here
Posts: 8
New Around Here
New Poster
New Poster
Congrats on posting!

Hi Timo,

Great idea, I will give that a go

Tony

New Around Here
Posts: 8
New Around Here
New Poster
New Poster
Congrats on posting!

Many thanks Timo

Worked like a charm.

Tony

These Forums are for the discussion of the open source CMS DNN platform and ecosystem.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
  2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
  3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  5. No Flaming or Trolling.
  6. No Profanity, Racism, or Prejudice.
  7. Site Moderators have the final word on approving / removing a thread or post or comment.
  8. English language posting only, please.

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved