diff --git a/js/i18n.js b/js/i18n.js new file mode 100644 index 0000000..251a8b7 --- /dev/null +++ b/js/i18n.js @@ -0,0 +1,29 @@ +/** + * @file + * Localization file for Plupload's strings. + */ + +// 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") +}); diff --git a/plupload.module b/plupload.module index a37a62a..8b75c90 100644 --- a/plupload.module +++ b/plupload.module @@ -278,6 +278,12 @@ function plupload_library() { ))), ), ); + + if (module_exists('locale')) { + $module_path = drupal_get_path('module', 'plupload'); + $libraries['plupload']['js'][$module_path . '/js/i18n.js'] = array('scope' => 'footer'); + } + return $libraries; }