Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7984933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:25:44+00:00 2026-06-04T11:25:44+00:00

I can switch to ru and en , but when i try to switch

  • 0

I can switch to ru and en, but when i try to switch to hy, nothing happens.

settings.py

...
LANGUAGE_CODE = 'en'

LANGUAGES = [
    ('en',_('English')),
    ('ru', _(u'Russian')),
    ('hy', _(u'Armenian')),
]

sidebar.html

...
<div id="sidebar-item-news">
        <form action="/i18n/setlang/" method="post" id="language-select">
            <input name="next" type="hidden" value="/" />
            {% csrf_token %}
            <select name="language">
                {% for lang in LANGUAGES %}
                    <option value="{{ lang.0 }}">{{ lang.1 }}</option>
                {% endfor %}
            </select>
            <input type="submit" value="Go" />
        </form>
</div>

urls.py

# Internationalization
    (r'^i18n/', include('django.conf.urls.i18n')),

After some debugging i figured out that request.session[‘django_language’] changes only to ru and en:

Current language is ru
[19/May/2012 22:51:55] "GET / HTTP/1.1" 200 13357
[19/May/2012 22:51:56] "POST /i18n/setlang/ HTTP/1.1" 302 0
Current language is ru
[19/May/2012 22:51:56] "GET / HTTP/1.1" 200 13357

I have all compiled translation files in /locale/hy and /locale/ru

If i put in home view translation.activate('hy') it works perfectly, but if i try to do this with my api

def api(request, type):
    if request.method == 'POST':
        if type == 'daytime':
            request.session['daytime'] = request.POST['daytime']
            return HttpResponse(request.session['daytime'])

        if type == 'language':
            request.session['custom_language'] = True
            request.session['django_language'] = request.POST['language']
            translation.activate(request.session['django_language'] )
            return HttpResponse(request.session['django_language'])
        raise Http404
    else:
        raise Http404

It fails as the i18n/setlang form.

How to fix this?

UPD
It seems that Django does not support armenian. (there is no ‘hy’ in /django/conf/locale/)
How should i work with this language?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:25:45+00:00Added an answer on June 4, 2026 at 11:25 am

    See Locale restriction section in i18n docs. Looks like you need to modify Django a little.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have installed PDT 2.1 but i can't switch to the PHP Perspective, any
I am trying to stitch two images together, but only the first one can
User can switch active application by Alt+Tab or by clicking on their icons in
Is there a way I can switch between to views at random for the
In short: I want to have two fullscreen views, where I can switch between
Here is my issue, i got 5 view controllers and i can switch between
Can I switch resharper on/off in a simple manner. The issue is sometimes I
How can I switch off logging for BeanUtils.copyProperties ? It creates way too much
How can I switch on and off bluetooth directly without needing to have a
With what VBA macro commands can I switch between sheets, in order to execute

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.