We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
t
Bridgetown Version: 1.1.0 Ruby Version: 3.1.0
To Reproduce
# src/_locales/en.yml title_template: "%{title} | My site"
# src/_layouts/default.erb <title><%= t :title_template, title: "Homepage" %></title>
Current behavior
[Bridgetown] Exception raised: ArgumentError [Bridgetown] wrong number of arguments (given 2, expected 0..1) [Bridgetown] 1: /Users/nash/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/i18n-1.12.0/lib/i18n.rb:210:in `translate' [Bridgetown] 2: /Users/nash/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bridgetown-core-1.1.0/lib/bridgetown-core/helpers.rb:115:in `t' [Bridgetown] 3: /Users/nash/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/bridgetown-core-1.1.0/lib/bridgetown-core/ruby_template_view.rb:66:in `method_missing'
The reason is that t uses delegation to I18n.t:
I18n.t
bridgetown/bridgetown-core/lib/bridgetown-core/helpers.rb
Lines 114 to 116 in 2b80b4f
Delegation is tricky to do correctly in order to support both Ruby 2.x and 3.x.
Current workaround
Use I18n.t in templates.
Project wide?
I haven't checked, but maybe there are other places in the project where delegation is used. These should be fixed as well.
The text was updated successfully, but these errors were encountered:
Just noticed the recent (unreleased) PR fixed the issue.
maybe there are other places in the project where delegation is used
That is worth to check anyway.
Sorry, something went wrong.
No branches or pull requests
Bridgetown Version: 1.1.0
Ruby Version: 3.1.0
To Reproduce
Current behavior
The reason is that
t
uses delegation toI18n.t
:bridgetown/bridgetown-core/lib/bridgetown-core/helpers.rb
Lines 114 to 116 in 2b80b4f
Delegation is tricky to do correctly in order to support both Ruby 2.x and 3.x.
Current workaround
Use
I18n.t
in templates.Project wide?
I haven't checked, but maybe there are other places in the project where delegation is used. These should be fixed as well.
The text was updated successfully, but these errors were encountered: