Needs review
Project:
Plupload integration
Version:
6.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
6 Sep 2011 at 09:26 UTC
Updated:
6 Sep 2011 at 11:08 UTC
Sorry, don't have time for proper patch. This works for me, generally. The only problem is with proper translation of plural values. We don't have count, cause the string is completely processed by the plupload JS, so we can't use Drupal.formatPlural(). It would be great to somehow make it work without forking.
Drupal.behaviors.pluploadBuild = function (context) {
// Add translations.
plupload.addI18n({
'Select files' : Drupal.t('Select files'),
'Add files to the upload queue and click the start button.' : Drupal.t('Add files to the upload queue and click the start button.'),
'Filename' : Drupal.t('Filename'),
'Status' : Drupal.t('Status'),
'Size' : Drupal.t('Size'),
'Add files' : Drupal.t('Add files'),
'Stop current upload' : Drupal.t('Stop current upload'),
'Start uploading queue' : Drupal.t('Start uploading queue'),
'Uploaded %d/%d files': Drupal.t('Uploaded %d/%d files'),
'N/A' : Drupal.t('N/A'),
'Drag files here.' : Drupal.t('Drag files here.'),
'File extension error.': Drupal.t('File extension error.'),
'File size error.': Drupal.t('File size error.'),
'Init error.': Drupal.t('Init error.'),
'HTTP Error.': Drupal.t('HTTP Error.'),
'Security error.': Drupal.t('Security error.'),
'Generic error.': Drupal.t('Generic error.'),
'IO error.': Drupal.t('IO error.'),
'Start upload' : Drupal.t('Start upload'),
'Stop upload' : Drupal.t('Stop upload'),
'%d files queued' : Drupal.t('%d files queued'),
// These seems to be wrong based on a comment on plupload forums.
// But they won't do any harm either.
'Add Files' : Drupal.t('Add files'),
'Start Upload' : Drupal.t('Start upload'),
'Stop Upload' : Drupal.t('Stop upload')
});
// ... the rest ...
}
Comments
Comment #1
crea commentedUpdated original post.
Comment #2
crea commentedNote: Drupal won't re-parse JS files for new strings automatically, unless we clear special variable. So you need to include something like this in update_N hook:
variable_set('javascript_parsed', array());Comment #2.0
crea commentedAdded formatplural note