782 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
28
views
:en is not a valid locale when running "rails generate ims_lti:install"
I'm pretty inexperienced with both stackoverflow and Ruby. Please help me to help you to help me.
I'm trying to implement ims-lti in an open source Rails application. When I run rails generate ims_lti:...
0
votes
1
answer
73
views
Defining translations for nested forms in namespaced resources
I have the below setup
class BudgetLine < ApplicationRecord
has_many :budget_line_items
accepts_nested_attributes_for :budget_line_items
end
class BudgetLine::Accommodation < BudgetLine
end
...
1
vote
1
answer
348
views
Reserved key when using I18n-tasks add-missing
I'm developing a ruby on rails app.
I've been using the i18n-tasks gem from the start.
My "i18n-tasks add-missing" command has never caused any problems, I haven't used it for 2-3 weeks, ...
0
votes
2
answers
476
views
Rails I18n pluralization without an explicit count number
Rails provides a built-in pluralization method for String, e.g., "apple".pluralize returns "apples" and "apple".pluralize(1) does "apple" (see this question). ...
1
vote
1
answer
547
views
wrong number of arguments (given 2, expected 1) in Rails
module ApplicationHelper
def t(*a)
translate(*a)
end
end
Case 1 :- t('views.home.welcome_updated', default: 'Updated') => Getting Error: (wrong number of arguments (given 2, expected 1))
...
0
votes
1
answer
447
views
In ruby View Components, is possible to access parent translation from child?
I am using view component in rails project. I want use translation from my parent inside a child.
For now, I have this:
components
└─ a
├─ component.rb
├─ component.html.erb
├─ component.yml
...
0
votes
1
answer
49
views
Why won't Rails' with_locale method allow additional URL parameters?
I've got this Mailer in my Rails 7 project:
# app/mailers/quote_mailer.rb
class QuoteMailer < ApplicationMailer
def quote_mail(quote)
@quote = quote
@user = quote.user
@client = ...
0
votes
2
answers
175
views
I18n interpolate with json
I have the following text in my en.yml
update_message: "The user updated device's name to <b>%{name}</b>"
and I have the following json object
{ "user": { "id&...
0
votes
1
answer
30
views
Abriviated I18n months coming back blank
Somehow, my abbreviated months are coming back blank.
Failure:
MessageDecoratorTest#test_it_will_show_date_without_year_if_it's_same_year [/opt/vanadium-web/test/decorators/message_decorator_test.rb:...
2
votes
1
answer
594
views
Why does `1.ordinalize` work in locales :en & :fr but not in :de in Ruby on Rails with rails-i18n gem?
In Ruby on Rails the ordinalize method does not work in the :de locale. The error given is:
> 1.ordinalize
=> "translation missing: de.number.nth.ordinalized"
It is easy to reproduce ...
1
vote
1
answer
317
views
I18n "format" for errors won't change
Here is my en.yml config (Rails 7)
en:
hello: "Hello world"
activerecord:
models:
user:
one: "User"
other: "Users"
attributes:
...
1
vote
1
answer
647
views
LoadError: cannot load such file -- i18n/core_ext/hash
I am working on multiple projects, when I switch from one project to another, compile the assets using:
➜ rails assets:precompile
Ruby: 2.7.5
Rails: 6.0
What I get is:
/Users/luqman/.rvm/rubies/ruby-...
0
votes
1
answer
77
views
Rails I18n ActiveRecord model attributes after migration
I started creating an app, and planned out my basic scaffolding. Let's say I created this resource:
rails g scaffold CircusAnimal fieldOne:string fieldTwo:string
I'm using Rails I18n to translate the ...
0
votes
0
answers
138
views
Safety and translation of query params in Ruby on Rails
I have a two part question. I'm passing params to links in order to sort and filter in my Ruby on Rails app. Is this type of resulting url safe?
/realestates?column=salesprice&direction=desc
If ...
1
vote
0
answers
35
views
Issue with Rails 5.2.4 translation method
The index view pushed by the Scheduler::ProductionJobsController index method contains the following request to the translation method:
<h2> <%= t('.View') %> </h2>
The config\...