DNN Forums

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

Language selector - Text just language not region

Sort:
You are not authorized to post a reply.





New Around Here





    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






    Veteran Member





      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

      Default configuration in default DotNetNuke skin.

      Displays only dropdownlist

      ' />

      Displays dropdownlist and flag of currently selected language

      [CULTURE:NAME]'/>

      Displays text links for languages. Selected language has different Classname






      Veteran Member





        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





          Hi Timo,

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

          Tony






          New Around Here





            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





              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.





              Veteran Member





                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





                  Hi Timo,

                  Great idea, I will give that a go

                  Tony






                  New Around Here





                    Many thanks Timo

                    Worked like a charm.

                    Tony

                    You are not authorized to post a reply.

                    These Forums are dedicated to the discussion of DNN Platform.

                    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