[OSQA-937] Localization is not applied properly #499

Open
javierder opened this Issue May 13, 2015 · 16 comments

Projects

None yet

4 participants

@javierder
Member

[reporter="ajite", created="Tue, 11 Feb 2014 21:39:00 -0500"]
Only a few strings are translated after changing the LANGUAGE_CODE value in settings_local.py.




I made many tests such as:



  • ./manage.py compilemessages

  • ./manage.py makemessages -l zh_CN

  • Removed any fuzzy translations

  • Used other localization




    Nothing worked.




    Additional informations:


    The last version of the code has been pulled from Github


    I have got this error with both Chinese and French localization and it always the same string that are translated.
@vekunz
vekunz commented Jan 26, 2016

Here the same. I tried to use a german Translation, but I only see one or two translated strings on the website.

@Lakeant
Lakeant commented Jan 26, 2016

Did it can be resolved?
A way I think, just translate the .html page one by one?

@vekunz
vekunz commented Jan 26, 2016

Lakeant: I also had this idea, but with the template files you could only translate a bit of the strings, because the templates are partially generated by the Django framework. For example the main menu is generated dynamically.

@Lakeant
Lakeant commented Jan 26, 2016

sumafu:oh,you are right!

I also tried to add some file path and line position into the .po file
,but I have no idea to get the line position

like this:
#: forum/registry.py:126
#: forum/registry.py:???
msgid "remove super user status"
msgstr ""

And have any progress, I will reply on this.

@vekunz
vekunz commented Jan 26, 2016

I just wrote a mail to the Support of DZonesoftware, if they will resume bug fixing or not. I'm going to write it here, if I get an answer.

@vekunz
vekunz commented Jan 26, 2016

The Support answerd me and said that "OSQA is not supported much anymore. It’s a good product, but we don’t spend time updating it".

@Lakeant
Lakeant commented Jan 26, 2016

T.T~I see. Now,we will do it by ourself

@amnotthere

Are you sure your locale path is properly set in your settings_local.py ?
Here is my local setting and it works in French (some words are missing) :

USE_I18N = True
LANGUAGE_CODE = 'fr'
LOCALE_PATHS = (os.path.join(os.path.dirname(file), 'locale').replace('','/'),)

I think I had to delete all compiled files after changing the path to make it work.

I have read many times people struggling to make the german locale works on osqa forums (now answerhub).

@vekunz
vekunz commented Jan 26, 2016

hugocalderon: I have no node "LOCALE_PATHS". And some strings are translated. For example in the main menu the point "user" or the "Add" button on interesting tags.

@amnotthere

Open your locale/de/LC_MESSAGES/django.po

On the osqa version I have, most translations are blank (msgstr ""). Looks like osqa never really got translated in german.

If you have the same problem, maybe you can find an unofficial translation somewhere.

@vekunz
vekunz commented Jan 26, 2016

I have a full unofficial Translation into german. But it also doesn't work with the default translations spanish and chinese.

@amnotthere

can you give me a link so I can try it out ?

@vekunz
vekunz commented Jan 26, 2016

https://crowdin.com/project/osqa-dutch/de. This file very invalid. I had to correct many mistakes myself, before compling worked.

@amnotthere

Yes unfortunatelly I could not make it work. Maybe i can try with your corrected version.

I currently work on a modded version, so I downloaded a fresh OSQA on this repository and made both fr and es locale work.

  • Unzipped the file
  • Copied the settings_local.py.dist to a settings_local.py
  • mod in the settings_ local :

a - set the debug to true
DEBUG = True

b- set a sqlite db
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(os.path.dirname(file),'db'),
'ATOMIC_REQUESTS': True
}
}

c- added the local config for spanish
USE_I18N = True
LANGUAGE_CODE = 'es'
LOCALE_PATHS = (os.path.join(os.path.dirname(file), 'locale').replace('','/'),)

d- removed some modules to get rid of error messages
DISABLED_MODULES = ['books', 'recaptcha', 'project_badges', 'stats', 'mysqldb', 'forum_badge','mysqlfulltext']

  • made a python manage.py syncdb
  • lastly python manage.py runserver

And voila, it was working.

Sorry for bad formating. Hope it helps.

Edit: maybe I should add that I use WIndows 8
Python 2.7.2
Django 1.6
markdown 2.4
html5lib
south 1.0.2

@vekunz
vekunz commented Jan 27, 2016

If I add LOCALE_PATHS osqa won't work, I get only errors. Also I couldn't run manage.py because of errors.
Maybe I should say that I'm using Bitnami OSQA.

@Lakeant
Lakeant commented Feb 2, 2016

And now~I was edit the .po file, fortunately,it work!
But,it is chineses language! example: http://www.pointoverflow.com/

the way to edit is referance the .po file and locate the translation like other,add or edit。

if you need the .po file which I used,please leave your email.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment