rails-i18n Questions
4
Solved
In Rails i18n, how to get all values for a certain key using the following:
translations = I18n.backend.send(:translations)
get all the keys
I need to be able to get a certain section for examp...
Bloodthirsty asked 1/2, 2013 at 12:4
6
I was in my Ubuntu home directory, trying to create a new rails app with rails new, but I got this error:
The i18n gem is not available. Please add it to your Gemfile and run bundle install
An...
Status asked 14/1, 2018 at 23:45
1
Solved
In rails 6.1.6.1 I have the following deprecation warning
DEPRECATION WARNING: action_view.raise_on_missing_translations is deprecated and will be removed in Rails 7.0. Set i18n.raise_on_missing_tr...
Inconceivable asked 17/8, 2022 at 8:22
8
Solved
I want to be able to translate pluralized strings in i18n in rails. A string can be :
You have 2 kids
or
You have 1 kid
I know that I can use pluralize helper method, but I want to embed this...
Hexamethylenetetramine asked 29/5, 2011 at 5:6
6
Solved
I18n.translate can translate error.messages like this:
I18n.translate('error.messages.taken')
-> has already been taken
But there are some error messages that contains arguments like:
I18n.t...
Waterfront asked 7/9, 2016 at 12:42
2
Solved
I use Rails 4 with the Rails-i18n Gem and i want replace my hard coded string "300px" with a placeholder in my language translation file like %{minimum_resolution} in config/locales/de.yml
activ...
Edom asked 9/10, 2015 at 14:51
3
Solved
Writing a fully translated app can become tedious. Is there a way to set a default translation scope for the current context ?
Example : I am writing inside a partial _deadlines.html.erb in the sh...
Ics asked 18/2, 2015 at 23:22
6
Solved
some of our devs (me included) don't always take it serious to put text in a localization file, result is a lot of hardcoded texts scattered around a lot of views.
I'm wondering if any of you has ...
Mayenne asked 17/2, 2017 at 9:17
3
Solved
My locale file has become unwieldy with a bunch of nested keys. Is there a way to get a list of all available locale keys, or all locale keys from a single locale file?
For eg.
en:
car:
honda:
...
Towrope asked 15/6, 2016 at 18:6
4
I want to seed the database with Faker, the problem is that I am getting an error when I do a:
rake db:reset
I get this message:
rake aborted!
I18n::MissingTranslationData: translation missing:...
Hyams asked 11/5, 2015 at 19:21
3
Solved
Without translation, this would get me today's day name:
Date.today.strftime("%A")
How would I localize it?
I.e. "Mardi" if I18n.locale is set to fr.
Glide asked 12/11, 2015 at 15:11
2
Solved
How do I set a fallback locale in Rails 5.2?
Right now it prints ''(blank) for attribute names if not found in locale. I would like it to fallback to :en when that happens.
Rails 5 specific?
# ...
Intersex asked 20/11, 2018 at 17:21
6
Solved
I am getting an "translation missing" error message from Rails 3:
activerecord:
notices:
messages:
success:
create: "Something was created"
models:
user:
success:
creat...
Waterloo asked 19/11, 2010 at 9:50
1
Solved
Context: For a Ruby on Rails app for bike rentals, I am using the gem globalize to deal with input :description in different languages.
Curent state: The globalize implementation worked, dependin...
Arterial asked 14/2, 2020 at 11:12
3
Solved
in my project i have controller in namespace admin and I'm using breadcrumbs_on_rails to build breadcrums. My controller looks like:
module Admin
class FaqsController < Admin::ApplicationContro...
Chesterfield asked 19/2, 2014 at 11:6
1
Solved
I use two languages for a site, English and Danish.
1) I have a list of links that look like this:
<%= link_to html_viewer_url(activity.course, activity), target: '_blank' do %>
<%= t('...
Demonstrator asked 31/7, 2018 at 10:12
5
Solved
I just updated to rails 4.0.2 and I'm getting this warning:
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale y...
Harold asked 3/12, 2013 at 20:52
1
We are introducing Vue.js to manage front end. At the same time we are considering moving to an other way to manage I18n within the whole application stack.
The initial planned solution was to use...
Guy asked 23/2, 2018 at 15:1
9
Solved
Working on a rails 3 app where I want to check if a translation exists before outputting it, and if it doesn't exist fall back to some static text. I could do something like:
if I18n.t("some_trans...
Bourdon asked 10/9, 2012 at 14:7
2
Solved
I have a rails 3.2 application.
It has 2 locales ko & en.
ko is the default but I want it to fallback to en if it's not available.
The fallback works in development env but not in production en...
Lentamente asked 9/8, 2013 at 22:54
3
Solved
For example if I have YAML file with
en:
questions:
new: 'New Question'
other:
recent: 'Recent'
old: 'Old'
This would end up as a json object like
{
'questions.new': 'New Question',
'qu...
Gatha asked 22/10, 2013 at 0:46
2
Solved
I would like to translate my rails application in two languages, french and english but got some problem. I've got the following error:
"fr" is not a valid locale
In my config/application.rb:
I...
Melvin asked 19/11, 2015 at 17:41
3
Solved
This might be I18n-ception but lets say I have an en.yml file as below
en:
my_var: Foo
my_message: "This is a message where I'd like to interpolate I18n's %{my_var}"
Is there a way to indicate...
Charente asked 13/1, 2013 at 18:4
2
I get a I18n::InvalidLocale: "zh-CN" is not a valid locale exception that I want to avoid.
To solve it, I have heard of two hacks:
# meh
config.i18n.enforce_available_locales = false
# Ever hear...
Reluct asked 25/9, 2015 at 8:41
2
I have a date which works fine when using it as English
> Date.strptime("Aug 02, 2015", "%b %d, %Y")
Sun, 02 Aug 2015
However when I use it another language es, that doesnt work. E.g.
> D...
Thaliathalidomide asked 7/9, 2017 at 21:35
1 Next >
© 2022 - 2025 — McMap. All rights reserved.