Getting current language code

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting current language code

Jon Moores
Hi,
Is there a way to get the current language code (or locale) in dotCMS? I can
see that the $language variable is set but I would rather not iterate the
$languages list or use integer ids directly.

thanks
Jon
Reply | Threaded
Open this post in threaded view
|

Re: Getting current language code

Michiel Rook-4
Hi Jon,

> Is there a way to get the current language code (or locale) in dotCMS? I
> can see that the $language variable is set but I would rather not
> iterate the $languages list or use integer ids directly.

A plugin that contains that functionality used to be available on
http://fisheye.dotcms.org/viewrep/dotCMS/plugin/org.dotcms.plugins.languageUtil

I have no idea where it went though...

regards,

--
Michiel Rook - Touchdown Consulting Services

E-mail:    [hidden email]
Website:   www.touchdownconsulting.nl
Telefoon:  06-18525049


This email and any attachments to it may be confidential and are
intended solely for the use of the individual to whom it is
addressed. If you are not the intended recipient of this email,
you must neither take any action based upon its contents, nor copy
or show it to anyone. Please contact the sender if you believe you
have received this email in error.


------------------------------------

Need Help?  See:

http://www.dotcms.org/support 

for open source support options.Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/dotcms/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/dotcms/join
    (Yahoo! ID required)

<*> To change settings via email:
    [hidden email]
    [hidden email]

<*> To unsubscribe from this group, send an email to:
    [hidden email]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply | Threaded
Open this post in threaded view
|

Re: Getting current language code

wezell-2
Administrator
The LanguageWebAPI should be a help to you...  You can pass it a language id
from the context and it will give you information about the language.

$languagewebapi.getLanguage(x)

http://fisheye.dotcms.org/browse/dotCMS/trunk/src/com/dotmarketing/viewtools/LanguageWebAPI.java?r=trunk



Will

----
Will Ezell
www.dotcms.org
phone: 305.858.1422 ext. 286
direct: 978.296.4239
skype: wezell1




On Mon, Jan 18, 2010 at 5:09 AM, Michiel Rook <
[hidden email]> wrote:

> Hi Jon,
>
> > Is there a way to get the current language code (or locale) in dotCMS? I
> > can see that the $language variable is set but I would rather not
> > iterate the $languages list or use integer ids directly.
>
> A plugin that contains that functionality used to be available on
>
> http://fisheye.dotcms.org/viewrep/dotCMS/plugin/org.dotcms.plugins.languageUtil
>
> I have no idea where it went though...
>
> regards,
>
> --
> Michiel Rook - Touchdown Consulting Services
>
> E-mail:    [hidden email]
> Website:   www.touchdownconsulting.nl
> Telefoon:  06-18525049
>
>
> This email and any attachments to it may be confidential and are
> intended solely for the use of the individual to whom it is
> addressed. If you are not the intended recipient of this email,
> you must neither take any action based upon its contents, nor copy
> or show it to anyone. Please contact the sender if you believe you
> have received this email in error.
>
>
> ------------------------------------
>
> Need Help?  See:
>
> http://www.dotcms.org/support
>
> for open source support options.Yahoo! Groups Links
>
>
>
>