i18n-js 3.2.1 → 4.2.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +4 -0
  3. data/.github/FUNDING.yml +3 -0
  4. data/.github/ISSUE_TEMPLATE/bug_report.md +41 -0
  5. data/.github/ISSUE_TEMPLATE/config.yml +5 -0
  6. data/.github/ISSUE_TEMPLATE/feature_request.md +23 -0
  7. data/.github/PULL_REQUEST_TEMPLATE.md +38 -0
  8. data/.github/dependabot.yml +15 -0
  9. data/.github/workflows/ruby-tests.yml +73 -0
  10. data/.gitignore +13 -7
  11. data/.rubocop.yml +19 -0
  12. data/CHANGELOG.md +45 -386
  13. data/CODE_OF_CONDUCT.md +74 -0
  14. data/CONTRIBUTING.md +79 -0
  15. data/Gemfile +3 -0
  16. data/LICENSE.md +20 -0
  17. data/MIGRATING_FROM_V3_TO_V4.md +191 -0
  18. data/README.md +439 -791
  19. data/Rakefile +10 -20
  20. data/bin/release +81 -0
  21. data/exe/i18n +5 -0
  22. data/i18n-js.gemspec +51 -29
  23. data/lib/guard/i18n-js/templates/Guardfile +10 -0
  24. data/lib/guard/i18n-js/version.rb +13 -0
  25. data/lib/guard/i18n-js.rb +95 -0
  26. data/lib/i18n-js/clean_hash.rb +13 -0
  27. data/lib/i18n-js/cli/check_command.rb +17 -0
  28. data/lib/i18n-js/cli/command.rb +79 -0
  29. data/lib/i18n-js/cli/export_command.rb +95 -0
  30. data/lib/i18n-js/cli/init_command.rb +52 -0
  31. data/lib/i18n-js/cli/lint_scripts_command.rb +157 -0
  32. data/lib/i18n-js/cli/lint_translations_command.rb +155 -0
  33. data/lib/i18n-js/cli/plugins_command.rb +67 -0
  34. data/lib/i18n-js/cli/ui.rb +64 -0
  35. data/lib/i18n-js/cli/version_command.rb +18 -0
  36. data/lib/i18n-js/cli.rb +66 -0
  37. data/lib/i18n-js/embed_fallback_translations_plugin.rb +70 -0
  38. data/lib/i18n-js/export_files_plugin.rb +103 -0
  39. data/lib/i18n-js/lint.js +150645 -0
  40. data/lib/i18n-js/lint.ts +196 -0
  41. data/lib/i18n-js/listen.rb +96 -0
  42. data/lib/i18n-js/plugin.rb +103 -0
  43. data/lib/i18n-js/schema.rb +216 -0
  44. data/lib/i18n-js/sort_hash.rb +12 -0
  45. data/lib/i18n-js/version.rb +5 -0
  46. data/lib/i18n-js.rb +107 -1
  47. data/package.json +5 -20
  48. metadata +153 -181
  49. data/.editorconfig +0 -24
  50. data/.npmignore +0 -27
  51. data/.travis.yml +0 -36
  52. data/Appraisals +0 -32
  53. data/app/assets/javascripts/i18n/filtered.js.erb +0 -23
  54. data/app/assets/javascripts/i18n/shims.js +0 -208
  55. data/app/assets/javascripts/i18n/translations.js +0 -3
  56. data/app/assets/javascripts/i18n.js +0 -1077
  57. data/gemfiles/i18n_0_6.gemfile +0 -7
  58. data/gemfiles/i18n_0_7.gemfile +0 -7
  59. data/gemfiles/i18n_0_8.gemfile +0 -7
  60. data/gemfiles/i18n_0_9.gemfile +0 -7
  61. data/gemfiles/i18n_1_0.gemfile +0 -7
  62. data/gemfiles/i18n_1_1.gemfile +0 -7
  63. data/gemfiles/i18n_1_2.gemfile +0 -7
  64. data/gemfiles/i18n_1_3.gemfile +0 -7
  65. data/gemfiles/i18n_1_4.gemfile +0 -7
  66. data/gemfiles/i18n_1_5.gemfile +0 -7
  67. data/lib/i18n/js/dependencies.rb +0 -59
  68. data/lib/i18n/js/engine.rb +0 -87
  69. data/lib/i18n/js/fallback_locales.rb +0 -70
  70. data/lib/i18n/js/formatters/base.rb +0 -23
  71. data/lib/i18n/js/formatters/js.rb +0 -31
  72. data/lib/i18n/js/formatters/json.rb +0 -13
  73. data/lib/i18n/js/middleware.rb +0 -82
  74. data/lib/i18n/js/private/hash_with_symbol_keys.rb +0 -36
  75. data/lib/i18n/js/segment.rb +0 -75
  76. data/lib/i18n/js/utils.rb +0 -65
  77. data/lib/i18n/js/version.rb +0 -7
  78. data/lib/i18n/js.rb +0 -259
  79. data/lib/rails/generators/i18n/js/config/config_generator.rb +0 -19
  80. data/lib/rails/generators/i18n/js/config/templates/i18n-js.yml +0 -27
  81. data/lib/tasks/export.rake +0 -8
  82. data/spec/fixtures/custom_path.yml +0 -5
  83. data/spec/fixtures/default.yml +0 -5
  84. data/spec/fixtures/erb.yml +0 -5
  85. data/spec/fixtures/except_condition.yml +0 -7
  86. data/spec/fixtures/js_export_dir_custom.yml +0 -7
  87. data/spec/fixtures/js_export_dir_none.yml +0 -6
  88. data/spec/fixtures/js_extend_parent.yml +0 -6
  89. data/spec/fixtures/js_extend_segment.yml +0 -6
  90. data/spec/fixtures/js_file_per_locale.yml +0 -7
  91. data/spec/fixtures/js_file_per_locale_with_fallbacks_as_default_locale_symbol.yml +0 -4
  92. data/spec/fixtures/js_file_per_locale_with_fallbacks_as_hash.yml +0 -6
  93. data/spec/fixtures/js_file_per_locale_with_fallbacks_as_locale.yml +0 -4
  94. data/spec/fixtures/js_file_per_locale_with_fallbacks_as_locale_without_fallback_translations.yml +0 -4
  95. data/spec/fixtures/js_file_per_locale_with_fallbacks_enabled.yml +0 -4
  96. data/spec/fixtures/js_file_per_locale_without_fallbacks.yml +0 -4
  97. data/spec/fixtures/js_file_with_namespace_and_pretty_print.yml +0 -7
  98. data/spec/fixtures/js_sort_translation_keys_false.yml +0 -6
  99. data/spec/fixtures/js_sort_translation_keys_true.yml +0 -6
  100. data/spec/fixtures/json_only.yml +0 -18
  101. data/spec/fixtures/locales.yml +0 -95
  102. data/spec/fixtures/merge_plurals.yml +0 -6
  103. data/spec/fixtures/multiple_conditions.yml +0 -7
  104. data/spec/fixtures/multiple_conditions_per_locale.yml +0 -7
  105. data/spec/fixtures/multiple_files.yml +0 -7
  106. data/spec/fixtures/no_config.yml +0 -2
  107. data/spec/fixtures/no_scope.yml +0 -4
  108. data/spec/fixtures/simple_scope.yml +0 -5
  109. data/spec/js/currency.spec.js +0 -62
  110. data/spec/js/current_locale.spec.js +0 -19
  111. data/spec/js/dates.spec.js +0 -265
  112. data/spec/js/defaults.spec.js +0 -31
  113. data/spec/js/extend.spec.js +0 -110
  114. data/spec/js/interpolation.spec.js +0 -124
  115. data/spec/js/jasmine/MIT.LICENSE +0 -20
  116. data/spec/js/jasmine/jasmine-html.js +0 -190
  117. data/spec/js/jasmine/jasmine.css +0 -166
  118. data/spec/js/jasmine/jasmine.js +0 -2476
  119. data/spec/js/jasmine/jasmine_favicon.png +0 -0
  120. data/spec/js/locales.spec.js +0 -31
  121. data/spec/js/localization.spec.js +0 -48
  122. data/spec/js/numbers.spec.js +0 -170
  123. data/spec/js/placeholder.spec.js +0 -24
  124. data/spec/js/pluralization.spec.js +0 -211
  125. data/spec/js/prepare_options.spec.js +0 -41
  126. data/spec/js/require.js +0 -2083
  127. data/spec/js/specs.html +0 -49
  128. data/spec/js/specs_requirejs.html +0 -72
  129. data/spec/js/translate.spec.js +0 -284
  130. data/spec/js/translations.js +0 -163
  131. data/spec/js/utility_functions.spec.js +0 -20
  132. data/spec/ruby/i18n/js/fallback_locales_spec.rb +0 -84
  133. data/spec/ruby/i18n/js/segment_spec.rb +0 -219
  134. data/spec/ruby/i18n/js/utils_spec.rb +0 -106
  135. data/spec/ruby/i18n/js_spec.rb +0 -663
  136. data/spec/spec_helper.rb +0 -79
  137. data/yarn.lock +0 -131
