New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

Projects
None yet
5 participants
@javierder
Member

javierder commented May 13, 2015

[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

This comment has been minimized.

Show comment
Hide comment
@vekunz

vekunz 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.

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

This comment has been minimized.

Show comment
Hide comment
@Lakeant

Lakeant Jan 26, 2016

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

Lakeant commented Jan 26, 2016

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

@vekunz

This comment has been minimized.

Show comment
Hide comment
@vekunz

vekunz 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.

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

This comment has been minimized.

Show comment
Hide comment
@Lakeant

Lakeant 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.

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

This comment has been minimized.

Show comment
Hide comment
@vekunz

vekunz 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 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

This comment has been minimized.

Show comment
Hide comment
@vekunz

vekunz 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".

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

This comment has been minimized.

Show comment
Hide comment
@Lakeant

Lakeant Jan 26, 2016

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

Lakeant commented Jan 26, 2016

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

@amnotthere

This comment has been minimized.

Show comment
Hide comment
@amnotthere

amnotthere Jan 26, 2016

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).

amnotthere commented Jan 26, 2016

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

This comment has been minimized.

Show comment
Hide comment
@vekunz

vekunz 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.

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

This comment has been minimized.

Show comment
Hide comment
@amnotthere

amnotthere Jan 26, 2016

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.

amnotthere commented Jan 26, 2016

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

This comment has been minimized.

Show comment
Hide comment
@vekunz

vekunz Jan 26, 2016

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

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

This comment has been minimized.

Show comment
Hide comment
@amnotthere

amnotthere Jan 26, 2016

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

amnotthere commented Jan 26, 2016

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

@vekunz

This comment has been minimized.

Show comment
Hide comment
@vekunz

vekunz Jan 26, 2016

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

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

This comment has been minimized.

Show comment
Hide comment
@amnotthere

amnotthere Jan 26, 2016

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

amnotthere commented Jan 26, 2016

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

This comment has been minimized.

Show comment
Hide comment
@vekunz

vekunz 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.

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

This comment has been minimized.

Show comment
Hide comment
@Lakeant

Lakeant 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.

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.

@ChadwickLeo

This comment has been minimized.

Show comment
Hide comment
@ChadwickLeo

ChadwickLeo Dec 4, 2017

I have made the Chinese localization work with the following settings in settings_local.py, thanks to @amnotthere :

TIME_ZONE = 'Asia/Shanghai'
USE_I18N = True
LANGUAGE_CODE = 'cn'
LOCALE_PATHS = (os.path.join(os.path.dirname(__file__),'locale').replace('\\','/'),)

@vekunz Note the four underscores in the 3rd line...

ChadwickLeo commented Dec 4, 2017

I have made the Chinese localization work with the following settings in settings_local.py, thanks to @amnotthere :

TIME_ZONE = 'Asia/Shanghai'
USE_I18N = True
LANGUAGE_CODE = 'cn'
LOCALE_PATHS = (os.path.join(os.path.dirname(__file__),'locale').replace('\\','/'),)

@vekunz Note the four underscores in the 3rd line...

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