blacklight-locale_picker 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17a822c82012ee32b19b4c03ccfd2e213cd050bd7e08d902e816e8e997d525ea
4
- data.tar.gz: 452e5def5ab4cc417158e52236ebbbd4074b825f520a6f699672db8c00837c3f
3
+ metadata.gz: 999b2994ad6653ced30bab3c5057c10b4f8d40d9d405207c5f46ed8a0ffc2ada
4
+ data.tar.gz: 302dbd601e28b9197477e5f04f7c842ab2b0fe679874e2fd8405c54ecf286eb2
5
5
  SHA512:
6
- metadata.gz: 0456f053e837749f2c369119215f22fb492c245c2b9b739ae81e48bb414f7a93aa69538bd1af8392e854b0ed06e269efe6afc1a65f28e873e99fe875e2acab69
7
- data.tar.gz: ccc0749116ec7960106507d169c77e564ea111d895fe566c2f889eeaa3fe6097c57402cbe3ff697e82a61a8a766112bc65951175386bc79371bad8c742b86857
6
+ metadata.gz: 77ff6ca4eea04407bc887a97023321a685dffddd14c8eabc1868c35a5a4bb0c13d53b610fc11aa258bf808e0d45aab50e08bbd67953dc849a777619b1919be23
7
+ data.tar.gz: ffb437cd3181ef2944fe8509e64be3ea4de6a23618dceb44d31dab16e2491f3b98d9bcf2573894a16182ba70028116a0f0d46c948334e8456aa24a75343418c3
@@ -2,7 +2,13 @@ sudo: false
2
2
  language: ruby
3
3
  notifications:
4
4
  email: false
5
+
6
+ matrix:
7
+ include:
8
+ - env: RAILS_VERSION=6.0.3.2
9
+ - env: RAILS_VERSION=5.2.4.3
10
+
5
11
  rvm:
6
- - 2.6.3
12
+ - 2.7.1
7
13
  jdk:
8
14
  - oraclejdk9
data/Gemfile CHANGED
@@ -38,6 +38,8 @@ else
38
38
  end
39
39
 
40
40
  case ENV['RAILS_VERSION']
41
+ when /^5.[12]/
42
+ gem 'sass-rails', '~> 5.0'
41
43
  when /^4.2/
42
44
  gem 'responders', '~> 2.0'
43
45
  gem 'sass-rails', '>= 5.0'
data/README.md CHANGED
@@ -28,5 +28,11 @@ $ rails generate blacklight:locale_picker:install
28
28
  ## Configuration
29
29
  To add locales to your application, add an initializer.
30
30
  ```
31
- Blacklight::LocalePicker::Engine.config.available_locales = [:en, :es]
31
+ Blacklight::LocalePicker::Engine.config.available_locales = ['en', 'es', 'pt-BR']
32
+ ```
33
+
34
+ ## Translations
35
+ `blacklight-locale_picker` ships with i18n-tasks to help manage translations. To run a translation health check, run:
36
+ ```
37
+ $ bundle exec rake i18n:health
32
38
  ```
data/Rakefile CHANGED
@@ -25,6 +25,13 @@ RSpec::Core::RakeTask.new(:spec)
25
25
  require 'rubocop/rake_task'
26
26
  RuboCop::RakeTask.new(:rubocop)
27
27
 
28
+ namespace :i18n do
29
+ desc 'Check for missing translations'
30
+ task :health do
31
+ system 'bundle exec i18n-tasks health'
32
+ end
33
+ end
34
+
28
35
  require 'engine_cart/rake_task'
29
36
 
30
37
  task ci: ['engine_cart:generate'] do
@@ -43,4 +50,4 @@ task ci: ['engine_cart:generate'] do
43
50
  end
44
51
  end
45
52
 
46
- task default: :ci
53
+ task default: %i[i18n:health ci]
@@ -1,12 +1,10 @@
1
1
  <% if available_locales.many? %>
2
2
  <li class="nav-item dropdown">
3
- <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false" aria-controls="language-dropdown-menu">
4
- <span class="sr-only"><%= t('blacklight.toolbar.language_switch') %></span>
3
+ <a class="nav-link dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false" aria-controls="language-dropdown-menu" aria-label="<%= t('blacklight.header_links.locale_switcher') %>">
5
4
  <span><%= t("locales.#{I18n.locale}") %></span>
6
5
  <b class="caret"></b>
7
6
  </a>
8
7
  <ul id="language-dropdown-menu" class="dropdown-menu" role="menu">
9
- <li role="presentation" class="dropdown-header"><%= t('blacklight.toolbar.language_switch') %></li>
10
8
  <li role="presentation" class="divider"></li>
11
9
  <% available_locales.each do |locale| %>
12
10
  <li role="presentation" lang="<%= locale %>">
@@ -21,7 +21,8 @@ Gem::Specification.new do |spec|
21
21
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
22
  spec.require_paths = ['lib']
23
23
 
24
- spec.add_dependency "rails", "~> 5.2.3"
24
+ spec.required_ruby_version = '>= 2.5.0'
25
+ spec.add_dependency "rails", ">= 5.2.3", "< 6.1"
25
26
 
26
27
  spec.add_development_dependency "capybara"
27
28
  spec.add_development_dependency "engine_cart"
@@ -29,4 +30,5 @@ Gem::Specification.new do |spec|
29
30
  spec.add_development_dependency "rubocop"
30
31
  spec.add_development_dependency "sqlite3"
31
32
  spec.add_development_dependency "solr_wrapper"
33
+ spec.add_development_dependency "i18n-tasks"
32
34
  end
