i18nizer 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,8 @@ module ActionView
3
3
  module TranslationHelper
4
4
  def translate(key, options = {})
5
5
  options[:raise] = true
6
- content_tag('span', I18n.translate(key, options), :class => 'translated_text')
6
+ #content_tag('span', I18n.translate(key, options), :class => 'translated_text')
7
+ "{{__#{key}__}}"
7
8
  rescue I18n::MissingTranslationData => e
8
9
  keys = I18n.send(:normalize_translation_keys, e.locale, e.key, e.options[:scope])
9
10
  content_tag('span', keys.join(', '), :class => 'translation_missing')
@@ -1,3 +1,3 @@
1
1
  module I18nizer
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -0,0 +1,12 @@
1
+ function add_translate_class() {
2
+ $(':not(:has(*))').each(function(){
3
+ if ( $(this).html().match(/^{{__*.*__}}$/)){
4
+ $(this).addClass('translate_text').html(
5
+ $(this).html().match(/[a-zA-Z]{1,}(\_|\.)?[a-zA-Z]{1,}/)[0])
6
+ }
7
+ })
8
+ }
9
+
10
+ $(document).ready(function(){
11
+ add_translate_class();
12
+ });
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18nizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -27,6 +27,7 @@ files:
27
27
  - lib/i18nizer.rb
28
28
  - lib/i18nizer/i18n_override.rb
29
29
  - lib/i18nizer/version.rb
30
+ - vendor/assets/javascripts/i18nizer/pattern_matcher.js
30
31
  homepage: ''
31
32
  licenses: []
32
33
  post_install_message: