Lang translation tool - feature improvements

Lang translation tool - feature improvements

by David Mudrák -
Number of replies: 20
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Hi folks,

I am just working on updates of the Czech UTF lang pack during these evenings. And some small possible improvements of the lang.php translation tool came into my mind.
  • It would be nice to have submit (save page) buttons being displayed after each let us say 20 string lines, not only the one at the bottom of the page.
  • It would be fantastic if there is an HTML anchor being rendered at the position of the first missing string. So after submitting (saving) the page it could open not at the top but at the position where you should continue with translation.
I would like to discuss this with you a bit before I start to write the code (what I think is not much complicated at all).
Average of ratings: -
In reply to David Mudrák

Re: Lang translation tool - feature improvements

by Andrea Bicciolo -
Those features are interesting indeed. I would also add a feature enabling the utility to be aware of the "*_UTF8_local" languages, thus letting people to edit them.
In reply to Andrea Bicciolo

Re: Lang translation tool - feature improvements

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Yes interesting features.
I would say especially the locales are important to be able to change with the build in editor. Compare the about 100 translators with all admins over the world having a customized lang pack.
Since we are heading for a stable, I suggest keeping this for 1.7
In reply to koen roggemans

Re: Lang translation tool - feature improvements

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Yes, I agree. I am just thinking about how to enable modification of *_local lang packs in some really clever and handful way... Please join with more ideas.

Maybe there could be a button switching between "local pack mode" and "system pack mode". Once you are in _local mode, you changes (and *only* changes) are going into _local directory... thoughtful
In reply to David Mudrák

Re: Lang translation tool - feature improvements

by Mitsuhiro Yoshida -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Translators
Hi David,

I really like both of your idea.

When I'm translating Japanese UTF lang pack ( ja_utf8 ), I have to scroll down a lot to save moodle.php. And HTML anchor would lead me to translation required string much faster.

In reply to David Mudrák

Re: Lang translation tool - feature improvements

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
OK, attached you can find version of lang.php with following improvements.
  1. "go to first missing string" link can be displayed (see LANG_DISPLAY_MISSING_LINKS)
  2. "go to next missing" link can be displayed (see LANG_DISPLAY_MISSING_LINKS)
  3. submit button may be repeated (see LANG_SUBMIT_REPEAT*)
  4. added (empty) "summary" attribute for the <table>'s
lang changes screenshot

I would like to continue improving this file. Koen - may I ask you for CVS write access to this file so I could commit my changes into HEAD? Thank you,

David
In reply to David Mudrák

Re: Lang translation tool - feature improvements

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
As I do not have CVS write access still, I am attaching new version of lang.php to this post.

/**
 * CHANGES

 *
 * 2006/05/16 mudrd8mz
 * 1) LANG_DEFAULT_FILE can be now set. moodle.php used to be opened automatically.
 *    As it was (and still is) one of the biggest files it usually took a long time to load the page
 *    even if you just want to choose the file to translate.
 * 2) added links from "missing" to "compare" mode page
 * 3) english strings are now key-sorted in "missing" mode
 * 4) list of files with missing strings is now displayed at the top of "missing" page
 */

screenshot
In reply to David Mudrák

Re: Lang translation tool - feature improvements

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Attached you can find an update of lang.php with *_utf8_local support. Please, can you test it and report any bugs/requests?

This version allows administrators to translate local modification of default language pack on line. As Koen has mentioned, this is a great way how to involve hundreds of admins in translation (they can just e-mail the lang maintainer their local modification and s/he can incorporate them in standard language pack. Maybe we could automate this sharing somehow in the future...)

I have changed the color highlighting in lang.php (see the source code)
// red #ef6868 - translation missing in both system and local pack
// yellow #feff7f - translation missing in system pack but is translated in local
// green #AAFFAA - translation present in both system and local but is different

Hope you will like these improvements. Pitty I had not written them before 1.6 became beta mixed

lang-changes-screenshot3.png
In reply to David Mudrák

Re: Lang translation tool - feature improvements

by Mitsuhiro Yoshida -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Translators
Hi David,

Thank you very much for great improvements!!

I put UP and Down button on each missing strings using "pix/t/up.gif" and "pix/t/down.gif".
I hope you like this small modification (attached lang.zip). smile
In reply to Mitsuhiro Yoshida

Re: Lang translation tool - feature improvements

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Thank you, Mitsuhiro! I will check it out as soon as I get back to my notebook.
In reply to David Mudrák

Re: Lang translation tool - feature improvements

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Hi David,

Sorry, missed this tread, but you're right about the 1.6 beta.
It can go to 1.7. This is not a problem for translators, since I believe most of them use head to translate.

Thanks for your effort on improving the language tool.
In reply to koen roggemans

Re: Lang translation tool - feature improvements

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
>since I believe most of them use head to translate

I believe they use brain as well. Funny this computer slang, isn't it? big grin

Koen, is there a way how to get write-access rights for admin/lang.php in CVS? I already have got access for langdoc.php but as MartinD has stopped using his (too much) known e-mail I do not know where to ask for this . Thank you for any info.
In reply to David Mudrák

Re: Lang translation tool - feature improvements

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi David,

Thanks for your feature improvements. approve Please note that they are now in the bug tracker/feature request store - bug 5570.
In reply to Helen Foster

Re: Lang translation tool - feature improvements - commited

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
The code is now commited in CVS as cvs:/admin/lang.php in revision 1.66. The file needs more testing by admins/translators and then the bug may be closed. I have set the "To be Closed in Version" to 1.7 dev and "Status" to Resolved.

Thank you all for your ideas and posts!

David
In reply to David Mudrák

Re: Lang translation tool - feature improvements

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Hi all using new admin/lang.php

Please let me know - shall I ask maintainers for merging this new tool into 1.6.1 release? Is it stable enough now? Thanks for any comments

David
In reply to David Mudrák

Re: Lang translation tool - feature improvements

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
Works very well for me David. Thanks a lot for the improvements.
In reply to David Mudrák

Re: Lang translation tool - feature improvements

by Mitsuhiro Yoshida -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Translators
Hi David,

admin/lang.php is stable enough for me and it's very easy to use. smile
In reply to David Mudrák

Re: Lang translation tool - feature improvements

by Tim Allen -
Not sure if it is just me but the latest fix for editing en_utf8_local doesn't seem to be working for me on Moodle 1.6 stable.

I haven't tested it on HEAD, maybe it works ok there.

I wanted to implement it in 1.6 because of a question in another thread.

Tim.
In reply to David Mudrák

Re: Lang translation tool - feature improvements

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
The improved lang.php was approved by MartinD and it has just been commited to MOODLE_16_STABLE. Thank you all for your testing and bug reporting. As a reward for your cooperation please have a piece of attached Czech cake wink
Attachment cake.jpeg
In reply to David Mudrák

Re: Lang translation tool - feature improvements

by Mitsuhiro Yoshida -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Translators
Congratirations on your committing, David!
If I had meet this lang.php, I would have spent more less time for translation. smile