ACCOUNT SETTINGS page not showing localized strings

794 views
Skip to first unread message

Anna Winklerová

unread,
Oct 25, 2016, 9:30:49 AM10/25/16
to openedx-translation
Hello,

I have translated many strings to Czech language on our production site localy via fastgenerate with success. However the ACCOUNT SETTINGS page stays in English no matter what I do. I am out of ideas.

Did: translate, fastgenerate, generate, restart edxapp, restart worker, restart nginx, clear browser cache. 

Thanks for any ideas.

Anna

Anna Winklerová

unread,
Dec 11, 2016, 11:56:28 AM12/11/16
to openedx-translation
Hi again.

I found the edx-platform/lms/static/js/i18n/cs/django.js file and inserting those not translated strings in unicode solved my problem. 

But I am curious... how and when gets this file and the translated strings in it generated? The paver i18n_fastgenerate had obviously no effect. 

Thanks

Anna


Dne úterý 25. října 2016 15:30:49 UTC+2 Anna Winklerová napsal(a):

Andy Armstrong

unread,
Dec 11, 2016, 12:59:24 PM12/11/16
to openedx-t...@googlegroups.com
Hi Anna,

This process was updated back in February and it seems it may not be fully documented. Now a Django command (compilejsi18n) is issued to statically generate the JavaScript files into the directory you found:


It seems that this is only available through i18n_robot_pull and won't be invoked via i18n_fastgenerate. It is possible that this new process should be separated out into its own command.

Please let us know if this is enough for you to work with, or if you need more details.

Thanks,

 - Andy

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/openedx-translation/13f27a85-2e28-434a-aa17-856f8695608f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Andy Armstrong

edX | UI Architect  | an...@edx.org  

141 Portland Street, 9th floor

Cambridge, MA 02139

http://www.edx.org

http://www.e-learn.nl/media/blogs/e-learn/edX_Logo_Col_RGB_FINAL.jpg?mtime=1336074566

Anna Winklerová

unread,
Dec 11, 2016, 1:24:23 PM12/11/16
to openedx-translation
Hi Andy,

thank you, i ran 

/edx/bin/python.edxapp manage.py lms compilejsi18n --settings=aws

and the django.js got recompiled. My info source for Open edX localization was https://github.com/edx/edx-platform/wiki/Internationalization-and-localization#localization-process-for-a-local-full-stack-installation and I did not find it there. 

I may have one more question tomorrow if I do not crack it by then.

Thanks again for your reply
Anna



Dne neděle 11. prosince 2016 18:59:24 UTC+1 Andy Armstrong napsal(a):

Kostas Stefanou

unread,
Mar 8, 2017, 9:29:37 AM3/8/17
to openedx-translation
Dear Anna,

I am facing the same problem in greek language.

I found the edx-platform/lms/static/js/i18n/el/django.js file (el in my case) and I want to ask you how did you insert the not translated strings in unicode in this file so that I will do the same?

For example, how did you write the translation of 'Account settings' in the file?

Thank you for your time.

Best Regards,

Kostas.

Andy Armstrong

unread,
Mar 8, 2017, 1:10:01 PM3/8/17
to openedx-t...@googlegroups.com
The JavaScript translations used to be dynamically generated on each page request, but we found that this was a large performance bottleneck for non-English languages. 

The process was changed in January 2016 to statically generate these files when new translations are pulled down from Transifex. You can see the PR that introduced these changes here:


If you're not familiar with how edX uses Transifex to manage translations, you can see the documentation here:


Does this help? Are you managing your translations through Transifex?

 - Andy


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

For more options, visit https://groups.google.com/d/optout.

Kostas Stefanou

unread,
Mar 9, 2017, 2:58:49 AM3/9/17
to openedx-translation
Dear Andy,

thanks again for your quick response.

I am familiar with the use of Transifex.

I have pulled the greek translations from Transifex and I have successfully created the django.po, djangojs.po and all the *.mo files in the 'LC_MESSAGES' folder.

This way, the edx site shows up in greek language.

When I notice a non-translated string, I insert it in the respective .po file (usually the english string is there and I insert the greek translation in "") and generate the django.po, djangojs.po and all the *.mo files again and my translation shows up successfully.

My problem is in specific areas, such as bookmarks, profile, account, search of edx that do not get the translations I insert.

Probably the issue is with the static Javascript translations. So, I saw this topic and I located the 'edx-platform/lms/static/js/i18n/el/django.js' file.

My question is what to do with it.

Will inserting translations there solve my problem? How do I insert them?

In the file somewhere or do I copy files from 'LC_MESSAGES' to this folder? What are the commands I should enter to do it successfully?

Sorry for the many questions but I have been trying for several days with no success.

Thanks in advance.

Best Regards,

Kostas.

Andy Armstrong

unread,
Mar 9, 2017, 10:02:58 AM3/9/17
to openedx-t...@googlegroups.com
Hi Kostas,

The problem is that the process is not designed for you to hand edit the .po files. The intention is that you update the translations in Transifex and pull them down each time, at which point the JavaScript files will be regenerated too. If you hand edit the files, then the translations don't get shared with the community, and you will have a difficult time merging when you need to pull down updates. 

My recommendation is that you update in Transifex , but if you think you need to hand edit the files then you'll need to run the command to regenerate the JavaScript files yourself. The documentation for the library we use is here:


I hope this helps.

 - Andy

P.S. If you are unable to use Transifex, it would be great if you could explain why so that we have a better understanding of our limitations. Thanks!



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

For more options, visit https://groups.google.com/d/optout.

Kostas Stefanou

unread,
Mar 9, 2017, 10:31:56 AM3/9/17
to openedx-translation
Dear Andy,

thank you again.

I think I get your way of thinking now. Once I'm done, I will visit Transifex to share my translations with the community.

However, since I have hand-edited all my needed translations now in the .po files (in the 'LC_MESSAGES' folder), I was trying to regenerate the JavaScript files myself.

I was trying the command 'python manage.py lms compilejsi18n --settings=aws' but to no avail, the translations in the problematic areas (bookmarks, profile, account, forum, search) do not show up (in all others areas they show up fine).

What am I missing here?

Best Regards,

Kostas.

Andy Armstrong

unread,
Mar 16, 2017, 10:06:58 AM3/16/17
to openedx-t...@googlegroups.com
Hi Kostas,

I've been on vacation but I'm back now and wondering how things are working for you. If you use the Transifex flow do you find that the strings are getting translated. If not, can you send me an example updated file so I can see which translations are missing.

Thanks,

 - Andy

To unsubscribe from this group and stop receiving emails from it, send an email to openedx-translation+unsubscribe...@googlegroups.com.



--
To unsubscribe from this group and stop receiving emails from it, send an email to openedx-translation+unsubscribe...@googlegroups.com.



--

Andy Armstrong

edX | UI Architect  | an...@edx.org  

141 Portland Street, 9th floor

Cambridge, MA 02139

http://www.edx.org

http://www.e-learn.nl/media/blogs/e-learn/edX_Logo_Col_RGB_FINAL.jpg?mtime=1336074566

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

For more options, visit https://groups.google.com/d/optout.

Kostas Stefanou

unread,
Mar 17, 2017, 11:04:21 AM3/17/17
to openedx-translation
Dear Andy,

still nothing.

I am attaching an example of the problem.

I am using the 'bookmarks-list.underscore' file to show the "You have not bookmarked any courseware pages yet." string

and I am using the Transifex 'underscore.po' file for translating this string to greek.

#: lms/templates/bookmarks/bookmarks-list.underscore
msgid "You have not bookmarked any courseware pages yet."
msgstr "Δοκιμή"

(lines 870-872)

But still this string is not being translated.

I have tried both ways:

1) Using the command python generate.py in /edx/apps/edx/edx-platform/i18n-tools/i18n  folder

2) Using the command sudo bin/python.edxapp ./manage.py lms compilejsi18n --settings=aws in cd apps/edx/edx-platform/ folder

and of course, restarted the servers.

I hope this will give you a better view of my problem.

Best Regards,

Kostas.

bookmarks-list.underscore
underscore.po

Andy Armstrong

unread,
Mar 17, 2017, 12:40:11 PM3/17/17
to openedx-t...@googlegroups.com
I looked in GitHub and I can see that many languages have successful translations for this string, e.g.


So the process for generating these files is at least partially working when using the full Transifex workflow.

Here are some next steps that you could try:

1. Be sure that you have enabled Greek in this file:


2. Edit the translation in this file:

conf/locale/el/LC_MESSAGES/djangojs.po

3. Delete all the files in lms/static/js/i18n

4. Run the compilejsi18n command and verify that it has generated new Greek JS files into that directory

A few other comments:

 - I'm not sure what you mean by editing "underscore.po" files. Did you mean djangojs.po?

 - It is best to manage the translations on devstack and not execute these commands with ``--settings aws`` until you know that it works locally

 - I still strongly recommend moving your translations into Transifex and then following the standard process for pulling down the translations which will include generation of the JS files

I hope this helps.

 - Andy


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

For more options, visit https://groups.google.com/d/optout.

Kostas Stefanou

unread,
Mar 21, 2017, 10:10:17 AM3/21/17
to openedx-translation
Dear Andy,

thank you for your time.

Still no success.

Could you point out to me the correct steps for the standard process for pulling down the translations which will include generation of the JS files?

I can share with you the steps I have followed and have failed so far (regarding the js files):

I created an account in Transifex and I created the '.transifexrc' file with the details requested (including username / password).


In the 'apps/edx/edx-platform/i18n-tools/i18n/transifexrc.py' file, I replaced the: 'tx pull --mode=reviewed -l ' + lang command with: 'tx pull -l' + lang command.


I executed 'tx pull -l el' and I got the latest greek translations from Transifex.


I executed 'apps/edx/edx-platform/i18n-tools/i18n$ python generate.py' to generate the django.po, djangojs.po and all .mo files.


I inserted the following to these files:
apps/edx/conf/lms.env.json' -> "LANGUAGE_CODE": "el",
apps/edx/conf/cms.env.json' -> "LANGUAGE_CODE": "el",
apps/edx/edx-platform/lms/envs/common.py' -> "LANGUAGE_CODE = 'el',
apps/edx/edx-platform/cms/envs/common.py' -> "LANGUAGE_CODE = 'el'


I restarted the servers.


And this procedure is working quite well for most of the translations.


The problem is for translations that are in specific views, like forum, profile, account, search that the greek translations (that exist in the .po files) do not show up.


I used the command sudo bin/python.edxapp ./manage.py lms compilejsi18n --settings=aws in cd apps/edx/edx-platform/ folder.

That is as much as I have done.

If you could point me to the right directions, I would be grateful.

Best Regards,

Kostas.

Andy Armstrong

unread,
Mar 21, 2017, 11:34:09 AM3/21/17
to openedx-t...@googlegroups.com
Hi Kostas,

The step that is missing is that you need to use the paver command to pull down the translations, as that also builds the JavaScript files:

    paver i18n_robot_pull

You can read about the recommended process here:


Thanks,

 - Andy

To unsubscribe from this group and stop receiving emails from it, send an email to openedx-translation+unsubscribe...@googlegroups.com.



--

Andy Armstrong

edX | UI Architect  | an...@edx.org  

141 Portland Street, 9th floor

Cambridge, MA 02139

http://www.edx.org

http://www.e-learn.nl/media/blogs/e-learn/edX_Logo_Col_RGB_FINAL.jpg?mtime=1336074566

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

For more options, visit https://groups.google.com/d/optout.

Anna Winklerová

unread,
Mar 22, 2017, 6:39:50 AM3/22/17
to openedx-translation
Hi Kostas,

Before I send my personal workflow for fixing language strings I must say, that with the soon to come upgrade of edX platform we will hopefully switch to transifex workflow with the robot pulls and all that. We are on dogwood still. We had troubles with the Transifex year or so ago because of very little ammount of translated strings and we chose to translate localy with the vision of pull into Transifex in the future.

I usually manage to translate and properly display most of the misterious strings, though some of them are still in english and I believe we will get rid of them after upgrade to the latest code.

1] First I localize the string in the whole cs/LC_MESSAGES directory via grep -ir "string to be found" . (mind the dot at the end)

Sometimes the string is not even there and I create it with the english original in the .po file, sometimes there is some typo like missing comma and the string does not get displayed correctly. Not all translated strings are in the djangojs file. Some are in different places. And sometimes i need to look in the the source files, usually in .../edx-platform/lms/templates/ for the correct form of the string or just to look what the heck is going on.

Then I like to run validate before generating anything: as edxapp user do
2] edxapp@myserver: ~/edx-platform$ i18n_tool validate

Then still as edxapp:
3] paver i18n_fastgenerate


Now as the superuser or simply sudo I do

4] sudo /edx/bin/python.edxapp /edx/app/edxapp/edx-platform/manage.py lms compilejsi18n --settings=aws

As edxapp again:
5] paver update_assets lms --settings=aws (this gets all the static files in the proper directories in /edx/var/edxapp/staticfiles/)


This is my special next step, becouse sth about git source stuff got wrong and studio has different static source path than LMS (yes, I know, I should be solved differently and fixed but again, I will do an upgrade soon, so ...) 

6] rsync -r --ignore-existing --include=*/ --include=*.* /edx/var/edxapp/staticfiles/js/ /edx/var/edxapp/staticfiles/4f5589e356/js



7] restart 
    sudo /edx/bin/supervisorctl restart edxapp: 
    sudo service nginx restart

8] test the page (sometimes it takes some time even after cleaning all cashes...)

Hope this works for you too. And again, beware, we are running dogwood and we will do it better way with transifex and git mirroring soon. I learned tmux to handle all the skipping from one place to another easily. I do recommend that.

Have a nice day
-- Anna

PS: Andy, my main problem with Transinfex was searching for a certain string. I can search in each .po file easily via the web interface but there are many source files and it was time consuming searching for a string in each one of them. Our goal was to translate certain strings that were most visible for students -- first the account, then course stuff, discussions. Maybe I just did not find it in Transifex, but there is no search for string in the .po directory that does for me the same as grep -ir "string to find" . on server. But we will switch to the community translations soon, moving the czech language pack forward a lot. (I believe :-)




Dne úterý 21. března 2017 15:10:17 UTC+1 Kostas Stefanou napsal(a):

Kostas Stefanou

unread,
Mar 29, 2017, 5:51:42 AM3/29/17
to openedx-translation
Dear Anna,

thank you very much for your reply.

After trying out your solution,

I found out that using the 'paver update_assets lms --settings=aws' alone solved my problem.

After running it, all translations are now in place.

The problem is that all CSS changes I had made were gone, but I found a recent backup and restored my CSS files.

I am mentioning it here, so that anyone with the same problem in the future will take a backup of their CSS in order not to lose time.

I would like to thank you again for your post.

Best Regards,

Kostas.

Anna Winklerová

unread,
Mar 29, 2017, 10:53:19 AM3/29/17
to openedx-translation
Hi Kostas,

I'm just curious, where (what folders) are you editing css styles? In the static files directory or template directories? Update assets shouldn't break stuff.

-- Anna

Dne středa 29. března 2017 11:51:42 UTC+2 Kostas Stefanou napsal(a):

Kostas Stefanou

unread,
Mar 30, 2017, 2:54:01 AM3/30/17
to openedx-translation
Dear Anna,

I am editing the CSS files in the ' staticfiles/css' directory.

Best Regards,

Kostas.

Andy Armstrong

unread,
Mar 30, 2017, 12:47:45 PM3/30/17
to openedx-t...@googlegroups.com
Hi Kostas,

The staticfiles directory is fully generated, so you should never edit files in there. As you found, they will be deleted next time you update or deploy. If you want to customize the look of your site, you should follow the theming guide:


 - Andy

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

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages