-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Freeze the "." character used in comparisons #181
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ rdoc | |
*.sqlite3 | ||
*.gem | ||
.ruby-* | ||
.idea/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,9 @@ module Localization | |
include DefaultConversions | ||
|
||
class << self | ||
|
||
DOT = ".".freeze | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trailing whitespace detected. |
||
def backend | ||
@backend ||= i18n_present? ? Backend::I18n : Backend::Internal | ||
end | ||
|
@@ -36,7 +39,7 @@ def store_translations(locale, scope, data) | |
end | ||
|
||
def translate(scope, key, options = {}) | ||
return if key == "." # I18n doesn't support dots as translation keys so we don't either | ||
return if key == DOT # I18n doesn't support dots as translation keys so we don't either | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [95/80] |
||
|
||
locale = options[:locale] || self.locale | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,9 +78,11 @@ module DefaultConversions | |
} | ||
|
||
class << self | ||
%w{characters currencies html_entities transliterations vulgar_fractions}.each do |conversion_type| | ||
define_method conversion_type do | ||
const_get conversion_type.upcase | ||
# %w{characters currencies html_entities transliterations vulgar_fractions} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [83/80] |
||
|
||
[['characters'.freeze, 'CHARACTERS'.freeze], ['currencies'.freeze, 'CURRENCIES'.freeze], ['html_entities'.freeze, 'HTML_ENTITIES'.freeze], ['transliterations'.freeze, 'TRANSLITERATIONS'.freeze], ['vulgar_fractions'.freeze, 'VULGAR_FRACTIONS'.freeze]].each do |conversion_type| | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line is too long. [284/80] |
||
define_method conversion_type[0] do | ||
const_get conversion_type[1] | ||
end | ||
end | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra empty line detected at class body beginning.