Skip to content
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

Number parser failing with i18n fallbacks #81

Open
airblade opened this issue Apr 1, 2016 · 1 comment
Open

Number parser failing with i18n fallbacks #81

airblade opened this issue Apr 1, 2016 · 1 comment

Comments

@airblade
Copy link

airblade commented Apr 1, 2016

This is the same as #44. Here's a fix:

diff --git a/lib/delocalize/parsers/number.rb b/lib/delocalize/parsers/number.rb
index dc66eb9..bd2715c 100644
--- a/lib/delocalize/parsers/number.rb
+++ b/lib/delocalize/parsers/number.rb
@@ -7,7 +7,8 @@ class Number
       def parse(value)
         return value unless value.is_a?(String)

-        separator, delimiter = I18n.t([:separator, :delimiter], :scope => :'number.format')
+        separator = I18n.t(:separator, :scope => :'number.format')
+        delimiter = I18n.t(:delimiter, :scope => :'number.format')
         value.gsub(delimiter, '').gsub(separator, '.')
       end
     end
@clemens
Copy link
Owner

clemens commented Jul 20, 2016

Sorry for the super late response – I've overlooked the notification for the issue.

I'm happy to merge this if you open a PR that includes both the fix and a failing test case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants