gettext_i18n_rails_js 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,7 @@
2
2
 
3
3
  (function(){
4
4
  locale = document.getElementsByTagName('html')[0].lang;
5
+
5
6
  if(!locale){
6
7
  console.warn('No locale found as an html attribute, using default.');
7
8
  return;
@@ -12,4 +13,9 @@
12
13
  window.n__ = function(){ return i18n.ngettext.apply(i18n, arguments) };
13
14
  window.ngettext = window.n__;
14
15
  window.i18n = i18n;
16
+
17
+ //adds scoping
18
+ window.s__ = function(key) {
19
+ return __(key).split('|').pop();
20
+ }
15
21
  })();
@@ -11,7 +11,7 @@ module GettextI18nRailsJs
11
11
  self.handlebars_gettext_function = '_'
12
12
 
13
13
  def self.target?(file)
14
- [/\.handlebars\Z/, /\.handlebars.erb\Z/].any? {|regexp| file.match regexp}
14
+ [/\.handlebars\Z/, /\.handlebars.erb\Z/, /\.mustache\Z/].any? {|regexp| file.match regexp}
15
15
  end
16
16
 
17
17
  # We're lazy and klumsy, so this is a regex based parser that looks for
@@ -43,7 +43,7 @@ namespace :gettext do
43
43
 
44
44
  def files_to_translate
45
45
  puts 'translate these files'
46
- Dir.glob("{app,lib,config,#{locale_path}}/**/*.{rb,erb,haml,slim,js,coffee,handlebars}")
46
+ Dir.glob("{app,lib,config,#{locale_path}}/**/*.{rb,erb,haml,slim,js,coffee,handlebars,mustache}")
47
47
  end
48
48
 
49
49
  # The parser will use this as the function basename when parsing translations.
@@ -1,3 +1,3 @@
1
1
  module GettextI18nRailsJs
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gettext_i18n_rails_js
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,14 +9,14 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-07 00:00:00.000000000 Z
12
+ date: 2015-02-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
- - - ~>
19
+ - - ! '>='
20
20
  - !ruby/object:Gem::Version
21
21
  version: 3.2.0
22
22
  type: :runtime
@@ -24,7 +24,7 @@ dependencies:
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  none: false
26
26
  requirements:
27
- - - ~>
27
+ - - ! '>='
28
28
  - !ruby/object:Gem::Version
29
29
  version: 3.2.0
30
30
  - !ruby/object:Gem::Dependency