From 2c7c2ab1f5201f9da1f504dfa67ebaad580877bb Mon Sep 17 00:00:00 2001
From: Caio SBA <caiosba@gmail.com>
Date: Fri, 20 Jan 2012 17:17:08 -0300
Subject: [PATCH] Load i18n file

---
 plupload.module |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/plupload.module b/plupload.module
index 6dba8cd..8dcf5a6 100644
--- a/plupload.module
+++ b/plupload.module
@@ -406,8 +406,13 @@ function plupload_theme($existing, $type, $theme, $path) {
  * Theme function to return the uploader. (Once JS has it's way with it.) 
  */
 function theme_plupload_uploader() {
+  global $language;
   $path = drupal_get_path('module', 'plupload');
   drupal_add_css($path.'/plupload.css');
   drupal_add_js($path .'/plupload.js');
+  $lang_file = 'sites/all/libraries/plupload/js/i18n/'.$language->language.'.js';
+  if (file_exists($lang_file)) { 
+    drupal_add_js($lang_file);
+  }
   return '<div id="uploader">Your browser does not support HTML5 native or flash upload. Try Firefox 3, Safari 4, or Chrome; or install Flash.</div>';
 }
-- 
1.7.2.5