@@ -0,0 +1,134 @@
1
+ # i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks
2
+
3
+ # The "main" locale.
4
+ # base_locale: en
5
+ ## All available locales are inferred from the data by default. Alternatively, specify them explicitly:
6
+ locales: [ar, de, en, es, fr, hu, it, nl, pt-BR, sq, zh]
7
+ ## Reporting locale, default: en. Available: en, ru.
8
+ # internal_locale: en
9
+
10
+ # Read and write translations.
11
+ data:
12
+ ## Translations are read from the file system. Supported format: YAML, JSON.
13
+ ## Provide a custom adapter:
14
+ # adapter: I18n::Tasks::Data::FileSystem
15
+
16
+ # Locale files or `File.find` patterns where translations are read from:
17
+ read:
18
+ ## Default:
19
+ # - config/locales/%{locale}.yml
20
+ ## More files:
21
+ # - config/locales/**/*.%{locale}.yml
22
+ - config/locales/locale_picker.%{locale}.yml
23
+
24
+ # Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom:
25
+ # `i18n-tasks normalize -p` will force move the keys according to these rules
26
+ write:
27
+ ## For example, write devise and simple form keys to their respective files:
28
+ # - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml']
29
+ ## Catch-all default:
30
+ # - config/locales/%{locale}.yml
31
+
32
+ # External locale data (e.g. gems).
33
+ # This data is not considered unused and is never written to.
34
+ external:
35
+ ## Example (replace %#= with %=):
36
+ # - "<%#= %x[bundle show vagrant].chomp %>/templates/locales/%{locale}.yml"
37
+
38
+ ## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class.
39
+ # router: conservative_router
40
+
41
+ yaml:
42
+ write:
43
+ # do not wrap lines at 80 characters
44
+ line_width: -1
45
+
46
+ ## Pretty-print JSON:
47
+ # json:
48
+ # write:
49
+ # indent: ' '
50
+ # space: ' '
51
+ # object_nl: "\n"
52
+ # array_nl: "\n"
53
+
54
+ # Find translate calls
55
+ search:
56
+ ## Paths or `File.find` patterns to search in:
57
+ # paths:
58
+ # - app/
59
+
60
+ ## Root directories for relative keys resolution.
61
+ # relative_roots:
62
+ # - app/controllers
63
+ # - app/helpers
64
+ # - app/mailers
65
+ # - app/presenters
66
+ # - app/views
67
+
68
+ ## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting:
69
+ ## %w(*.jpg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less *.yml *.json)
70
+ exclude:
71
+ - app/assets/images
72
+ - app/assets/fonts
73
+ - app/assets/videos
74
+
75
+ ## Alternatively, the only files or `File.fnmatch patterns` to search in `paths`:
76
+ ## If specified, this settings takes priority over `exclude`, but `exclude` still applies.
77
+ # only: ["*.rb", "*.html.slim"]
78
+
79
+ ## If `strict` is `false`, guess usages such as t("categories.#{category}.title"). The default is `true`.
80
+ # strict: true
81
+
82
+ ## Multiple scanners can be used. Their results are merged.
83
+ ## The options specified above are passed down to each scanner. Per-scanner options can be specified as well.
84
+ ## See this example of a custom scanner: https://github.com/glebm/i18n-tasks/wiki/A-custom-scanner-example
85
+
86
+ ## Translation Services
87
+ # translation:
88
+ # # Google Translate
89
+ # # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate
90
+ # google_translate_api_key: "AbC-dEf5"
91
+ # # DeepL Pro Translate
92
+ # # Get an API key and subscription at https://www.deepl.com/pro to use DeepL Pro
93
+ # deepl_api_key: "48E92789-57A3-466A-9959-1A1A1A1A1A1A"
94
+
95
+ ## Do not consider these keys missing:
96
+ # ignore_missing:
97
+ # - 'errors.messages.{accepted,blank,invalid,too_short,too_long}'
98
+ # - '{devise,simple_form}.*'
99
+
100
+ ## Consider these keys used:
101
+ # ignore_unused:
102
+ # - 'activerecord.attributes.*'
103
+ # - '{devise,kaminari,will_paginate}.*'
104
+ # - 'simple_form.{yes,no}'
105
+ # - 'simple_form.{placeholders,hints,labels}.*'
106
+ # - 'simple_form.{error_notification,required}.:'
107
+
108
+ ## Exclude these keys from the `i18n-tasks eq-base' report:
109
+ # ignore_eq_base:
110
+ # all:
111
+ # - common.ok
112
+ # fr,es:
113
+ # - common.brand
114
+
115
+ ## Exclude these keys from the `i18n-tasks check-consistent-interpolations` report:
116
+ # ignore_inconsistent_interpolations:
117
+ # - 'activerecord.attributes.*'
118
+
119
+ ## Ignore these keys completely:
120
+ # ignore:
121
+ # - kaminari.*
122
+
123
+ ## Sometimes, it isn't possible for i18n-tasks to match the key correctly,
124
+ ## e.g. in case of a relative key defined in a helper method.
125
+ ## In these cases you can use the built-in PatternMapper to map patterns to keys, e.g.:
126
+ #
127
+ # <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
128
+ # only: %w(*.html.haml *.html.slim),
129
+ # patterns: [['= title\b', '.page_title']] %>
130
+ #
131
+ # The PatternMapper can also match key literals via a special %{key} interpolation, e.g.:
132
+ #
133
+ # <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper',
134
+ # patterns: [['\bSpree\.t[( ]\s*%{key}', 'spree.%{key}']] %>
@@ -0,0 +1,17 @@
1
+ ---
2
+ ar:
3
+ blacklight:
4
+ header_links:
5
+ locale_switcher: لغة
6
+ locales:
7
+ ar: العربية
8
+ de: Deutsch
9
+ en: English
10
+ es: Español
11
+ fr: Français
12
+ hu: Magyar
13
+ it: Italiano
14
+ nl: Nederlands
15
+ pt-BR: Português braileiro
16
+ sq: Shqip
17
+ zh: 中文
@@ -0,0 +1,17 @@
1
+ ---
2
+ de:
3
+ blacklight:
4
+ header_links:
5
+ locale_switcher: Sprache
6
+ locales:
7
+ ar: العربية
8
+ de: Deutsch
9
+ en: English
10
+ es: Español
11
+ fr: Français
12
+ hu: Magyar
13
+ it: Italiano
14
+ nl: Nederlands
15
+ pt-BR: Português braileiro
16
+ sq: Shqip
17
+ zh: 中文
@@ -1,12 +1,17 @@
1
+ ---
1
2
  en:
3
+ blacklight:
4
+ header_links:
5
+ locale_switcher: Language
2
6
  locales:
