Re: [openedx-translation] Default home page language and dark lang config.

1,298 views
Skip to first unread message

Sarina Canelake

unread,
May 22, 2015, 8:43:11 AM5/22/15
to openedx-t...@googlegroups.com
Is the user's browser preference set to Lithuanian? IF not they'll be shown the default site language.

You can set the default site language to something that's not English. See the first sentence of this section: https://github.com/edx/edx-platform/wiki/Internationalization-and-localization#releasing-a-language

On Fri, May 22, 2015 at 4:38 AM, M. <mindauga...@gmail.com> wrote:

Hello. I managed to release few languages using dark lang config from Django admin. (English and Lithuanian). It works great. User can choose his language from preferences. But I want to localize home page as well. What i did works fine for logged in users, but users who are not logged in are still shown the default english version of site.. I need it to be in Lithuanian as it does for logged in users right now.

I tried to change default language code parameter

LANGUAGE_CODE

into

lms.env.json
cms.env.json

and

edx-platform/lms/envs/common.py
edx-platform/cms/envs/common.py


But i doesn't seem to be working.

I also tried make fullstack localization steps from: https://github.com/edx/edx-platform/wiki/Internationalization-and-localization
but it works only when dark lang config isn't configured for few languages (lt-lt, en).

Any ideas how to solve this?

--
You received this message because you are subscribed to the Google Groups "openedx-translation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openedx-transla...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openedx-translation/81b884e7-b355-400a-9a90-ee10a859e386%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

M.

unread,
May 22, 2015, 1:58:02 PM5/22/15
to openedx-t...@googlegroups.com
Thanks for answer Sarina. But I did all these steps before I had writed here.
My problem is that I can't use default Lithuanian language in home page (for users who are not logged in). When I adding language codes for additional languages with django admin in dark lang config section (lt-lt, en), my configured default Lithuanian language changing to English.

What I do:

First, I make localization for full stack with this instructions: https://github.com/edx/edx-platform/wiki/Internationalization-and-localization#localization-process-for-a-local-full-stack-installation and set the default site language (Lithuanian) for LMS and CMS. It works good.

Then for additional English language (not default) I make these changes from this section: https://github.com/edx/edx-platform/wiki/Internationalization-and-localization#releasing-a-language

On the Django admin panel in darklangconfig section I add "lt-lt, en" . After this changes my default site language (Lithuanian) becames English.. Why? 

I made experiment. On the Django admin panel in darklangconfig I writed other languages (not english). For example "lt-lt, ar, es-419". After this, my default site language (lithuanian) didn't changed to english and logged users can switch languages from his profile. So all works fine. But if I want to add (in darklangconfig) English like additional site language for logged in users, my default site language changing to English. What's wrong? Can I solve it?


"Is the user's browser preference set to Lithuanian?"

Can you explain more about it?

Thanks for advice! and sorry for my english grammar!

Sarina Canelake

unread,
May 22, 2015, 2:09:56 PM5/22/15
to openedx-t...@googlegroups.com
That is odd, and not something I've experienced - unfortunately I only have my site default language set to English. So there may be a bug here.

Does anyone on this list have experience with a default site language in a non-English language, and then releasing English as a secondary language?



--
You received this message because you are subscribed to the Google Groups "openedx-translation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openedx-transla...@googlegroups.com.

M.

unread,
May 22, 2015, 2:59:10 PM5/22/15
to openedx-t...@googlegroups.com
I copied first message from here: http://stackoverflow.com/questions/27717961/how-to-internationalization-and-localization-of-front-end

As I see, other people also have this problem.


2015 m. gegužė 22 d., penktadienis 15:43:11 UTC+3, Sarina Canelake rašė:
Is the user's browser preference set to Lithuanian? IF not they'll be shown the default site language.

You can set the default site language to something that's not English. See the first sentence of this section: https://github.com/edx/edx-platform/wiki/Internationalization-and-localization#releasing-a-language

M.

unread,
May 23, 2015, 4:16:41 PM5/23/15
to openedx-t...@googlegroups.com
I solved this problem. In dark lang config I writted "lt-lt, en-uk" instead of "lt-lt, en". Now my aditional language is English (United Kingdom) insted of English (Source edx language).

Thanks Sarina for support !

Sarina Canelake

unread,
May 26, 2015, 11:46:28 AM5/26/15
to openedx-t...@googlegroups.com
I think this is a significant bug. Unfortunately I don't have the bandwidth to tackle this right now. If anyone is interested in looking into and perhaps fixing this bug, please comment on the ticket I've made: https://openedx.atlassian.net/browse/LOC-82

