Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
language switching in admin
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Kenneth Gonsalves  
View profile  
 More options Nov 6, 8:39 pm
From: Kenneth Gonsalves <law...@au-kbc.org>
Date: Sat, 7 Nov 2009 07:09:53 +0530
Local: Fri, Nov 6 2009 8:39 pm
Subject: language switching in admin
hi,

I have an app in two languages. Until now I was asking the users to change the
language in their browser. I have now implemented setlang in the web
interface, so that they can view in the language of their choice by choosing
the language. I now want to do this in admin - a custom form should do it, but
has anyone done this? Or is it going to come to admin? Or maybe it is there
and I have not noticed it?
--
regards
Kenneth Gonsalves
Senior Project Officer
NRC-FOSS
http://nrcfosshelpline.in/web/


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Antoni Aloy  
View profile  
 More options Nov 7, 4:49 am
From: Antoni Aloy <antoni.a...@gmail.com>
Date: Sat, 7 Nov 2009 10:49:54 +0100
Local: Sat, Nov 7 2009 4:49 am
Subject: Re: language switching in admin
2009/11/7 Kenneth Gonsalves <law...@au-kbc.org>:

> hi,

> I have an app in two languages. Until now I was asking the users to change the
> language in their browser. I have now implemented setlang in the web
> interface, so that they can view in the language of their choice by choosing
> the language. I now want to do this in admin - a custom form should do it, but
> has anyone done this? Or is it going to come to admin? Or maybe it is there
> and I have not noticed it?

And letting the users to change their language modifiying the main
admin template and giving them a change language form?

--
Antoni Aloy López
Blog: http://trespams.com
Site: http://apsl.net


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Frans  
View profile  
 More options Nov 7, 5:13 am
From: Frans <franc...@verbeek.name>
Date: Sat, 7 Nov 2009 02:13:20 -0800 (PST)
Local: Sat, Nov 7 2009 5:13 am
Subject: Re: language switching in admin
I use the breadcrumbs block in the admin interface to add a link to a
view
using :
(in template)
<div id="breadcrumbs"
 <p><span class="breadcrumbs">
<a class="discreet_link" href="{% url content.views.set_language
lang_code="fr" %}">Fr</a>&nbsp;|&nbsp;
<a class="discreet_link" href="{% url content.views.set_language
lang_code="nl" %}">Nl</a>&nbsp;|&nbsp;
<a class="discreet_link" href="{% url content.views.set_language
lang_code="en" %}">En</a>&nbsp;|&nbsp;
<a class="discreet_link" href="{% url content.views.set_language
lang_code="ja" %}"> >日本語</a>&nbsp;
</span></p>
 (for each language, in every page, impractical if you have many, but
you can replace that by a special page of links if that's the case
(like google's language switch page) )
</div>

(in url.py)
    (r'^lang/(?P<lang_code>[a-zA-Z]+)/$',set_language),

And then I just set the language cookie manually
(in views.py)

def set_language(request,**kwargs):
    next = request.REQUEST.get('next', None)
    if not next:
         next = request.META.get('HTTP_REFERER', None)
    if not next:
         next = '/'
    lang_code = kwargs.get("lang_code",None)
    response=HttpResponseRedirect(next)
    if lang_code and check_for_language(lang_code):
        if hasattr(request, 'session'):
            request.session['django_language'] = lang_code
        else:
            response.set_cookie(settings.LANGUAGE_COOKIE_NAME,
lang_code)
    return response

On Nov 7, 9:49 am, Antoni Aloy <antoni.a...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kenneth Gonsalves  
View profile  
 More options Nov 7, 11:17 pm
From: Kenneth Gonsalves <law...@au-kbc.org>
Date: Sun, 8 Nov 2009 09:47:53 +0530
Local: Sat, Nov 7 2009 11:17 pm
Subject: Re: language switching in admin
On Saturday 07 Nov 2009 3:19:54 pm Antoni Aloy wrote:
> > hi,

> > I have an app in two languages. Until now I was asking the users to
> > change the language in their browser. I have now implemented setlang in
> > the web interface, so that they can view in the language of their choice
> > by choosing the language. I now want to do this in admin - a custom form
> > should do it, but has anyone done this? Or is it going to come to admin?
> > Or maybe it is there and I have not noticed it?

> And letting the users to change their language modifiying the main
> admin template and giving them a change language form?

well I added the change language form to the main base.html form in admin (by
overriding it), but the call to "/i18n/setlang/" is not working. Maybe a path
problem. Any clues?
--
regards
Kenneth Gonsalves
Senior Project Officer
NRC-FOSS
http://nrcfosshelpline.in/web/

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kenneth Gonsalves  
View profile  
 More options Nov 7, 11:21 pm
From: Kenneth Gonsalves <law...@au-kbc.org>
Date: Sun, 8 Nov 2009 09:51:23 +0530
Local: Sat, Nov 7 2009 11:21 pm
Subject: Re: language switching in admin
On Sunday 08 Nov 2009 9:47:53 am Kenneth Gonsalves wrote:
> > And letting the users to change their language modifiying the main
> > admin template and giving them a change language form?

> well I added the change language form to the main base.html form in admin
>  (by  overriding it), but the call to "/i18n/setlang/" is not working.
>  Maybe a path problem. Any clues?

now it is working - neat ;-)
--
regards
Kenneth Gonsalves
Senior Project Officer
NRC-FOSS
http://nrcfosshelpline.in/web/

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kenneth Gonsalves  
View profile  
 More options Nov 8, 9:40 pm
From: Kenneth Gonsalves <law...@au-kbc.org>
Date: Mon, 9 Nov 2009 08:10:50 +0530
Local: Sun, Nov 8 2009 9:40 pm
Subject: Re: language switching in admin
On Sunday 08 Nov 2009 9:51:23 am Kenneth Gonsalves wrote:

> > well I added the change language form to the main base.html form in admin
> >  (by  overriding it), but the call to "/i18n/setlang/" is not working.
> >  Maybe a path problem. Any clues?

> now it is working - neat ;-)

it was not a path problem, the browser needed to be refreshed to show the
language change
--
regards
Kenneth Gonsalves
Senior Project Officer
NRC-FOSS
http://nrcfosshelpline.in/web/

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google