Questions tagged [rails-i18n]

Repository for collecting Locale data for Ruby on Rails I18n as well as other interesting, Rails related I18n stuff.

About

The Ruby I18n (shorthand for internationalization) gem which is shipped with Ruby on Rails (starting from Rails 2.2) provides an easy-to-use and extensible framework for translating your application to a single custom language other than English or for providing multi-language support in your application.

The process of "internationalization" usually means to abstract all strings and other locale specific bits (such as date or currency formats) out of your application. The process of "localization" means to provide translations and localized formats for these bits.

Links:

  1. Homepage
  2. Guide
778 questions
0
votes
1 answer

Rails creating deletion link for redis entry

Here is my issue: I am setting up internationalization on my site (so we can have multiple translations of the text on the pages). I have followed a rails cast to set up a page that can manage the translations instead of me manually having to edit…
Alan DeLonga
  • 454
  • 1
  • 10
  • 27
0
votes
0 answers

Searching through I18n yml files on Rails

I am using Rails 3.2 with I18n for my translations. I offer my clients a search functionality, but in some cases what they want to search is in my translation file and not in the database. A good example of this is Countries, where I want users to…
Theo Scholiadis
  • 2,316
  • 2
  • 22
  • 33
0
votes
1 answer

How do I add translations to an Active Model

I have this model: class Coupon include ActiveModel::Validations include ActiveModel::Conversion extend ActiveModel::Naming attr_accessor :id def initialize(attributes = {}) attributes.each do |name, value| send("#{name}=",…
Nerian
  • 15,901
  • 13
  • 66
  • 96
0
votes
1 answer

How to display different text when user change menu option?

I am checking this example. Actually, it changes the text when user clicks the button (in other language ). But what if user has 3 different languages? (some type of menu option) and on change the option it changes the text. I have name(in english)…
user2648752
  • 2,123
  • 5
  • 21
  • 29
0
votes
1 answer

i18n for a has_many through self-referential

I don't pretend to begin understanding i18n and have not had to use it often but here is the concept. My User class: class User < ActiveRecord::Base has_many :parent_relationships, class_name: 'UserRelationship', foreign_key: 'parent_id' …
engineersmnky
  • 25,495
  • 2
  • 36
  • 52
0
votes
1 answer

Rails country_select for locale name - 'en-GB' not 'gb'

I'm currently using the country_select gem for users profiles. With the locales you can have :en, :en-Us, :en-GB and I see to change the current locale you can do I18n.locale =. So lets say I need to select 'United Kingdom' from the country_select,…
Peter
  • 749
  • 10
  • 27
0
votes
1 answer

simple_form seems not to raise exception when i18n translation is missing?

I use the trick I18n.exception_handler = :just_raise_that_exception as described in How to enable Rails I18n translation errors in views? For some reason simple_form labels "escape" from this mechanism. Is it possible to also use this trick to…
Danny
  • 5,945
  • 4
  • 32
  • 52
0
votes
1 answer

Rails 4 - My current_user logic is not working properly - Michael Hartl Rails 4.0 Tutorial

I am rewriting one of my Rails applications in Rails 4 using Ruby 2. My original one used the 3.2 version of Michael Hartl's Ruby on Rails Tutorial. I am copying the 3.2 version of my application to my new Rails 4 version. It appears that…
0
votes
1 answer

Ruby on Rails 3.2.13 - Getting Error With Custom Error Pages Using I18n

I have a Rails 3.2.13 application where I originally used the routing-filter gem for I18n. I plan to rewrite it in Rails 4. I removed the gem since there is no Rails 4 production version available and I could not get the beta version to work. I…
0
votes
2 answers

Ruby on Rails domain locale

I have a website with 2 languages. I want to create a subdomain for each locale. For example: en.site.com and fr.site.com. I've googled, but no luck. I've only found solutions that extract locale name from query, for example: site.com/en/post/1 How…
Dima Knivets
  • 2,418
  • 7
  • 28
  • 40
0
votes
1 answer

Rails translation - correct way to use html safe translations

Consider my translation key en: test: "This is a test with %{another_variable} to explain translation" another_variable: "some text" I wanted to bold the contents of the test key from "test with %{another_variable} to". I can do this by including…
rajkumarts
  • 399
  • 1
  • 7
  • 20
0
votes
1 answer

How to pass an empty value to find_translation method in I18n gem in ruby on rails

I'm working on a multi-language project. I'm using I18n gem for localization purposes. In some point I want to pass an empty value like following: current_locale("") Where the current_locale() function is def current_locale(locale) if…
Mujahid
  • 1,227
  • 5
  • 32
  • 62
0
votes
1 answer

Rails, How does copycopter scan views for translations?

Can anyone point me to the code that CopyCopter uses to scan views for translations? I considered using CopyCopter as my i18n back end but it has proved too problematic to upgrade it to Rails 4, perhaps when I have more time I'll have a go; So I…
jamesc
  • 12,423
  • 15
  • 74
  • 113
0
votes
0 answers

Looking for a way to handle inline text translations

I am looking for a mechanism that would enable the maintainer of the app, who will mainly be adding text content and images,to add the text directly inline in the erb templates that can be translated through a web interface. I'm thinking that…
jamesc
  • 12,423
  • 15
  • 74
  • 113
0
votes
1 answer

I18n for attribute errors

Does exist a way to do something like this: Model.human_attribute_name :attr but with errors? Something like this... Model.human_error_name :attr, :error For example: Ticket.human_error_name :ticket_type_id, :no_tickets_left I want to avoid this…