On Sat, May 23, 2015 at 4:16 PM, M. <mindauga...@gmail.com> wrote:
I solved this problem. In dark lang config I writted "lt-lt, en-uk" instead of "lt-lt, en". Now my aditional language is English (United Kingdom) insted of English (Source edx language).

Thanks Sarina for support !

--
You received this message because you are subscribed to the Google Groups "openedx-translation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openedx-transla...@googlegroups.com.

Luiz Aoqui

unread,
May 27, 2015, 10:38:01 AM5/27/15
to openedx-t...@googlegroups.com
I am seeing the same issue. I had "en, pt-br" but it would always show English, no matter the value of LANGUAGE_CODE.

Changing it to "en-uk, pt-br" fixed the problem.

Thanks M.


On Tuesday, May 26, 2015 at 12:46:28 PM UTC-3, Sarina Canelake wrote:
I think this is a significant bug. Unfortunately I don't have the bandwidth to tackle this right now. If anyone is interested in looking into and perhaps fixing this bug, please comment on the ticket I've made: https://openedx.atlassian.net/browse/LOC-82
On Sat, May 23, 2015 at 4:16 PM, M. <mindauga...@gmail.com> wrote:
I solved this problem. In dark lang config I writted "lt-lt, en-uk" instead of "lt-lt, en". Now my aditional language is English (United Kingdom) insted of English (Source edx language).

Thanks Sarina for support !

--
You received this message because you are subscribed to the Google Groups "openedx-translation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openedx-translation+unsub...@googlegroups.com.

Sarina Canelake

unread,
Jul 6, 2015, 11:07:24 AM7/6/15
to openedx-t...@googlegroups.com
Hi Luiz,

I am investigating this right now. A few notes:

1. I set the `LANGUAGE_CODE` in lms/envs/common.py to `pt-br`. I then started up my server, to make sure this value was read in.

2. In the dark lang panel I released "en, pt-br".

3. I set my user's browser preference to Portuguese (Brazil). In Firefox, this is very easy: navigate to Preferences > Content > Languages, and choose Portuguese (Brazil) as your preference, and make sure it is at the top of your list.

4. I visited my server and I saw Portuguese strings. Please note that not all the strings are translated, so I did see a number of English strings. That's because edx-platform is defined in English, and will show English strings unless there's a translation available. Here is what I saw:



Note that if a user is not logged in, and their browser language prefers English, that's the language they will see if you release English. For users that aren't logged in generally, we look at their browser's accept language header and serve them their most preferred released language. So for example, if you have released the languages:

ar, es-419, en

And a user visits your site, and they have set in their browser that their preferred languages are:

pt, it, es

They will be presented with the "es-419" language. Why? pt and it are not released, but they do want to see 'es' and 'es-419' is released.

Another example. If you have released

ar, es-419, en

And your LANGUAGE_CODE is set to 'es-419'. A user visits requesting the following languages:

fr, de

Well, your site doesn't offer fr or de, so they should see es-419 because that is the LANGUAGE_CODE for your site. So here is the source of the bug LOC-82. They actually see English.


So, you actually have to change the EDXAPP_LANGUAGE_CODE setting to be "es-419" as well in the configuration repo.

Problematically I have no idea how to do this and there doesn't seem to be adequate documentation on how to do so. When I figure out how to do this I will make sure this gets well documented and gets added to the instructions on Github.

You can follow the progress by watching this ticket: https://openedx.atlassian.net/browse/LOC-82

Hope that is helpful!

Sarina

On Wed, May 27, 2015 at 10:38 AM, Luiz Aoqui <lgf...@gmail.com> wrote:
I am seeing the same issue. I had "en, pt-br" but it would always show English, no matter the value of LANGUAGE_CODE.

Changing it to "en-uk, pt-br" fixed the problem.

Thanks M.

On Tuesday, May 26, 2015 at 12:46:28 PM UTC-3, Sarina Canelake wrote:
I think this is a significant bug. Unfortunately I don't have the bandwidth to tackle this right now. If anyone is interested in looking into and perhaps fixing this bug, please comment on the ticket I've made: https://openedx.atlassian.net/browse/LOC-82
On Sat, May 23, 2015 at 4:16 PM, M. <mindauga...@gmail.com> wrote:
I solved this problem. In dark lang config I writted "lt-lt, en-uk" instead of "lt-lt, en". Now my aditional language is English (United Kingdom) insted of English (Source edx language).

Thanks Sarina for support !

--
You received this message because you are subscribed to the Google Groups "openedx-translation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openedx-transla...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "openedx-translation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openedx-transla...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openedx-translation/a079d569-df81-4451-a877-958e2b354205%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages