Permalink
Browse files

Merge branch 'master' of https://github.com/gnagno/lost_i18n_translation

  • Loading branch information...
2 parents 95f6086 + 83d18ca commit 4ac068af51f0730d22a949b51770f3a58e843c47 @gnagno committed Jul 23, 2011
View
@@ -19,6 +19,7 @@ gem 'uglifier'
gem 'execjs'
gem 'jquery-rails'
gem 'sass-rails'
+gem "i18n-js", :git => "https://github.com/fnando/i18n-js.git"
if RUBY_VERSION < '1.9'
gem "ruby-debug", ">= 0.10.3"
View
@@ -1,3 +1,10 @@
+GIT
+ remote: https://github.com/fnando/i18n-js.git
+ revision: c560abc4b52d28fe4839cc95421430ebfc4c0a69
+ specs:
+ i18n-js (1.0.2)
+ i18n
+
GEM
remote: http://rubygems.org/
specs:
@@ -167,6 +174,7 @@ DEPENDENCIES
database_cleaner
execjs
factory_girl_rails (~> 1.1.beta1)
+ i18n-js!
jquery-rails
launchy
rails (= 3.1.0.rc4)
@@ -1,17 +1,23 @@
$(document).ready(function() {
+ //FIXME: find a way to set these dynamically
+ I18n.defaultLocale = "en";
+ I18n.locale = "en";
+
var $translation_missing_count = $('.translation_missing').length;
var $translation_present_count = $('.translation_present').length;
var $newdiv = $('<div id="lost-i18n-translation-div"/>');
+ var sep = " | "
+ $newdiv.append("Current locale : " + I18n.currentLocale() + sep);
var $tr_missing = $('<span id="lost-i18n-translation-tr-missing-count" />');
- $tr_missing.append( $translation_missing_count );
- $newdiv.append("Missing translations: " , $tr_missing );
-
+ $tr_missing.append( $translation_missing_count + sep);
+ $newdiv.append(I18n.t("lost_i18n_translation.missing_label") + ": " , $tr_missing);
+
var $tr_present = $('<span id="lost-i18n-translation-tr-present-count" />');
$tr_present.append( $translation_present_count );
- $newdiv.append("Present translations: ", $tr_present );
+ $newdiv.append(I18n.t("lost_i18n_translation.present_label") + ": ", $tr_present);
$('body').append($newdiv);
});
View
@@ -0,0 +1,4 @@
+# Find more details about this configuration file at http://github.com/fnando/i18n-js
+translations:
+ - file: "public/javascripts/translations.js"
+ only: "*"
@@ -0,0 +1,4 @@
+en:
+ lost_i18n_translation:
+ missing_label: "Missing translations"
+ present_label: "Present translations"
@@ -8,3 +8,5 @@
//= require jquery_ujs
//= require_tree .
//= require lost-i18n-translation
+//= require i18n
+//= require translations
@@ -1,3 +1,9 @@
class ApplicationController < ActionController::Base
protect_from_forgery
+ before_filter :export_i18n_messages
+
+ private
+ def export_i18n_messages
+ SimplesIdeias::I18n.export! if Rails.env.development?
+ end
end
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 4ac068a

Please sign in to comment.