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
1 answer

how to have unicode characters in django url?

My Url conf is as follows url(ur'^phrase/(?P[_A-Za-z]+)/(?P[%A-Za-z0-9]+)/$', 'gs.langdb.views.phrases'), Views.phrases returns JSON object def phrases(request,lang,phrase): …
anish
  • 1,035
  • 4
  • 13
  • 27
0
votes
1 answer

Run Django with gettext without database

I've got a simple webform created with Django 1.6 without using a database backend, as I just don't need them. Now I want to make usage of gettext for some i18n, but I'm getting a settings.DATABASES is improperly configured. Please supply the…
frlan
  • 6,950
  • 3
  • 31
  • 72
0
votes
2 answers

django language translation using i18n for xml parsed content

This is my settings.py LANGUAGE_CODE = 'en-us' USE_I18N = True USE_L10N = True ugettext = lambda s: s LANGUAGES = ( ('ar', ugettext('Arabic (U.A.E.)')), ) MIDDLEWARE_CLASSES =…
0
votes
1 answer

django Internationalization: translation string not fully translated

I am making a Chinese blog using django. I write everything I can control in Chinese, such as post text, blog title, blog navigation, and the label tags of the comment and contact-me forms. The only things I cannot control are the form submitting…
0
votes
1 answer

Writing translatable static web pages using Django

I am a bit confused on the best way to handle this problem: My web site needs read-only static web pages (typically the About part of a web site) with 2 simple constraints: they need to be translated they need to have flexible layout: to…
0
votes
1 answer

Manage i18n content in the area between .po-files and flatpages

I have a django project utilizing flatpages for pages with primarily static content and .po-files for shorter strings, headers, buttons etc. But I'm having trouble exploring alternatives for the block of content that a customer would want to edit…
D.Nibon
  • 2,883
  • 1
  • 19
  • 17
0
votes
2 answers

Django 1.5 , language url redirect and javascript

I just migrated to django 1.5 and I am facing a problem with the new policy regarding url language redirects, my old Ajax POST to for example /search end up being redirected to /en/search with a GET of course. How to fix this (ideally without…
maazza
  • 7,016
  • 15
  • 63
  • 96
0
votes
1 answer

Is there a good shortcut convention for ugettext_noop in python/django?

When doing i18n support for django apps it sometimes comes up to have to use ugettext and ugettext_noop in the same file. It's a common convention to import ugettext as _ which is a nice convention in code. I'm wondering if there is such a…
Cory
  • 22,772
  • 19
  • 94
  • 91
0
votes
2 answers

Internationalisation of a Django application

I'w writing a Django application, which stores data with descriptions in at least 2 languages (Russian and English). By "data" I mean the information, which users will write (enter, edit) to and read from the application (not the UI). The…
Glory to Russia
  • 17,289
  • 56
  • 182
  • 325
0
votes
1 answer

How to view your translated site?

I am trying to view my site in japanese. I have create the translations and compiled them with compilemessages. In my urls.py I have urlpatterns = i18n_patterns('', #... ) Settings.py LANGUAGE_CODE = 'en-us' #Used for translations gettext =…
Siecje
  • 3,594
  • 10
  • 32
  • 50
0
votes
1 answer

What is the best method/tool to merge two .po translation files one old and one new with replace?

I want to merge two .po files together and produce new .po file. I am assume that many people will deliver different translation what need be merge into one. First I want to replace all old translation in .po file with new one from other .po file…
Chameleon
  • 9,722
  • 16
  • 65
  • 127
-1
votes
1 answer

django + chart.js: page language switch button mess up the charts. What?

I am having a super strange issue in my django app that renders graphs with chart js. I used i18n to handle the translation but after spending hours trying to fix my charts, I found out that when language is english the chart work well but when…
Murcielago
  • 905
  • 1
  • 8
  • 30
-1
votes
1 answer

Translate templates in django

I have project in Django 1.8. I want to have website with 3 languages, but when I choose language nothing happen: Code in my template: {% load i18n %} ...
{% csrf_token %} {%…
mark
  • 653
  • 1
  • 10
  • 23
-1
votes
1 answer

Blocktrans correctly written in django template

I want my django template variables were possible to translate. I used for this purpose {% blocktrans %}. Is this code is correct and can be optimized. I mean to write better? The loop or something like that. {% for obj in objects %} {%…
mark
  • 653
  • 1
  • 10
  • 23
1 2 3
23
24