General developer forum

Translation in context

 
Picture of David Mudrák
Re: Translation in context
Core developersDocumentation writersMoodle HQParticularly helpful MoodlersPlugin developersPlugins guardiansTestersTranslators

Hi Dashamir.

Thanks for the reminder. The in-context translation is an issue raised often in moots and other places and we started to talk about it again in the HQ. Actual work on it may be a bit challenging without wider knowledge of Moodle development, but also a good opportunity to dive into it smile

Yes, I think it is doable cleanly via a plugin (a block or admin tool should fit well). Let the plugin provide a custom string manager class to track the strings used at the page, and then the interface on the page (I would prefer JS overlay rather than the footer these days) to translate strings.

 
Average of ratings: -
Picture of Dashamir Hoxha
Re: Translation in context
 

Hi David.

I could not find enough time to jump into this issue (implementing "in-context translation" plugin). But I am thinking that maybe this can be a good project for the next GSoC.

What should I do to promote this project idea? Should I start by creating a new feature request on the tracker?

 
Average of ratings: -
Picture of David Mudrák
Re: Translation in context
Core developersDocumentation writersMoodle HQParticularly helpful MoodlersPlugin developersPlugins guardiansTestersTranslators

Should I start by creating a new feature request on the tracker?

No. You should start searching if it has been already reported smile If you can't find anything (I believe it must have been raised before), please feel encouraged to create a new one. Thanks!

 
Average of ratings: -
Picture of Dashamir Hoxha
Re: Translation in context
 

I couldn't find anything and I tried to create a new one. But the interface refused to create it saying that I should search first (why does it think that I did not search?!).

Anyway, here is the description of the feature that I tried to create:

-----------8<------------

Translation in context means that you can see where the translated string is being used, and you can correct it in place. It is very important for the accuracy of translations.

There are a couple of ways for implementing it, which are discussed here: https://moodle.org/mod/forum/discuss.php?d=347843

The most feasible one is the David's proposal to implement it by a plugin (block or admin tool) that does the following:

  1. The plugin provides a custom string manager class to track the strings used at the page (function `get_string()` could track all strings used at the current page).
  2. This list of strings and their (current) translations can be appended to the page.
  3. At the footer of the page (or on the menu) will appear a link that says "Edit translations on this page".
  4. When this link (or menu item) is clicked, an AJAX form or JS overlay should appear, which allows to edit the translations of these strings.
  5. When changes are saved, the page is refreshed and the new translations appear on it.
  6. Translation changes made over time should be able to be exported and to be uploaded to the server of translations (lang.moodle.org) for review and acceptance by language admins.

The last point can be done from the admin interface of the plugin. On the admin interface can also be a switch to enable/disable this in-context translation feature (maybe for performance reasons).

--------------->8-------------------------

Could you please create it? And feel free to make the additions/changes that you find suitable.

By the way, the organization applications for GSoC start on Jan 4 (https://developers.google.com/open-source/gsoc/timeline)

 
Average of ratings: -