i18n-js 3.8.3 → 4.0.0.alpha2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (132) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +4 -0
  3. data/.github/FUNDING.yml +1 -1
  4. data/.github/ISSUE_TEMPLATE/bug_report.md +41 -0
  5. data/.github/ISSUE_TEMPLATE/feature_request.md +23 -0
  6. data/.github/PULL_REQUEST_TEMPLATE.md +38 -0
  7. data/.github/dependabot.yml +15 -0
  8. data/.github/workflows/ruby-tests.yml +49 -0
  9. data/.gitignore +11 -7
  10. data/.rubocop.yml +17 -0
  11. data/CHANGELOG.md +12 -535
  12. data/CODE_OF_CONDUCT.md +74 -0
  13. data/CONTRIBUTING.md +79 -0
  14. data/Gemfile +3 -0
  15. data/LICENSE.md +20 -0
  16. data/README.md +87 -1032
  17. data/Rakefile +10 -20
  18. data/exe/i18n +5 -0
  19. data/i18n-js.gemspec +48 -29
  20. data/lib/guard/i18n-js/templates/Guardfile +10 -0
  21. data/lib/guard/i18n-js/version.rb +13 -0
  22. data/lib/guard/i18n-js.rb +78 -0
  23. data/lib/i18n-js/cli/command.rb +43 -0
  24. data/lib/i18n-js/cli/export_command.rb +108 -0
  25. data/lib/i18n-js/cli/init_command.rb +50 -0
  26. data/lib/i18n-js/cli/ui.rb +30 -0
  27. data/lib/i18n-js/cli/version_command.rb +18 -0
  28. data/lib/i18n-js/cli.rb +54 -0
  29. data/lib/i18n-js/listen.rb +81 -0
  30. data/lib/i18n-js/schema.rb +92 -0
  31. data/lib/i18n-js/version.rb +5 -0
  32. data/lib/i18n-js.rb +60 -1
  33. metadata +123 -194
  34. data/.editorconfig +0 -24
  35. data/.github/workflows/tests.yaml +0 -100
  36. data/.npmignore +0 -27
  37. data/Appraisals +0 -44
  38. data/app/assets/javascripts/i18n/filtered.js.erb +0 -23
  39. data/app/assets/javascripts/i18n/shims.js +0 -240
  40. data/app/assets/javascripts/i18n/translations.js +0 -3
  41. data/app/assets/javascripts/i18n.js +0 -1095
  42. data/gemfiles/i18n_0_6.gemfile +0 -7
  43. data/gemfiles/i18n_0_7.gemfile +0 -7
  44. data/gemfiles/i18n_0_8.gemfile +0 -7
  45. data/gemfiles/i18n_0_9.gemfile +0 -7
  46. data/gemfiles/i18n_1_0.gemfile +0 -7
  47. data/gemfiles/i18n_1_1.gemfile +0 -7
  48. data/gemfiles/i18n_1_2.gemfile +0 -7
  49. data/gemfiles/i18n_1_3.gemfile +0 -7
  50. data/gemfiles/i18n_1_4.gemfile +0 -7
  51. data/gemfiles/i18n_1_5.gemfile +0 -7
  52. data/gemfiles/i18n_1_6.gemfile +0 -7
  53. data/gemfiles/i18n_1_7.gemfile +0 -7
  54. data/gemfiles/i18n_1_8.gemfile +0 -7
  55. data/i18njs.png +0 -0
  56. data/lib/i18n/js/dependencies.rb +0 -63
  57. data/lib/i18n/js/engine.rb +0 -87
  58. data/lib/i18n/js/fallback_locales.rb +0 -70
  59. data/lib/i18n/js/formatters/base.rb +0 -25
  60. data/lib/i18n/js/formatters/js.rb +0 -39
  61. data/lib/i18n/js/formatters/json.rb +0 -13
  62. data/lib/i18n/js/middleware.rb +0 -82
  63. data/lib/i18n/js/private/config_store.rb +0 -31
  64. data/lib/i18n/js/private/hash_with_symbol_keys.rb +0 -36
  65. data/lib/i18n/js/segment.rb +0 -80
  66. data/lib/i18n/js/utils.rb +0 -78
  67. data/lib/i18n/js/version.rb +0 -7
  68. data/lib/i18n/js.rb +0 -264
  69. data/lib/rails/generators/i18n/js/config/config_generator.rb +0 -19
  70. data/lib/rails/generators/i18n/js/config/templates/i18n-js.yml +0 -27
  71. data/lib/tasks/export.rake +0 -8
  72. data/package.json +0 -25
  73. data/spec/fixtures/custom_path.yml +0 -5
  74. data/spec/fixtures/default.yml +0 -5
  75. data/spec/fixtures/erb.yml +0 -5
  76. data/spec/fixtures/except_condition.yml +0 -7
  77. data/spec/fixtures/js_export_dir_custom.yml +0 -7
  78. data/spec/fixtures/js_export_dir_none.yml +0 -6
  79. data/spec/fixtures/js_extend_parent.yml +0 -6
  80. data/spec/fixtures/js_extend_segment.yml +0 -6
  81. data/spec/fixtures/js_file_per_locale.yml +0 -7
  82. data/spec/fixtures/js_file_per_locale_with_fallbacks_as_default_locale_symbol.yml +0 -4
  83. data/spec/fixtures/js_file_per_locale_with_fallbacks_as_hash.yml +0 -6
  84. data/spec/fixtures/js_file_per_locale_with_fallbacks_as_locale.yml +0 -4
  85. data/spec/fixtures/js_file_per_locale_with_fallbacks_as_locale_without_fallback_translations.yml +0 -4
  86. data/spec/fixtures/js_file_per_locale_with_fallbacks_enabled.yml +0 -4
  87. data/spec/fixtures/js_file_per_locale_without_fallbacks.yml +0 -4
  88. data/spec/fixtures/js_file_with_namespace_prefix_and_pretty_print.yml +0 -9
  89. data/spec/fixtures/js_sort_translation_keys_false.yml +0 -6
  90. data/spec/fixtures/js_sort_translation_keys_true.yml +0 -6
  91. data/spec/fixtures/json_only.yml +0 -18
  92. data/spec/fixtures/locales.yml +0 -133
  93. data/spec/fixtures/merge_plurals.yml +0 -6
  94. data/spec/fixtures/merge_plurals_with_no_overrides.yml +0 -4
  95. data/spec/fixtures/merge_plurals_with_partial_overrides.yml +0 -4
  96. data/spec/fixtures/millions.yml +0 -4
  97. data/spec/fixtures/multiple_conditions.yml +0 -7
  98. data/spec/fixtures/multiple_conditions_per_locale.yml +0 -7
  99. data/spec/fixtures/multiple_files.yml +0 -7
  100. data/spec/fixtures/no_config.yml +0 -2
  101. data/spec/fixtures/no_scope.yml +0 -4
  102. data/spec/fixtures/simple_scope.yml +0 -5
  103. data/spec/js/currency.spec.js +0 -62
  104. data/spec/js/current_locale.spec.js +0 -19
  105. data/spec/js/dates.spec.js +0 -276
  106. data/spec/js/defaults.spec.js +0 -31
  107. data/spec/js/extend.spec.js +0 -110
  108. data/spec/js/interpolation.spec.js +0 -124
  109. data/spec/js/jasmine/MIT.LICENSE +0 -20
  110. data/spec/js/jasmine/jasmine-html.js +0 -190
  111. data/spec/js/jasmine/jasmine.css +0 -166
  112. data/spec/js/jasmine/jasmine.js +0 -2476
  113. data/spec/js/jasmine/jasmine_favicon.png +0 -0
  114. data/spec/js/json_parsable.spec.js +0 -14
  115. data/spec/js/locales.spec.js +0 -31
  116. data/spec/js/localization.spec.js +0 -78
  117. data/spec/js/numbers.spec.js +0 -174
  118. data/spec/js/placeholder.spec.js +0 -24
  119. data/spec/js/pluralization.spec.js +0 -219
  120. data/spec/js/prepare_options.spec.js +0 -41
  121. data/spec/js/require.js +0 -2083
  122. data/spec/js/specs.html +0 -49
  123. data/spec/js/specs_requirejs.html +0 -72
  124. data/spec/js/translate.spec.js +0 -304
  125. data/spec/js/translations.js +0 -188
  126. data/spec/js/utility_functions.spec.js +0 -20
  127. data/spec/ruby/i18n/js/fallback_locales_spec.rb +0 -84
  128. data/spec/ruby/i18n/js/segment_spec.rb +0 -261
  129. data/spec/ruby/i18n/js/utils_spec.rb +0 -106
  130. data/spec/ruby/i18n/js_spec.rb +0 -748
  131. data/spec/spec_helper.rb +0 -80
  132. data/yarn.lock +0 -131
