Conversation
Author
|
It uses the key |
ocarreterom
reviewed
Mar 11, 2025
Comment on lines
+71
to
+75
| begin | ||
| rules[:format] ||= I18n.t :format, scope: "number.currency.format", raise: true | ||
| rescue I18n::MissingTranslationData | ||
| # Do nothing | ||
| end |
There was a problem hiding this comment.
Maybe this code could be move to determine_format_from_formatting_rules since :symbol_position, :symbol_before_without_space and :symbol_after_without_space are deprecated options.
Something like:
def determine_format_from_formatting_rules(rules)
begin
I18n.t :format, scope: "number.currency.format", raise: true
rescue I18n::MissingTranslationData
return currency.format if currency.format && !rules.has_key?(:symbol_position)
symbol_position = symbol_position_from(rules)
if symbol_position == :before
rules.fetch(:symbol_before_without_space, true) ? '%u%n' : '%u %n'
else
rules[:symbol_after_without_space] ? '%n%u' : '%n %u'
end
end
end
Member
|
Hi there @TastyPi, any chance of having another look at this PR? 🙏🏻 |
Author
|
@sunny I'm not currently using Ruby for work, so it's unlikely I'll find capacity any time soon. Feel free to take it over from me. |
Member
Member
|
Oh yes indeed! 🧹 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's changing?
Allow the default format for a language be configured via I18n.
Why?
Fixes #233 (which was closed with no solution).
This is blocking us from launching our product in France.