data/lib/i18n-js.rb CHANGED
@@ -1 +1,107 @@
1
- require "i18n/js"
1
+ # frozen_string_literal: true
2
+
3
+ require "i18n"
4
+ require "json"
5
+ require "yaml"
6
+ require "glob"
7
+ require "fileutils"
8
+ require "optparse"
9
+ require "erb"
10
+ require "set"
11
+ require "digest/md5"
12
+
13
+ require_relative "i18n-js/schema"
14
+ require_relative "i18n-js/version"
15
+ require_relative "i18n-js/plugin"
16
+ require_relative "i18n-js/sort_hash"
17
+ require_relative "i18n-js/clean_hash"
18
+
19
+ module I18nJS
20
+ MissingConfigError = Class.new(StandardError)
21
+
22
+ def self.call(config_file: nil, config: nil)
23
+ if !config_file && !config
24
+ raise MissingConfigError,
25
+ "you must set either `config_file` or `config`"
26
+ end
27
+
28
+ config = Glob::SymbolizeKeys.call(config || load_config_file(config_file))
29
+
30
+ load_plugins!
31
+ initialize_plugins!(config: config)
32
+ Schema.validate!(config)
33
+
34
+ exported_files = []
35
+
36
+ config[:translations].each {|group| exported_files += export_group(group) }
37
+
38
+ plugins.each do |plugin|
39
+ plugin.after_export(files: exported_files.dup) if plugin.enabled?
40
+ end
41
+
42
+ exported_files
43
+ end
44
+
45
+ def self.export_group(group)
46
+ filtered_translations = Glob.filter(translations, group[:patterns])
47
+ filtered_translations =
48
+ plugins.reduce(filtered_translations) do |buffer, plugin|
49
+ if plugin.enabled?
50
+ plugin.transform(translations: buffer)
51
+ else
52
+ buffer
53
+ end
54
+ end
55
+
56
+ filtered_translations = sort_hash(clean_hash(filtered_translations))
57
+ output_file_path = File.expand_path(group[:file])
58
+ exported_files = []
59
+
60
+ if output_file_path.include?(":locale")
61
+ filtered_translations.each_key do |locale|
62
+ locale_file_path = output_file_path.gsub(/:locale/, locale.to_s)
63
+ exported_files << write_file(locale_file_path,
64
+ locale => filtered_translations[locale])
65
+ end
66
+ else
67
+ exported_files << write_file(output_file_path, filtered_translations)
68
+ end
69
+
70
+ exported_files
71
+ end
72
+
73
+ def self.write_file(file_path, translations)
74
+ FileUtils.mkdir_p(File.dirname(file_path))
75
+
76
+ contents = ::JSON.pretty_generate(translations)
77
+ digest = Digest::MD5.hexdigest(contents)
78
+ file_path = file_path.gsub(/:digest/, digest)
79
+
80
+ # Don't rewrite the file if it already exists and has the same content.
81
+ # It helps the asset pipeline or webpack understand that file wasn't
82
+ # changed.
83
+ if File.exist?(file_path) && File.read(file_path) == contents
84
+ return file_path
85
+ end
86
+
87
+ File.open(file_path, "w") do |file|
88
+ file << contents
89
+ end
90
+
91
+ file_path
92
+ end
93
+
94
+ def self.translations
95
+ ::I18n.backend.instance_eval do
96
+ has_been_initialized_before =
97
+ respond_to?(:initialized?, true) && initialized?
98
+ init_translations unless has_been_initialized_before
99
+ translations
100
+ end
101
+ end
102
+
103
+ def self.load_config_file(config_file)
104
+ erb = ERB.new(File.read(config_file))
105
+ YAML.safe_load(erb.result(binding))
106
+ end
107
+ end
data/package.json CHANGED
@@ -1,25 +1,10 @@
1
1
  {
2
- "name": "i18n-js",
3
- "version": "3.2.1",
4
- "description": "A javascript library similar to Ruby on Rails i18n gem",
5
- "author": "Nando Vieira",
6
- "license": "MIT",
7
- "keywords": [
8
- "i18n"
9
- ],
10
- "devDependencies": {
11
- "jasmine-node": "^1.14.5"
2
+ "dependencies": {
3
+ "esbuild": "^0.16.2",
4
+ "glob": "^8.0.3",
5
+ "typescript": "^4.9.4"
12
6
  },
13
- "main": "app/assets/javascripts/i18n.js",
14
7
  "scripts": {
15
- "test": "./node_modules/.bin/jasmine-node spec/js"
16
- },
17
- "homepage": "https://github.com/fnando/i18n-js",
18
- "bugs": {
19
- "url": "https://github.com/fnando/i18n-js/issues"
20
- },
21
- "repository": {
22
- "type": "git",
23
- "url": "https://github.com/fnando/i18n-js.git"
8
+ "compile": "esbuild lib/i18n-js/lint.ts --bundle --platform=node --outfile=lib/i18n-js/lint.js --target=node16"
24
9
  }
25
10
  }
metadata CHANGED
@@ -1,208 +1,235 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n-js
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.1
4
+ version: 4.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
8
- autorequire:
9
- bindir: bin
8
+ autorequire:
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-22 00:00:00.000000000 Z
11
+ date: 2022-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: glob
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.4.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.4.0
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: i18n
15
29
  requirement: !ruby/object:Gem::Requirement
16
30
  requirements:
17
31
  - - ">="
18
32
  - !ruby/object:Gem::Version
19
- version: 0.6.6
33
+ version: '0'
20
34
  type: :runtime
21
35
  prerelease: false
22
36
  version_requirements: !ruby/object:Gem::Requirement
23
37
  requirements:
24
38
  - - ">="
25
39
  - !ruby/object:Gem::Version
26
- version: 0.6.6
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
- name: appraisal
42
+ name: activesupport
29
43
  requirement: !ruby/object:Gem::Requirement
30
44
  requirements:
31
- - - "~>"
45
+ - - ">="
32
46
  - !ruby/object:Gem::Version
33
- version: '2.0'
47
+ version: '0'
34
48
  type: :development
35
49
  prerelease: false
36
50
  version_requirements: !ruby/object:Gem::Requirement
37
51
  requirements:
38
- - - "~>"
52
+ - - ">="
39
53
  - !ruby/object:Gem::Version
40
- version: '2.0'
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
- name: rspec
56
+ name: minitest
43
57
  requirement: !ruby/object:Gem::Requirement
44
58
  requirements:
45
- - - "~>"
59
+ - - ">="
46
60
  - !ruby/object:Gem::Version
47
- version: '3.0'
61
+ version: '0'
48
62
  type: :development
49
63
  prerelease: false
50
64
  version_requirements: !ruby/object:Gem::Requirement
51
65
  requirements:
52
- - - "~>"
66
+ - - ">="
53
67
  - !ruby/object:Gem::Version
54
- version: '3.0'
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest-utils
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: mocha
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: pry-meta
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
55
111
  - !ruby/object:Gem::Dependency
56
112
  name: rake
57
113
  requirement: !ruby/object:Gem::Requirement
58
114
  requirements:
59
- - - "~>"
115
+ - - ">="
60
116
  - !ruby/object:Gem::Version
61
- version: '12.0'
117
+ version: '0'
62
118
  type: :development
63
119
  prerelease: false
64
120
  version_requirements: !ruby/object:Gem::Requirement
65
121
  requirements:
66
- - - "~>"
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
67
137
  - !ruby/object:Gem::Version
68
- version: '12.0'
138
+ version: '0'
69
139
  - !ruby/object:Gem::Dependency
70
- name: gem-release
140
+ name: rubocop-fnando
71
141
  requirement: !ruby/object:Gem::Requirement
72
142
  requirements:
73
143
  - - ">="
74
144
  - !ruby/object:Gem::Version
75
- version: '0.7'
145
+ version: '0'
76
146
  type: :development
77
147
  prerelease: false
78
148
  version_requirements: !ruby/object:Gem::Requirement
79
149
  requirements:
80
150
  - - ">="
81
151
  - !ruby/object:Gem::Version
82
- version: '0.7'
152
+ version: '0'
83
153
  - !ruby/object:Gem::Dependency
84
- name: coveralls
154
+ name: simplecov
85
155
  requirement: !ruby/object:Gem::Requirement
86
156
  requirements:
87
157
  - - ">="
88
158
  - !ruby/object:Gem::Version
89
- version: '0.7'
159
+ version: '0'
90
160
  type: :development
91
161
  prerelease: false
92
162
  version_requirements: !ruby/object:Gem::Requirement
93
163
  requirements:
94
164
  - - ">="
95
165
  - !ruby/object:Gem::Version
96
- version: '0.7'
97
- description: It's a small library to provide the Rails I18n translations on the Javascript.
166
+ version: '0'
167
+ description: Export i18n translations and use them on JavaScript.
98
168
  email:
99
- - fnando.vieira@gmail.com
100
- executables: []
169
+ - me@fnando.com
170
+ executables:
171
+ - i18n
101
172
  extensions: []
102
173
  extra_rdoc_files: []
103
174
  files:
104
- - ".editorconfig"
175
+ - ".github/CODEOWNERS"
176
+ - ".github/FUNDING.yml"
177
+ - ".github/ISSUE_TEMPLATE/bug_report.md"
178
+ - ".github/ISSUE_TEMPLATE/config.yml"
179
+ - ".github/ISSUE_TEMPLATE/feature_request.md"
180
+ - ".github/PULL_REQUEST_TEMPLATE.md"
181
+ - ".github/dependabot.yml"
182
+ - ".github/workflows/ruby-tests.yml"
105
183
  - ".gitignore"
106
- - ".npmignore"
107
- - ".travis.yml"
108
- - Appraisals
184
+ - ".rubocop.yml"
109
185
  - CHANGELOG.md
186
+ - CODE_OF_CONDUCT.md
187
+ - CONTRIBUTING.md
110
188
  - Gemfile
189
+ - LICENSE.md
190
+ - MIGRATING_FROM_V3_TO_V4.md
111
191
  - README.md
112
192
  - Rakefile
113
- - app/assets/javascripts/i18n.js
114
- - app/assets/javascripts/i18n/filtered.js.erb
115
- - app/assets/javascripts/i18n/shims.js
116
- - app/assets/javascripts/i18n/translations.js
117
- - gemfiles/i18n_0_6.gemfile
118
- - gemfiles/i18n_0_7.gemfile
119
- - gemfiles/i18n_0_8.gemfile
120
- - gemfiles/i18n_0_9.gemfile
121
- - gemfiles/i18n_1_0.gemfile
122
- - gemfiles/i18n_1_1.gemfile
123
- - gemfiles/i18n_1_2.gemfile
124
- - gemfiles/i18n_1_3.gemfile
125
- - gemfiles/i18n_1_4.gemfile
126
- - gemfiles/i18n_1_5.gemfile
193
+ - bin/release
194
+ - exe/i18n
127
195
  - i18n-js.gemspec
196
+ - lib/guard/i18n-js.rb
197
+ - lib/guard/i18n-js/templates/Guardfile
198
+ - lib/guard/i18n-js/version.rb
128
199
  - lib/i18n-js.rb
129
- - lib/i18n/js.rb
130
- - lib/i18n/js/dependencies.rb
131
- - lib/i18n/js/engine.rb
132
- - lib/i18n/js/fallback_locales.rb
133
- - lib/i18n/js/formatters/base.rb
134
- - lib/i18n/js/formatters/js.rb
135
- - lib/i18n/js/formatters/json.rb
136
- - lib/i18n/js/middleware.rb
137
- - lib/i18n/js/private/hash_with_symbol_keys.rb
138
- - lib/i18n/js/segment.rb
139
- - lib/i18n/js/utils.rb
140
- - lib/i18n/js/version.rb
141
- - lib/rails/generators/i18n/js/config/config_generator.rb
142
- - lib/rails/generators/i18n/js/config/templates/i18n-js.yml
143
- - lib/tasks/export.rake
200
+ - lib/i18n-js/clean_hash.rb
201
+ - lib/i18n-js/cli.rb
202
+ - lib/i18n-js/cli/check_command.rb
203
+ - lib/i18n-js/cli/command.rb
204
+ - lib/i18n-js/cli/export_command.rb
205
+ - lib/i18n-js/cli/init_command.rb
206
+ - lib/i18n-js/cli/lint_scripts_command.rb
207
+ - lib/i18n-js/cli/lint_translations_command.rb
208
+ - lib/i18n-js/cli/plugins_command.rb
209
+ - lib/i18n-js/cli/ui.rb
210
+ - lib/i18n-js/cli/version_command.rb
211
+ - lib/i18n-js/embed_fallback_translations_plugin.rb
212
+ - lib/i18n-js/export_files_plugin.rb
213
+ - lib/i18n-js/lint.js
214
+ - lib/i18n-js/lint.ts
215
+ - lib/i18n-js/listen.rb
216
+ - lib/i18n-js/plugin.rb
217
+ - lib/i18n-js/schema.rb
218
+ - lib/i18n-js/sort_hash.rb
219
+ - lib/i18n-js/version.rb
144
220
  - package.json
145
- - spec/fixtures/custom_path.yml
146
- - spec/fixtures/default.yml
147
- - spec/fixtures/erb.yml
148
- - spec/fixtures/except_condition.yml
149
- - spec/fixtures/js_export_dir_custom.yml
150
- - spec/fixtures/js_export_dir_none.yml
151
- - spec/fixtures/js_extend_parent.yml
152
- - spec/fixtures/js_extend_segment.yml
153
- - spec/fixtures/js_file_per_locale.yml
154
- - spec/fixtures/js_file_per_locale_with_fallbacks_as_default_locale_symbol.yml
155
- - spec/fixtures/js_file_per_locale_with_fallbacks_as_hash.yml
156
- - spec/fixtures/js_file_per_locale_with_fallbacks_as_locale.yml
157
- - spec/fixtures/js_file_per_locale_with_fallbacks_as_locale_without_fallback_translations.yml
158
- - spec/fixtures/js_file_per_locale_with_fallbacks_enabled.yml
159
- - spec/fixtures/js_file_per_locale_without_fallbacks.yml
160
- - spec/fixtures/js_file_with_namespace_and_pretty_print.yml
161
- - spec/fixtures/js_sort_translation_keys_false.yml
162
- - spec/fixtures/js_sort_translation_keys_true.yml
163
- - spec/fixtures/json_only.yml
164
- - spec/fixtures/locales.yml
165
- - spec/fixtures/merge_plurals.yml
166
- - spec/fixtures/multiple_conditions.yml
167
- - spec/fixtures/multiple_conditions_per_locale.yml
168
- - spec/fixtures/multiple_files.yml
169
- - spec/fixtures/no_config.yml
170
- - spec/fixtures/no_scope.yml
171
- - spec/fixtures/simple_scope.yml
172
- - spec/js/currency.spec.js
173
- - spec/js/current_locale.spec.js
174
- - spec/js/dates.spec.js
175
- - spec/js/defaults.spec.js
176
- - spec/js/extend.spec.js
177
- - spec/js/interpolation.spec.js
178
- - spec/js/jasmine/MIT.LICENSE
179
- - spec/js/jasmine/jasmine-html.js
180
- - spec/js/jasmine/jasmine.css
181
- - spec/js/jasmine/jasmine.js
182
- - spec/js/jasmine/jasmine_favicon.png
183
- - spec/js/locales.spec.js
184
- - spec/js/localization.spec.js
185
- - spec/js/numbers.spec.js
186
- - spec/js/placeholder.spec.js
187
- - spec/js/pluralization.spec.js
188
- - spec/js/prepare_options.spec.js
189
- - spec/js/require.js
190
- - spec/js/specs.html
191
- - spec/js/specs_requirejs.html
192
- - spec/js/translate.spec.js
193
- - spec/js/translations.js
194
- - spec/js/utility_functions.spec.js
195
- - spec/ruby/i18n/js/fallback_locales_spec.rb
196
- - spec/ruby/i18n/js/segment_spec.rb
197
- - spec/ruby/i18n/js/utils_spec.rb
198
- - spec/ruby/i18n/js_spec.rb
199
- - spec/spec_helper.rb
200
- - yarn.lock
201
- homepage: http://rubygems.org/gems/i18n-js
221
+ homepage: https://github.com/fnando/i18n-js
202
222
  licenses:
203
223
  - MIT
204
- metadata: {}
205
- post_install_message:
224
+ metadata:
225
+ rubygems_mfa_required: 'true'
226
+ homepage_uri: https://github.com/fnando/i18n-js
227
+ bug_tracker_uri: https://github.com/fnando/i18n-js/issues
228
+ source_code_uri: https://github.com/fnando/i18n-js/tree/v4.2.2
229
+ changelog_uri: https://github.com/fnando/i18n-js/tree/v4.2.2/CHANGELOG.md
230
+ documentation_uri: https://github.com/fnando/i18n-js/tree/v4.2.2/README.md
231
+ license_uri: https://github.com/fnando/i18n-js/tree/v4.2.2/LICENSE.md
232
+ post_install_message:
206
233
  rdoc_options: []
207
234
  require_paths:
208
235
  - lib
@@ -210,70 +237,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
210
237
  requirements:
211
238
  - - ">="
212
239
  - !ruby/object:Gem::Version
213
- version: 2.1.0
240
+ version: 2.6.0
214
241
  required_rubygems_version: !ruby/object:Gem::Requirement
215
242
  requirements:
216
243
  - - ">="
217
244
  - !ruby/object:Gem::Version
218
245
  version: '0'
219
246
  requirements: []
220
- rubygems_version: 3.0.2
221
- signing_key:
247
+ rubygems_version: 3.4.1
248
+ signing_key:
222
249
  specification_version: 4
223
- summary: It's a small library to provide the Rails I18n translations on the Javascript.
224
- test_files:
225
- - spec/fixtures/custom_path.yml
226
- - spec/fixtures/default.yml
227
- - spec/fixtures/erb.yml
228
- - spec/fixtures/except_condition.yml
229
- - spec/fixtures/js_export_dir_custom.yml
230
- - spec/fixtures/js_export_dir_none.yml
231
- - spec/fixtures/js_extend_parent.yml
232
- - spec/fixtures/js_extend_segment.yml
233
- - spec/fixtures/js_file_per_locale.yml
234
- - spec/fixtures/js_file_per_locale_with_fallbacks_as_default_locale_symbol.yml
235
- - spec/fixtures/js_file_per_locale_with_fallbacks_as_hash.yml
236
- - spec/fixtures/js_file_per_locale_with_fallbacks_as_locale.yml
237
- - spec/fixtures/js_file_per_locale_with_fallbacks_as_locale_without_fallback_translations.yml
238
- - spec/fixtures/js_file_per_locale_with_fallbacks_enabled.yml
239
- - spec/fixtures/js_file_per_locale_without_fallbacks.yml
240
- - spec/fixtures/js_file_with_namespace_and_pretty_print.yml
241
- - spec/fixtures/js_sort_translation_keys_false.yml
242
- - spec/fixtures/js_sort_translation_keys_true.yml
243
- - spec/fixtures/json_only.yml
244
- - spec/fixtures/locales.yml
245
- - spec/fixtures/merge_plurals.yml
246
- - spec/fixtures/multiple_conditions.yml
247
- - spec/fixtures/multiple_conditions_per_locale.yml
248
- - spec/fixtures/multiple_files.yml
249
- - spec/fixtures/no_config.yml
250
- - spec/fixtures/no_scope.yml
251
- - spec/fixtures/simple_scope.yml
252
- - spec/js/currency.spec.js
253
- - spec/js/current_locale.spec.js
254
- - spec/js/dates.spec.js
255
- - spec/js/defaults.spec.js
256
- - spec/js/extend.spec.js
257
- - spec/js/interpolation.spec.js
258
- - spec/js/jasmine/MIT.LICENSE
259
- - spec/js/jasmine/jasmine-html.js
260
- - spec/js/jasmine/jasmine.css
261
- - spec/js/jasmine/jasmine.js
262
- - spec/js/jasmine/jasmine_favicon.png
263
- - spec/js/locales.spec.js
264
- - spec/js/localization.spec.js
265
- - spec/js/numbers.spec.js
266
- - spec/js/placeholder.spec.js
267
- - spec/js/pluralization.spec.js
268
- - spec/js/prepare_options.spec.js
269
- - spec/js/require.js
270
- - spec/js/specs.html
271
- - spec/js/specs_requirejs.html
272
- - spec/js/translate.spec.js
273
- - spec/js/translations.js
274
- - spec/js/utility_functions.spec.js
275
- - spec/ruby/i18n/js/fallback_locales_spec.rb
276
- - spec/ruby/i18n/js/segment_spec.rb
277
- - spec/ruby/i18n/js/utils_spec.rb
278
- - spec/ruby/i18n/js_spec.rb
279
- - spec/spec_helper.rb
250
+ summary: Export i18n translations and use them on JavaScript.
251
+ test_files: []
data/.editorconfig DELETED
@@ -1,24 +0,0 @@
1
- # EditorConfig is awesome: http://EditorConfig.org
2
-
3
- # top-most EditorConfig file
4
- root = true
5
-
6
- # default configuration
7
- [*]
8
- indent_style = space
9
- indent_size = 2
10
- insert_final_newline = true
11
- trim_trailing_whitespace = true
12
-
13
- # Unix-style newlines with a newline ending every file
14
- end_of_line = lf
15
-
16
- # Set default charset
17
- charset = utf-8
18
-
19
- # Tab indentation (no size specified)
20
- [Makefile]
21
- indent_style = tab
22
-
23
- [*.{md,markdown}]
24
- trim_trailing_whitespace = false
data/.npmignore DELETED
@@ -1,27 +0,0 @@
1
- # https://docs.npmjs.com/misc/developers#keeping-files-out-of-your-package
2
-
3
- # tests
4
- spec
5
- coverage
6
-
7
- # build tools
8
- .travis.yml
9
-
10
- # linters
11
- .jscsrc
12
- .jshintrc
13
- .eslintrc*
14
-
15
- # editor settings
16
- .idea
17
- .editorconfig
18
-
19
- # Ruby code
20
- app/assets/javascripts/i18n/
21
- gemfiles
22
- lib
23
- Gemfile*
24
- *.gemspec
25
- Rakefile
26
- Appraisals
27
-
data/.travis.yml DELETED
@@ -1,36 +0,0 @@
1
- # Send builds to container-based infrastructure
2
- # http://docs.travis-ci.com/user/workers/container-based-infrastructure/
3
- sudo: false
4
- language: ruby
5
- cache:
6
- bundler: true
7
- yarn: true
8
- directories:
9
- - node_modules
10
- rvm:
11
- - 2.3
12
- - 2.4
13
- - 2.5
14
- - 2.6
15
- - ruby-head
16
- before_install:
17
- # Needed to test JS
18
- - yarn install
19
- gemfile:
20
- - gemfiles/i18n_0_6.gemfile
21
- - gemfiles/i18n_0_7.gemfile
22
- - gemfiles/i18n_0_8.gemfile
23
- - gemfiles/i18n_0_9.gemfile
24
- - gemfiles/i18n_1_0.gemfile
25
- - gemfiles/i18n_1_1.gemfile
26
- - gemfiles/i18n_1_2.gemfile
27
- - gemfiles/i18n_1_3.gemfile
28
- - gemfiles/i18n_1_4.gemfile
29
- - gemfiles/i18n_1_5.gemfile
30
- matrix:
31
- fast_finish: true
32
- allow_failures:
33
- - rvm: ruby-head
34
- notifications:
35
- webhooks: https://www.travisbuddy.com/
36
- on_success: never
data/Appraisals DELETED
@@ -1,32 +0,0 @@
1
-
2
- appraise "i18n_0_8" do
3
- gem "i18n", "~> 0.8.0"
4
- end
5
-
6
- appraise "i18n_0_9" do
7
- gem "i18n", "~> 0.9.0"
8
- end
9
-
10
- appraise "i18n_1_0" do
11
- gem "i18n", "~> 1.0.0"
12
- end
13
-
14
- appraise "i18n_1_1" do
15
- gem "i18n", "~> 1.1.0"
16
- end
17
-
18
- appraise "i18n_1_2" do
19
- gem "i18n", "~> 1.2.0"
20
- end
21
-
22
- appraise "i18n_1_3" do
23
- gem "i18n", "~> 1.3.0"
24
- end
25
-
26
- appraise "i18n_1_4" do
27
- gem "i18n", "~> 1.4.0"
28
- end
29
-
30
- appraise "i18n_1_5" do
31
- gem "i18n", "~> 1.5.1"
32
- end