data/spec/spec_helper.rb DELETED
@@ -1,80 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler'
3
-
4
- begin
5
- require 'simplecov'
6
- SimpleCov.start do
7
- add_filter 'spec'
8
- end
9
- rescue LoadError
10
- # SimpleCov ain't available - continue
11
- end
12
-
13
- if ENV["TRAVIS"]
14
- require "coveralls"
15
- Coveralls.wear!("rails")
16
- end
17
-
18
- require "i18n"
19
- require "json"
20
-
21
- require "i18n/js"
22
-
23
- require "rspec"
24
-
25
- module Helpers
26
- # Set the configuration as the current one
27
- def set_config(path)
28
- config_file_path = File.dirname(__FILE__) + "/fixtures/#{path}"
29
- allow(I18n::JS).to receive_messages(
30
- :config_file_exists? => true,
31
- :config_file_path => config_file_path,
32
- )
33
- end
34
-
35
- # Shortcut to I18n::JS.translations
36
- def translations
37
- I18n::JS.translations
38
- end
39
-
40
- def file_should_exist(name)
41
- file_path = File.join(temp_path, name)
42
- expect(File.file?(file_path)).to eq(true)
43
- end
44
-
45
- def temp_path(file_name = "")
46
- File.expand_path("../../tmp/i18n-js/#{file_name}", __FILE__)
47
- end
48
-
49
-
50
- def self.included(base)
51
- base.let(:backend_class_with_fallbacks) do
52
- klass = Class.new(I18n::Backend::Simple)
53
- klass.send(:include, I18n::Backend::Fallbacks)
54
- klass
55
- end
56
- end
57
- end
58
-
59
- RSpec.configure do |config|
60
- config.before do
61
- I18n.load_path = [File.dirname(__FILE__) + "/fixtures/locales.yml"]
62
- FileUtils.rm_rf(temp_path)
63
- end
64
-
65
- config.after do
66
- FileUtils.rm_rf(temp_path)
67
- I18n::JS::Private::ConfigStore.instance.flush_cache
68
- end
69
-
70
- config.include Helpers
71
-
72
- # Remove deprecation warnings
73
- config.expect_with :rspec do |c|
74
- c.syntax = [:expect]
75
- end
76
- config.mock_with :rspec do |c|
77
- c.syntax = [:expect]
78
- end
79
- end
80
-
data/yarn.lock DELETED
@@ -1,131 +0,0 @@
1
- # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2
- # yarn lockfile v1
3
-
4
-
5
- balanced-match@^1.0.0:
6
- version "1.0.0"
7
- resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
8
-
9
- brace-expansion@^1.1.7:
10
- version "1.1.11"
11
- resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
12
- dependencies:
13
- balanced-match "^1.0.0"
14
- concat-map "0.0.1"
15
-
16
- coffeescript@>=1.0.1:
17
- version "2.3.1"
18
- resolved "https://registry.yarnpkg.com/coffeescript/-/coffeescript-2.3.1.tgz#a25f69c251d25805c9842e57fc94bfc453ef6aed"
19
-
20
- concat-map@0.0.1:
21
- version "0.0.1"
22
- resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
23
-
24
- fs.realpath@^1.0.0:
25
- version "1.0.0"
26
- resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
27
-
28
- gaze@~1.1.2:
29
- version "1.1.3"
30
- resolved "https://registry.yarnpkg.com/gaze/-/gaze-1.1.3.tgz#c441733e13b927ac8c0ff0b4c3b033f28812924a"
31
- dependencies:
32
- globule "^1.0.0"
33
-
34
- glob@~7.1.1:
35
- version "7.1.2"
36
- resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15"
37
- dependencies:
38
- fs.realpath "^1.0.0"
39
- inflight "^1.0.4"
40
- inherits "2"
41
- minimatch "^3.0.4"
42
- once "^1.3.0"
43
- path-is-absolute "^1.0.0"
44
-
45
- globule@^1.0.0:
46
- version "1.2.1"
47
- resolved "https://registry.yarnpkg.com/globule/-/globule-1.2.1.tgz#5dffb1b191f22d20797a9369b49eab4e9839696d"
48
- dependencies:
49
- glob "~7.1.1"
50
- lodash "~4.17.10"
51
- minimatch "~3.0.2"
52
-
53
- growl@^1.10.2:
54
- version "1.10.5"
55
- resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e"
56
-
57
- inflight@^1.0.4:
58
- version "1.0.6"
59
- resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
60
- dependencies:
61
- once "^1.3.0"
62
- wrappy "1"
63
-
64
- inherits@2:
65
- version "2.0.3"
66
- resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"
67
-
68
- jasmine-growl-reporter@~1.0.1:
69
- version "1.0.1"
70
- resolved "https://registry.yarnpkg.com/jasmine-growl-reporter/-/jasmine-growl-reporter-1.0.1.tgz#375306cef1fbf6357ad7913ca0358aa2285d6d39"
71
- dependencies:
72
- growl "^1.10.2"
73
-
74
- jasmine-node@^1.14.5:
75
- version "1.15.0"
76
- resolved "https://registry.yarnpkg.com/jasmine-node/-/jasmine-node-1.15.0.tgz#d5e9a92623c111f55e4b83ff2ab0407ddbc2a5b7"
77
- dependencies:
78
- coffeescript ">=1.0.1"
79
- gaze "~1.1.2"
80
- jasmine-growl-reporter "~1.0.1"
81
- jasmine-reporters "~1.0.0"
82
- mkdirp "~0.3.5"
83
- requirejs ">=0.27.1"
84
- underscore ">= 1.3.1"
85
- walkdir ">= 0.0.1"
86
-
87
- jasmine-reporters@~1.0.0:
88
- version "1.0.2"
89
- resolved "https://registry.yarnpkg.com/jasmine-reporters/-/jasmine-reporters-1.0.2.tgz#ab613ed5977dc7487e85b3c12f6a8ea8db2ade31"
90
- dependencies:
91
- mkdirp "~0.3.5"
92
-
93
- lodash@~4.17.10:
94
- version "4.17.20"
95
- resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
96
-
97
- minimatch@^3.0.4, minimatch@~3.0.2:
98
- version "3.0.4"
99
- resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
100
- dependencies:
101
- brace-expansion "^1.1.7"
102
-
103
- mkdirp@~0.3.5:
104
- version "0.3.5"
105
- resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.3.5.tgz#de3e5f8961c88c787ee1368df849ac4413eca8d7"
106
-
107
- once@^1.3.0:
108
- version "1.4.0"
109
- resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
110
- dependencies:
111
- wrappy "1"
112
-
113
- path-is-absolute@^1.0.0:
114
- version "1.0.1"
115
- resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
116
-
117
- requirejs@>=0.27.1:
118
- version "2.3.5"
119
- resolved "https://registry.yarnpkg.com/requirejs/-/requirejs-2.3.5.tgz#617b9acbbcb336540ef4914d790323a8d4b861b0"
120
-
121
- "underscore@>= 1.3.1":
122
- version "1.9.1"
123
- resolved "https://registry.yarnpkg.com/underscore/-/underscore-1.9.1.tgz#06dce34a0e68a7babc29b365b8e74b8925203961"
124
-
125
- "walkdir@>= 0.0.1":
126
- version "0.0.12"
127
- resolved "https://registry.yarnpkg.com/walkdir/-/walkdir-0.0.12.tgz#2f24f1ade64aab1e458591d4442c8868356e9281"
128
-
129
- wrappy@1:
130
- version "1.0.2"
131
- resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"