This patch includes a mix of features ported from the 5.x branch of the module:

Some visible ones:

  • A new page with a pair tabs to compile translated and untranslated strings so translators can use these pages to find *all* untranslated strings, or review translated ones (They're added to the list and they can be translated/edited using the l10n js UI) See screenshot.
  • All the strings stored for the current path (location) are also added to the list. This is useful when some strings are only displayed for some user roles or under certain conditions

These two features are useful because with the current version, translators cannot translate strings that are on pages they cannot reach or that they cannot see because of permission issues.

Then there are also some 'hidden' features that may be used by other modules:

  • Any other module can add strings to the list to be translated using a global variable (which is also used for the first feature above). This is already working with i18n 5.x-3-dev, which allows translation of user defined strings and will be available on i18n 6.x soon.
  • Additional 'textgroups' support for the translation page. This was not on the 5.x version (Drupal 5 doesn't have them) but was needed for this one so the page doesn't allow messing with other textgroups defined by other modules. This module will only use the 'default' textgroup, but the translation page can be reused by other modules for other textgroups.

Attached screenshot of the new translation page this patch adds.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Gábor Hojtsy’s picture

Status: Needs review » Fixed
FileSize
10.21 KB

I've looked into this patch, and submitted a slightly modified version.

- Added more phpdoc comments.
- Renamed a few variables for easier recognition.
- Added real headers to the translation tables, so people see what is visible there.
- Introduced l10_client_add_string_to_page() instead the global variable for nicer code.

I'd like to add that the translation page provided by this module now is very similar to the built-in locale module interface to some degree. That allows to look for translated/untranslated stuff and also look in different textgroups. That however also includes a search feature. It would be great to have a complete replacement for this page, and eventually, get Drupal 7 to have a much more powerful search feature so we don't need to replicate it.

In this implementation for example, the translation page uses a pager, so the live search is only effective on the same page. If we do an autocomplete search on the webpage itself which would look into all strings, that would speed up looking for actual strings a lot. I think it would be great to do quick prototyping of these features here, and get them quick into Drupal 7.

Let me know if any of my improvements in this patch are unacceptable for your use cases. Thanks for the suggestions!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

Jose Reyero’s picture

Hey Gabbor, thanks, I had missed this commit.

This should work fine but for one detail, I need to add strings to groups different than 'default', I'll follow up with another patch in a new thread.