8
2

I have been trying to translate the system into my language. I noticed that I can replace the necessary words directly in the .html files. Howerer, I believe that this is not the right way to do this. I need to create a new language pack so I,ll be more than thankful if you could give me some guidance. Thank you.

asked 03 Apr '10, 04:56

Georgi%20Vasilev's gravatar image

Georgi Vasilev
38651414
accept rate: 23%

Into which language are you translating the OSQA?

(03 May '10, 10:38) samadhy

Hey Georgi, we use django i18n support. Detailed instructions can be found in http://docs.djangoproject.com/en/1.1/topics/i18n/localization/#topics-i18n-localization. There is just one extra step, currently we use a javascript translation file, located under forum/skins/default/media/js/com.cnprog.i18n.js. However this is about to change, I believe that javascript files are not the proper place to make translations, and soon there will be an update that refactors and simplifies all our javascript as well as some other news, and removes these translations from js. But you can start right now and nothing will be lost.

One other thing that we want to do in the future is to provide a on screen translation method, but that is probably a bit far away yet.

One final advice, if you're on windows, ignore the instructions about gettext on windows in the django instructions, it's a lot of work and not guaranteed to work, you'll probably better using something like cygwin (a unix shell emulator for windows), that will make it easier to install gettext and start translating.

Hope this helps :-)

link

answered 03 Apr '10, 13:56

Hernani%20Cerqueira's gravatar image

Hernani Cerq... ♦♦
16.5k65570
accept rate: 52%

When I execute this command: python manage.py makemessages -l es

I get this error: ./forum/settings/basic.py:13: internationalized messages should not contain the `r' escape sequence (repeated several times)

Do you know how can I fix it ?

(19 Apr '10, 05:15) Oscar ♦

For me problem is solve by editing basic.py (and other files too) and remove end line.

eg. help_text = _(""" The username for your SMTP connection. """),

is replaced by:

help_text = _("""The username for your SMTP connection."""),

(02 May '10, 03:20) ledom

Would it be possible to use a translation community site like http://translatewiki.net/ or https://translations.launchpad.net/ ? This allows for a nice and convenient graphical interface to create new translations and with their community can enable to get new translations quite rapidly in many languages.

(10 Sep '10, 16:55) apmon

I'd like to translate OSQA in italian language and contribute the translation back, I'm using 0.9 beta3 and translated about 25% but can't see translated strings after python manage.py compilemessages and changing LANGUAGE_CODE = 'it' in settings_local.py.

Any hint, guide or how to?

(19 Apr '11, 18:15) htrex

I am getting the following error when trying to execute python manage.py makemessages -l bg -e html:

    Error: errors happened while running xgettext on subscriptions.py
./forum/subscriptions.py:156: warning: 'msgid' format string with unnamed arguments cannot be properly localized:
                                       The translator cannot reorder the arguments.
                                       Please consider using a format string with named arguments,
                                       and a mapping instead of a tuple for the arguments.

Any ideas?

link

answered 04 Apr '10, 04:04

Georgi%20Vasilev's gravatar image

Georgi Vasilev
38651414
accept rate: 23%

Hey Georgi, yes I know what it is. I'll post a patch here in a while.

(04 Apr '10, 14:30) Hernani Cerq... ♦♦

I've allready solved this on my repo in the past. BTW you need to translate the javascript files too. In formus/skins/default/media/js/com.cnprog.i18n.js

(05 Apr '10, 02:02) Fitoria

Do you by chance remember the solution? I will be translating the .js files, thanks.

(05 Apr '10, 04:18) Georgi Vasilev

Patch to fix this problem:

 Error: errors happened while running xgettext on subscriptions.py
./forum/subscriptions.py:156: warning: 'msgid' format string with unnamed arguments cannot be properly localized:
                                       The translator cannot reorder the arguments.
                                       Please consider using a format string with named arguments,
                                       and a mapping instead of a tuple for the arguments.

can be taken here.

link

answered 06 Apr '10, 08:34

ekalinin's gravatar image

ekalinin
116135
accept rate: 25%

I have been translating for a while now, however I believe that I am doing something wrong. When I type python manage.py compilemessages bg and then select bg as the language in my local settings, I do not see the translated strings, instead, the default English language still stands.

link

answered 12 Apr '10, 05:04

Georgi%20Vasilev's gravatar image

Georgi Vasilev
38651414
accept rate: 23%

1

I must admit that I'm not totally comfortable with the translation process, I started a pt translation a while back but is still unfinished, and I remember that I had some issues as well. Maybe I'll retry the process later on, and post here some more detailed instructions.

(12 Apr '10, 06:12) Hernani Cerq... ♦♦

Hey @Georgi. I had a problem that sounds this way before. Do you have LocaleMiddleware on? If so then turn it off. see http://stackoverflow.com/questions/1230315/cant-switch-language-environment-in-django Cheers!

(12 Apr '10, 15:31) Evgeny Fadeev

Same problem for me, with or without LocaleMiddleware active... any other idea?

(02 May '10, 03:52) ledom

Maybe try manage.py compilemessages -l bg (At least that's what manage.py help compilemessages says)

(30 Jul '11, 17:44) curiousleo
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×19
×6

Asked: 03 Apr '10, 04:56

Seen: 2,332 times

Last updated: 30 Jul '11, 17:44

powered by OSQA