solidus_core 3.2.0.alpha → 3.2.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1b866f15d9df0394383e7f634858ee99f21ed214e8fae6928af514a6421ddbc
4
- data.tar.gz: d2f5c689bf6debe86f5b9be575eea7640e496606f8933b85a1d2e7a2cb90123c
3
+ metadata.gz: 544b2bfea9af16a2ae309c6eb5b4d2038b60cf592b461b9019d66933324cbab8
4
+ data.tar.gz: 36312a6f1b0b979c06e68125199834650b0f5fea1ee65af092136527b4121978
5
5
  SHA512:
6
- metadata.gz: df2acde7ab4aa4b01e3d5b187b6c47a911714c868237a1ba494095a43bdd07bac5082e2080d4aabc563576d502fecda0d28a94b9cef53db8e6c1e1c89a0cbc97
7
- data.tar.gz: c183f6200f52b585a4ae391bd8b412c6a4f58e987fcc6ceb3cd1cf6835b92b1019f6077e4a13c75dbe6a4c0dd64c81fe7c4d8d3deeed2b8fbadc67ed74148cb5
6
+ metadata.gz: 4c5bbfc5dacae815c6ce863d2c807d2a4e49c448912f3c8e9f5e8901b5aa1b1c2e8d3bdeeea3ea3e76d116b66e6aa6e9eba307471023f44ed61806eaa3b662c6
7
+ data.tar.gz: 816d06788b22c4fe4b02780e0d640ba8f56a0186371ddbcf2e40cac9695a4f697e3a131cbc6d893321e42c741f27d63c48e7ce604958da5ed37957db451a5bfc
@@ -90,6 +90,21 @@ module Spree
90
90
  orders.none?
91
91
  end
92
92
 
93
+ # Updates the roles in keeping with the given ability's permissions
94
+ #
95
+ # Roles that are not accessible to the given ability will be ignored. It
96
+ # also ensure not to remove non accessible roles when assigning new
97
+ # accessible ones.
98
+ #
99
+ # @param given_roles [Spree::Role]
100
+ # @param ability [Spree::Ability]
101
+ def update_spree_roles(given_roles, ability:)
102
+ accessible_roles = Spree::Role.accessible_by(ability)
103
+ non_accessible_roles = Spree::Role.all - accessible_roles
104
+ new_accessible_roles = given_roles - non_accessible_roles
105
+ self.spree_roles = spree_roles - accessible_roles + new_accessible_roles
106
+ end
107
+
93
108
  private
94
109
 
95
110
  def check_for_deletion
@@ -55,7 +55,7 @@ module Spree
55
55
 
56
56
  def display_country
57
57
  if country_iso
58
- "#{country_iso} (#{country.name})"
58
+ "#{country_iso} (#{I18n.t(country_iso, scope: [:spree, :country_names])})"
59
59
  else
60
60
  I18n.t(:any_country, scope: [:spree, :admin, :prices])
61
61
  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: [es, fr]
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
+
23
+ # Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom:
24
+ # `i18n-tasks normalize -p` will force move the keys according to these rules
25
+ write:
26
+ ## For example, write devise and simple form keys to their respective files:
27
+ # - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml']
28
+ ## Catch-all default:
29
+ # - config/locales/%{locale}.yml
30
+
31
+ # External locale data (e.g. gems).
32
+ # This data is not considered unused and is never written to.
33
+ external:
34
+ ## Example (replace %#= with %=):
35
+ # - "<%#= %x[bundle info vagrant --path].chomp %>/templates/locales/%{locale}.yml"
36
+
37
+ ## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class.
38
+ # router: conservative_router
39
+
40
+ yaml:
41
+ write:
42
+ # do not wrap lines at 80 characters
43
+ line_width: -1
44
+
45
+ ## Pretty-print JSON:
46
+ # json:
47
+ # write:
48
+ # indent: ' '
49
+ # space: ' '
50
+ # object_nl: "\n"
51
+ # array_nl: "\n"
52
+
53
+ # Find translate calls
54
+ search:
55
+ ## Paths or `File.find` patterns to search in:
56
+ # paths:
57
+ # - app/
58
+
59
+ ## Root directories for relative keys resolution.
60
+ # relative_roots:
61
+ # - app/controllers
62
+ # - app/helpers
63
+ # - app/mailers
64
+ # - app/presenters
65
+ # - app/views
66
+
67
+ ## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting:
68
+ ## %w(*.jpg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less *.yml *.json)
69
+ exclude:
70
+ - app/assets/images
71
+ - app/assets/fonts
72
+ - app/assets/videos
73
+
74
+ ## Alternatively, the only files or `File.fnmatch patterns` to search in `paths`:
75
+ ## If specified, this settings takes priority over `exclude`, but `exclude` still applies.
76
+ # only: ["*.rb", "*.html.slim"]
77
+
78
+ ## If `strict` is `false`, guess usages such as t("categories.#{category}.title"). The default is `true`.
79
+ # strict: true
80
+
81
+ ## Multiple scanners can be used. Their results are merged.
82
+ ## The options specified above are passed down to each scanner. Per-scanner options can be specified as well.
83
+ ## See this example of a custom scanner: https://github.com/glebm/i18n-tasks/wiki/A-custom-scanner-example
84
+
85
+ ## Translation Services
86
+ # translation:
87
+ # # Google Translate
88
+ # # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate
89
+ # google_translate_api_key: "AbC-dEf5"
90
+ # # DeepL Pro Translate
91
+ # # Get an API key and subscription at https://www.deepl.com/pro to use DeepL Pro
92
+ # deepl_api_key: "48E92789-57A3-466A-9959-1A1A1A1A1A1A"
93
+
94
+ ## Do not consider these keys missing:
95
+ ignore_missing:
96
+ - 'number.currency.format.separator'
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}']] %>