Questions tagged [django-i18n]

Django internationalization provides developers with the ability to build web applications and provide content in multiple languages and locales.

Django internationalization provides developers with the ability to build web applications and provide content in multiple languages and locales.

For text translations, the Django developer can accomplish this goal by adding a minimal amount of hooks to Python and templates. These hooks are called translation strings. They tell Django: “This text should be translated into the end user’s language, if a translation for this text is available in that language.”

Internationalization is achieved in three steps:

  1. Embed translation strings in your Python code and templates.
  2. Get translations for those strings, in whichever languages you want to support.
  3. Activate the locale middleware in your Django settings.
359 questions
0
votes
2 answers

Change the date format depending on language

I wonder if there's a way in the django template system to format the date depending on the language. Like if my site is in english this code {{ submitted_date | date }} will be displayed like this : June 29, 2016 But if the site is displayed in…
Emmurd
  • 67
  • 1
  • 8
0
votes
1 answer

django KeyError for my i18n javascript catalog url

This is a bit odd. I'm using Django 1.9.6, and it doesn't like my i18n javascript_catalog url after I changed it from the obsolete 1.7 syntax (I finally decided I should do something about that "not gonna work in django 1.10" warning I get every…
Escher
  • 5,418
  • 12
  • 54
  • 101
0
votes
2 answers

django: Language-aware Drop-down

I am new to django and i am loving it so far especially its nice community. Here is my question: I have this model class Nationality(models.Model): nationality_fr = models.CharField(max_length=50) nationality_en =…
0
votes
1 answer

i18n not work when change language prefix

My i18n locale test not work as expected,the directory is like this: mysite.urls.py from django.contrib import admin from django.conf.urls import patterns, include, url from django.conf.urls.i18n import i18n_patterns urlpatterns = patterns('', …
Jim
  • 767
  • 1
  • 10
  • 24
0
votes
1 answer

Django i18n: Translating database values where one word is a name that might change

I wanna translate the notifications users get in my app (Django 1.8). The notifications are stored in the database and all have standard texts, but they include the name of the person that the notification relates to, for example, one might…
Fabio
  • 3,015
  • 2
  • 29
  • 49
0
votes
1 answer

i18n issues in template in Django 1.9.1

Currently attempting to upgrade Django 187 --> 191 but am running into an unexpected problem with translations in my template files. At first occurrence of a trans-tag in template I get the error below. Seems to me like ugettext is not defaulting…
Jens Lundstrom
  • 702
  • 8
  • 15
0
votes
1 answer

Django settings.languages not loading properly

I can switch the languages on my website manualy. For example, If i go to http://127.0.0.1:8000/en/ , my website is in english version. If i go to http://127.0.0.1:8000/xx/ , my website will switch to the corresponding language. But i want to write…
ctchanac
  • 17
  • 2
0
votes
1 answer

Yet another issue with Django Translation

After reading dozens of questions and answers about not working transtalions, I give up, because I did (I think I did) everything mentioned in other threads and still can't get work done. My settings.py: # -*- coding: utf-8 -*- from __future__…
Mateusz Knapczyk
  • 276
  • 1
  • 2
  • 15
0
votes
1 answer

CSRF error django 1.8 i18n internationalization

Hi I have django internationalization working on my django site. That is if i browse ".../en/foo/bar" and ".../nb/foo/bar" they work fine. But i am trying to get a drop down menu to automatically change the language but i get csrf…
flexxxit
  • 2,440
  • 5
  • 42
  • 69
0
votes
1 answer

Django i18n particular behavior setup

I need django i18n to work like this: site.com/lang/ set the session language to lang, writes it to the cookie and redirects user to site.com. If it's a first-time visitor and prefix is not specified, default lang is shown. Sorry for such a basic…
0
votes
1 answer

Django: international subroutes

It's written in official documentation here that i18n_patterns() is only allowed in your root URLconf. This is a problem for me because I need those URLs working: /en/products/ /fr/produits/ /sv/produkt/ /en/products/detail/[my product…
Olivier Pons
  • 15,363
  • 26
  • 117
  • 213
0
votes
1 answer

Django - Internationalization of rates

I'm currently creating a website with django 1.8 and I've met a detail, I must display a price list in the local currency of the country in which it is displayed but do not know how to convert between prices (eg, equivalence between the price in USD…
0
votes
0 answers

Translation in Django 1.6.5

Recently I had been working on website made 2 or 3 years ago by my predecessor (I write this because app is a mess and it's not my fault). Boss asked me to make it multilingual just simply adding English version. I followed instructions from…
Mateusz Knapczyk
  • 276
  • 1
  • 2
  • 15
0
votes
1 answer

Django registration broke after i18n addition

I recently added i18n and l10n to my Django application, but my registration broke. I have this: myApp/views.py def register_user(request): if request.method == 'POST': form = MyRegistrationForm(request.POST) if form.is_valid(): …
erip
  • 16,374
  • 11
  • 66
  • 121
0
votes
1 answer

i18n and l10n in Django with different views

I'm trying to localize my application for internationalization purposes, but I'm having a problem developing a URL for the views once a language is chosen. I have these relevant entries in my settings.py ... USE_I18N = True USE_L10N =…
erip
  • 16,374
  • 11
  • 66
  • 121