3
- de: German
7
+ ar: العربية
8
+ de: Deutsch
4
9
  en: English
5
- es: Spanish
6
- fr: French
7
- hu: Hungarian
8
- it: Italian
9
- nl: Dutch
10
- pt-BR: Portuguese - Brazil
11
- sq: Albanian
12
- zh: Chinese
10
+ es: Español
11
+ fr: Français
12
+ hu: Magyar
13
+ it: Italiano
14
+ nl: Nederlands
15
+ pt-BR: Português braileiro
16
+ sq: Shqip
17
+ zh: 中文
@@ -0,0 +1,17 @@
1
+ ---
2
+ es:
3
+ blacklight:
4
+ header_links:
5
+ locale_switcher: Idioma
6
+ locales:
7
+ ar: العربية
8
+ de: Deutsch
9
+ en: English
10
+ es: Español
11
+ fr: Français
12
+ hu: Magyar
13
+ it: Italiano
14
+ nl: Nederlands
15
+ pt-BR: Português braileiro
16
+ sq: Shqip
17
+ zh: 中文
@@ -0,0 +1,17 @@
1
+ ---
2
+ fr:
3
+ blacklight:
4
+ header_links:
5
+ locale_switcher: Langue
6
+ locales:
7
+ ar: العربية
8
+ de: Deutsch
9
+ en: English
10
+ es: Español
11
+ fr: Français
12
+ hu: Magyar
13
+ it: Italiano
14
+ nl: Nederlands
15
+ pt-BR: Português braileiro
16
+ sq: Shqip
17
+ zh: 中文
@@ -0,0 +1,17 @@
1
+ ---
2
+ hu:
3
+ blacklight:
4
+ header_links:
5
+ locale_switcher: Nyelv
6
+ locales:
7
+ ar: العربية
8
+ de: Deutsch
9
+ en: English
10
+ es: Español
11
+ fr: Français
12
+ hu: Magyar
13
+ it: Italiano
14
+ nl: Nederlands
15
+ pt-BR: Português braileiro
16
+ sq: Shqip
17
+ zh: 中文
@@ -0,0 +1,17 @@
1
+ ---
2
+ it:
3
+ blacklight:
4
+ header_links:
5
+ locale_switcher: Lingua
6
+ locales:
7
+ ar: العربية
8
+ de: Deutsch
9
+ en: English
10
+ es: Español
11
+ fr: Français
12
+ hu: Magyar
13
+ it: Italiano
14
+ nl: Nederlands
15
+ pt-BR: Português braileiro
16
+ sq: Shqip
17
+ zh: 中文
@@ -0,0 +1,17 @@
1
+ ---
2
+ nl:
3
+ blacklight:
4
+ header_links:
5
+ locale_switcher: Taal
6
+ locales:
7
+ ar: العربية
8
+ de: Deutsch
9
+ en: English
10
+ es: Español
11
+ fr: Français
12
+ hu: Magyar
13
+ it: Italiano
14
+ nl: Nederlands
15
+ pt-BR: Português braileiro
16
+ sq: Shqip
17
+ zh: 中文
@@ -0,0 +1,17 @@
1
+ ---
2
+ pt-BR:
3
+ blacklight:
4
+ header_links:
5
+ locale_switcher: Idioma
6
+ locales:
7
+ ar: العربية
8
+ de: Deutsch
9
+ en: English
10
+ es: Español
11
+ fr: Français
12
+ hu: Magyar
13
+ it: Italiano
14
+ nl: Nederlands
15
+ pt-BR: Português braileiro
16
+ sq: Shqip
17
+ zh: 中文
@@ -0,0 +1,17 @@
1
+ ---
2
+ sq:
3
+ blacklight:
4
+ header_links:
5
+ locale_switcher: Gjuhë
6
+ locales:
7
+ ar: العربية
8
+ de: Deutsch
9
+ en: English
10
+ es: Español
11
+ fr: Français
12
+ hu: Magyar
13
+ it: Italiano
14
+ nl: Nederlands
15
+ pt-BR: Português braileiro
16
+ sq: Shqip
17
+ zh: 中文
@@ -0,0 +1,17 @@
1
+ ---
2
+ zh:
3
+ blacklight:
4
+ header_links:
5
+ locale_switcher: 语言
6
+ locales:
7
+ ar: العربية
8
+ de: Deutsch
9
+ en: English
10
+ es: Español
11
+ fr: Français
12
+ hu: Magyar
13
+ it: Italiano
14
+ nl: Nederlands
15
+ pt-BR: Português braileiro
16
+ sq: Shqip
17
+ zh: 中文
@@ -1,5 +1,5 @@
1
1
  module Blacklight
2
2
  module LocalePicker
3
- VERSION = '0.1.0'
3
+ VERSION = '0.2.0'
4
4
  end
5
5
  end
@@ -19,5 +19,11 @@ module Blacklight::LocalePicker
19
19
  "\n include Blacklight::LocalePicker::LocaleHelper"
20
20
  end
21
21
  end
22
+
23
+ def install_webpacker
24
+ return unless Rails.version.to_i == 6
25
+
26
+ rake 'webpacker:install'
27
+ end
22
28
  end
23
29
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blacklight-locale_picker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Camille Villa
@@ -9,22 +9,28 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2019-08-16 00:00:00.000000000 Z
12
+ date: 2020-07-24 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
  requirements:
18
- - - "~>"
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: 5.2.3
21
+ - - "<"
22
+ - !ruby/object:Gem::Version
23
+ version: '6.1'
21
24
  type: :runtime
22
25
  prerelease: false
23
26
  version_requirements: !ruby/object:Gem::Requirement
24
27
  requirements:
25
- - - "~>"
28
+ - - ">="
26
29
  - !ruby/object:Gem::Version
27
30
  version: 5.2.3
31
+ - - "<"
32
+ - !ruby/object:Gem::Version
33
+ version: '6.1'
28
34
  - !ruby/object:Gem::Dependency
29
35
  name: capybara
30
36
  requirement: !ruby/object:Gem::Requirement
@@ -109,6 +115,20 @@ dependencies:
109
115
  - - ">="
110
116
  - !ruby/object:Gem::Version
111
117
  version: '0'
118
+ - !ruby/object:Gem::Dependency
119
+ name: i18n-tasks
120
+ requirement: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ type: :development
126
+ prerelease: false
127
+ version_requirements: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
112
132
  description: ''
113
133
  email:
114
134
  - cvilla100@gmail.com
@@ -127,7 +147,18 @@ files:
127
147
  - app/helpers/blacklight/locale_picker/locale_helper.rb
128
148
  - app/views/shared/_locale_picker.html.erb
129
149
  - blacklight-locale_picker.gemspec
150
+ - config/i18n-tasks.yml
151
+ - config/locales/locale_picker.ar.yml
152
+ - config/locales/locale_picker.de.yml
130
153
  - config/locales/locale_picker.en.yml
154
+ - config/locales/locale_picker.es.yml
155
+ - config/locales/locale_picker.fr.yml
156
+ - config/locales/locale_picker.hu.yml
157
+ - config/locales/locale_picker.it.yml
158
+ - config/locales/locale_picker.nl.yml
159
+ - config/locales/locale_picker.pt-BR.yml
160
+ - config/locales/locale_picker.sq.yml
161
+ - config/locales/locale_picker.zh.yml
131
162
  - lib/blacklight/locale_picker.rb
132
163
  - lib/blacklight/locale_picker/engine.rb
133
164
  - lib/blacklight/locale_picker/version.rb
@@ -145,14 +176,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
145
176
  requirements:
146
177
  - - ">="
147
178
  - !ruby/object:Gem::Version
148
- version: '0'
179
+ version: 2.5.0
149
180
  required_rubygems_version: !ruby/object:Gem::Requirement
150
181
  requirements:
151
182
  - - ">="
152
183
  - !ruby/object:Gem::Version
153
184
  version: '0'
154
185
  requirements: []
155
- rubygems_version: 3.0.3
186
+ rubygems_version: 3.1.2
156
187
  signing_key:
157
188
  specification_version: 4
158
189
  summary: ''