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

fix issues with RDoc generation #698

Merged
merged 1 commit into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/i18n.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def eager_load!
# or <tt>default</tt> if no translations for <tt>:foo</tt> and <tt>:bar</tt> were found.
# I18n.t :foo, :default => [:bar, 'default']
#
# *BULK LOOKUP*
# <b>BULK LOOKUP</b>
#
# This returns an array with the translations for <tt>:foo</tt> and <tt>:bar</tt>.
# I18n.t [:foo, :bar]
Expand All @@ -180,7 +180,7 @@ def eager_load!
# E.g. assuming the key <tt>:salutation</tt> resolves to:
# lambda { |key, options| options[:gender] == 'm' ? "Mr. #{options[:name]}" : "Mrs. #{options[:name]}" }
#
# Then <tt>I18n.t(:salutation, :gender => 'w', :name => 'Smith') will result in "Mrs. Smith".
# Then <tt>I18n.t(:salutation, :gender => 'w', :name => 'Smith')</tt> will result in "Mrs. Smith".
#
# Note that the string returned by lambda will go through string interpolation too,
# so the following lambda would give the same result:
Expand All @@ -192,7 +192,7 @@ def eager_load!
# always return the same translations/values per unique combination of argument
# values.
#
# *Ruby 2.7+ keyword arguments warning*
# <b>Ruby 2.7+ keyword arguments warning</b>
#
# This method uses keyword arguments.
# There is a breaking change in ruby that produces warning with ruby 2.7 and won't work as expected with ruby 3.0
Expand Down
16 changes: 8 additions & 8 deletions lib/i18n/backend/simple.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ module Backend
# The implementation is provided by a Implementation module allowing to easily
# extend Simple backend's behavior by including modules. E.g.:
#
# module I18n::Backend::Pluralization
# def pluralize(*args)
# # extended pluralization logic
# super
# end
# end
#
# I18n::Backend::Simple.include(I18n::Backend::Pluralization)
# module I18n::Backend::Pluralization
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize technically one space would suffice, but four seemed better for reading the docs inline so that the indentation is clearly intentional. LMK if it should be done differently.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this will work how you want it to :)

# def pluralize(*args)
# # extended pluralization logic
# super
# end
# end
#
# I18n::Backend::Simple.include(I18n::Backend::Pluralization)
class Simple
module Implementation
include Base
Expand Down