i18n-js 3.0.5 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/.travis.yml +3 -0
 - data/CHANGELOG.md +10 -1
 - data/lib/i18n/js.rb +4 -3
 - data/lib/i18n/js/engine.rb +7 -0
 - data/lib/i18n/js/version.rb +1 -1
 - data/spec/ruby/i18n/js_spec.rb +1 -1
 - data/spec/spec_helper.rb +1 -1
 - metadata +3 -3
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 8876b958725c3fb0670a31a6ff1c2b25d697db8d2842acb142c86ca8df46fbe0
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 7ba32802400ef2e9ab4a9d07afd2b7eadba47f60e087bdf6de441f29204f183e
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: d90c6639b712a323d5471cbfdb0bec2ebdffd50f3f78cb2ca30d2d59c3b4cf03592af83f8d6471837e05ab1aa20526a73b440ac1587b42dcd826d322bb2c8e1f
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 0cddfd47ca93dafcdd02ce304011c9388bc8d7e075a957a9b24a98edcb7a60202efad1266080c3d9721925d274441d4ae372f5be8b9f8be23d3e0237a4b53212
         
     | 
    
        data/.travis.yml
    CHANGED
    
    
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -18,6 +18,14 @@ This project adheres to [Semantic Versioning](http://semver.org/). 
     | 
|
| 
       18 
18 
     | 
    
         
             
            - Nothing
         
     | 
| 
       19 
19 
     | 
    
         | 
| 
       20 
20 
     | 
    
         | 
| 
      
 21 
     | 
    
         
            +
            ## [3.0.6] - 2018-05-30
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
            ### Fixed
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
      
 25 
     | 
    
         
            +
            - [Ruby] Make JS `i18n/filtered` depends on i18n-js config too
         
     | 
| 
      
 26 
     | 
    
         
            +
              (PR: https://github.com/fnando/i18n-js/pull/497)
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
             
     | 
| 
       21 
29 
     | 
    
         
             
            ## [3.0.5] - 2018-02-26
         
     | 
| 
       22 
30 
     | 
    
         | 
| 
       23 
31 
     | 
    
         
             
            ### Changed
         
     | 
| 
         @@ -286,7 +294,8 @@ And today is not April Fools' Day 
     | 
|
| 
       286 
294 
     | 
    
         | 
| 
       287 
295 
     | 
    
         | 
| 
       288 
296 
     | 
    
         | 
| 
       289 
     | 
    
         
            -
            [Unreleased]: https://github.com/fnando/i18n-js/compare/v3.0. 
     | 
| 
      
 297 
     | 
    
         
            +
            [Unreleased]: https://github.com/fnando/i18n-js/compare/v3.0.6...HEAD
         
     | 
| 
      
 298 
     | 
    
         
            +
            [3.0.6]:      https://github.com/fnando/i18n-js/compare/v3.0.5...v3.0.6
         
     | 
| 
       290 
299 
     | 
    
         
             
            [3.0.5]:      https://github.com/fnando/i18n-js/compare/v3.0.4...v3.0.5
         
     | 
| 
       291 
300 
     | 
    
         
             
            [3.0.4]:      https://github.com/fnando/i18n-js/compare/v3.0.3...v3.0.4
         
     | 
| 
       292 
301 
     | 
    
         
             
            [3.0.3]:      https://github.com/fnando/i18n-js/compare/v3.0.2...v3.0.3
         
     | 
    
        data/lib/i18n/js.rb
    CHANGED
    
    | 
         @@ -89,7 +89,7 @@ module I18n 
     | 
|
| 
       89 
89 
     | 
    
         
             
                end
         
     | 
| 
       90 
90 
     | 
    
         | 
| 
       91 
91 
     | 
    
         
             
                def self.translation_segments
         
     | 
| 
       92 
     | 
    
         
            -
                  if  
     | 
| 
      
 92 
     | 
    
         
            +
                  if config_file_exists? && config[:translations]
         
     | 
| 
       93 
93 
     | 
    
         
             
                    configured_segments
         
     | 
| 
       94 
94 
     | 
    
         
             
                  else
         
     | 
| 
       95 
95 
     | 
    
         
             
                    [Segment.new("#{DEFAULT_EXPORT_DIR_PATH}/translations.js", translations)]
         
     | 
| 
         @@ -99,7 +99,7 @@ module I18n 
     | 
|
| 
       99 
99 
     | 
    
         
             
                # Load configuration file for partial exporting and
         
     | 
| 
       100 
100 
     | 
    
         
             
                # custom output directory
         
     | 
| 
       101 
101 
     | 
    
         
             
                def self.config
         
     | 
| 
       102 
     | 
    
         
            -
                  if  
     | 
| 
      
 102 
     | 
    
         
            +
                  if config_file_exists?
         
     | 
| 
       103 
103 
     | 
    
         
             
                    erb_result_from_yaml_file = ERB.new(File.read(config_file_path)).result
         
     | 
| 
       104 
104 
     | 
    
         
             
                    Private::HashWithSymbolKeys.new(
         
     | 
| 
       105 
105 
     | 
    
         
             
                      (::YAML.load(erb_result_from_yaml_file) || {})
         
     | 
| 
         @@ -109,8 +109,9 @@ module I18n 
     | 
|
| 
       109 
109 
     | 
    
         
             
                  end.freeze
         
     | 
| 
       110 
110 
     | 
    
         
             
                end
         
     | 
| 
       111 
111 
     | 
    
         | 
| 
      
 112 
     | 
    
         
            +
                # @api private
         
     | 
| 
       112 
113 
     | 
    
         
             
                # Check if configuration file exist
         
     | 
| 
       113 
     | 
    
         
            -
                def self. 
     | 
| 
      
 114 
     | 
    
         
            +
                def self.config_file_exists?
         
     | 
| 
       114 
115 
     | 
    
         
             
                  File.file? config_file_path
         
     | 
| 
       115 
116 
     | 
    
         
             
                end
         
     | 
| 
       116 
117 
     | 
    
         | 
    
        data/lib/i18n/js/engine.rb
    CHANGED
    
    | 
         @@ -60,6 +60,13 @@ module I18n 
     | 
|
| 
       60 
60 
     | 
    
         
             
                  def self.run(filename, source, context)
         
     | 
| 
       61 
61 
     | 
    
         
             
                    if context.logical_path == "i18n/filtered"
         
     | 
| 
       62 
62 
     | 
    
         
             
                      ::I18n.load_path.each { |path| context.depend_on(File.expand_path(path)) }
         
     | 
| 
      
 63 
     | 
    
         
            +
             
     | 
| 
      
 64 
     | 
    
         
            +
                      # Absolute path is required or
         
     | 
| 
      
 65 
     | 
    
         
            +
                      # Sprockets assumes it's a logical path
         
     | 
| 
      
 66 
     | 
    
         
            +
                      #
         
     | 
| 
      
 67 
     | 
    
         
            +
                      # Also it's fine to depend on an absent file
         
     | 
| 
      
 68 
     | 
    
         
            +
                      # Sprocket will ignore paths of absent files
         
     | 
| 
      
 69 
     | 
    
         
            +
                      context.depend_on(File.expand_path(I18n::JS.config_file_path))
         
     | 
| 
       63 
70 
     | 
    
         
             
                    end
         
     | 
| 
       64 
71 
     | 
    
         | 
| 
       65 
72 
     | 
    
         
             
                    source
         
     | 
    
        data/lib/i18n/js/version.rb
    CHANGED
    
    
    
        data/spec/ruby/i18n/js_spec.rb
    CHANGED
    
    
    
        data/spec/spec_helper.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: i18n-js
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 3.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 3.0.6
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Nando Vieira
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2018- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2018-05-30 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: i18n
         
     | 
| 
         @@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       199 
199 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       200 
200 
     | 
    
         
             
            requirements: []
         
     | 
| 
       201 
201 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       202 
     | 
    
         
            -
            rubygems_version: 2.7. 
     | 
| 
      
 202 
     | 
    
         
            +
            rubygems_version: 2.7.7
         
     | 
| 
       203 
203 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       204 
204 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       205 
205 
     | 
    
         
             
            summary: It's a small library to provide the Rails I18n translations on the Javascript.
         
     |