I found that some strings are not properly added with Drupal.t() to locales_source table like through t() function. E.g. line 95 in draft.js

$('.draft_save .title').html(Drupal.t('Draft with Draft ID ' + draft_id + ' has been saved successfully'));

or line 134 in draft.module

drupal_add_js('$(document).ready(function() { $(".draft_save .title").html(Drupal.t("Populating Draft form")).parent().slideDown(); setTimeout(Drupal.draft.populateForm, 2000); });', 'inline');

Didn't find the way how to translate these strings. Any suggestions for that?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

boreg’s picture

Someone should really notice this issue. It's essential if you want to use Draft within other languages. Really no suggestion?

darren.ferguson’s picture

You can check with the core translation team they might have ideas since it is using the drupal translation as it was asked for. Maybe it is not being used correctly in draft but to my knowledge this was how to translate via JavaScript.

lotyrin’s picture

sub

lotyrin’s picture

Status: Active » Needs review
FileSize
1.81 KB

Locale doesn't know to look for Drupal.t() in .module files. Besides, all of the other messages were already out in draft.js. For consistency I moved it, so it is now working properly. I also added the ellipsis, since the other messages of this type use this pattern.

For the other string, you can't translate a dynamic string, you have to use t()'s replacement if the string is at all dynamic.

The module should now be able to be localized properly.

darren.ferguson’s picture

Status: Needs review » Needs work

You have removed the timeout on the draft.populateform which was put in place because if people are on a slow connection the WSYWIG component would not be available since it would still be downloading all of its components. The 2 seconds was there as a stop gap to make sure the javascript for the WSYWIG component actually was run. Other than that it looked okay, if that was re-added i think the patch could be added too the module.

lotyrin’s picture

Status: Needs work » Needs review
FileSize
1.82 KB

Attempting to provide a new patch without the accidentally removed timeout, but Drupal.org seems to be having file attachment problems. I'll cross my fingers.