The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Customize Icon URL based on Language

Discussion in 'User Experience' started by Xavior82, Jan 23, 2011.

  1. Xavior82

    Xavior82 Active Member
    PartnerNOC

    Joined:
    Oct 5, 2006
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Montreal
    Hi,

    I am trying to add an icon to my Cpanel that will redirect the user to a different URL based on language.

    Example conf file entry:
    description=>$LANG{'namestring'},url=>[FRENCH-OR-ENGLISH URL DEPENDING ON ACTIVE LANGUAGE HERE]

    So basically how can I get this to work? The way I see it there are two solutions that may work:

    - Make the field url accept the LANG function, so that I could hardcode the link per language in the language file
    - Use some js trigger to force a window.location based on an existing language condition that the js script would be able to read (if this is possible, can you please provide a concrete example how to use this function)
    - point url to an internal cpanel page that would then redirect to a different url based on language (again a language condition would need to be read, would need a specific example on how to do this).

    Finally, perhaps more importantly, how do I go about adding a new language entry? ie. would like to add entry 'namestring' to all existing themes in all languages. Is this done via the WHM, or is there a specific file on the server I can access to edit and add new strings. I noticed WHM has an option to edit existing strings, but not to add new strings (at least as far as I could tell).

    Thanks for your help!
     
  2. Xavior82

    Xavior82 Active Member
    PartnerNOC

    Joined:
    Oct 5, 2006
    Messages:
    30
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Montreal
    I have been doing some more digging around and reading up on Locales, but I find the docs currently available of very limited use. I was looking at cPanel Locales but I don't even understand who the intended audience for these articles are. It looks like these are written for the developers using the API, but what about the end-user wishing to make basic changes to the existing language strings?

    From what I understand, if I want to add one new language variable to the system, with say, key 'example', I would need to download a 6MB english XML locale file, add the entry, then re-upload the entire file into the system? Then repeat for all other affected languages? Seems like overkill. Can someone clear this up for me? Maybe I'm just misunderstanding how this is supposed to work.
     
Loading...

Share This Page