Questions tagged [globalize]

Globalize is the I18n de-facto standard library for model/data translation in Ruby on Rails. It replaces Globalize3 and works with both Rails 3 and Rails 4.

Globalize is the I18n de-facto standard library for model/data translation in Ruby on Rails. It replaces Globalize3 and works with both Rails 3 and Rails 4.

Globalize replaces the (no longer supported) Globalize3 gem and is targeted at ActiveRecord 4.x, but also supports ActiveRecord 3.x. It is compatible with and builds on the I18n API in Ruby on Rails and adds model translations to ActiveRecord.

Major version numbers in Globalize now correspond to those in ActiveRecord, so Globalize 3.x for ActiveRecord 3.x and Globalize 4.x for ActiveRecord 4.x.

137 questions
10
votes
1 answer

Using the gem globalize, how to switch locales for input only and not the whole page?

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, depending on my locale I am able to store description in a…
techquestion
  • 419
  • 1
  • 13
7
votes
1 answer

Redirect same page to different language with Globalize & Friendly_id

I've been scratching my head for the last few hours, looking for an answer but I can't find it anywhere. My gem file: # Use globalize for translating models gem "globalize", github: "ncri/globalize" # for Rails 4.2 gem 'globalize-accessors', '~>…
6
votes
0 answers

Rails 5 and Globalize gem: translation missing

I have a Rails 5 app in which I use Globalize for localization. I'm currently having an issue where I can't save new objects if they don't have any translations. My model looks like this: # Product.rb translates :description,…
Anders
  • 3,065
  • 7
  • 54
  • 106
6
votes
1 answer

Translations of column in same table

I have small table: create_table :cities do |t| t.string :name end I need to internationalize "name" column and I don't want create separate table for this. Is it possible to add columns for translations to "cities" table? In result I want that…
5
votes
1 answer

Rails and Globalize - join translation table of related model in scope

I want to order some records of a model that has a relation to another model (with translated attributes). Here an example: I have a model Project I have a model Task I have the relation Project has_many Tasks The model Task has attribute name…
5
votes
1 answer

Rails 4 and globalize not adding translation

I upgraded to Rails 4 and globalize (instead of globalize3) and translations are not working correctly since. Steps: create english record change the locale to :es then call update_attributes on just created object This used to create a new…
5
votes
2 answers

How to display all translation's fields in one form with globalize and rails 4

How am I supposed to write the forms for my models where I'm using rails 4 and https://github.com/globalize/globalize for translations. i want to display all translations in one form like below example. i have found a solution here…
Murtza
  • 1,356
  • 1
  • 17
  • 27
4
votes
1 answer

How to use Globalize.js to configure culture for client side validation in ASP.NET Core MVC

I having very hard time to configure client side validation in my app. I would like to it be able to accept localized pt-BR inputs. I tried configure the app using at startup: var locale = "pt-BR"; RequestLocalizationOptions localizationOptions =…
Daniel Santos
  • 8,957
  • 15
  • 65
  • 139
4
votes
0 answers

How to get the 3 digit currency code from locale Globalize

I'm trying to use globalize 1.x in my angular project.I want to know whether there is any way to get the 3 digit currency code from the locale .For example if the locale is en-us ,how can i get USD from it .My scenario is i want to use…
dockerrrr
  • 237
  • 1
  • 5
  • 16
4
votes
1 answer

How can I load Globalize translation fixtures to test models?

I'm using the gobalize gem 4.0.3 in Rails 4.1.12. I have a Post model and I've run the Post.create_translation_table! migration supplied by globalize to set up a post_translations table. Now I want to automatically load translations from my fixture…
Dave Nolan
  • 2,969
  • 2
  • 27
  • 32
3
votes
2 answers

globalize and action text

I have application which is using globalize gem and i planning to start using ActionText. So, i have model called Business class Business < ApplicationRecord translates :name, :description globalize_accessors has_rich_text :description end…
Alexey Poimtsev
  • 2,835
  • 3
  • 31
  • 61
3
votes
0 answers

Is i18n globalize fallbacks in Rails 5 a noop?

In both apps there is config.i18n.fallbacks = true in application.rb: Rails.version # "4.2.4" Globalize.fallbacks # [:de] I18n.fallbacks # { :de => [:de] } Rails.application.config.i18n.fallbacks # nil And: Rails.version # "5.0.0.1" Globalize #…
medik
  • 910
  • 11
  • 15
3
votes
2 answers

rails_admin params[:query] in select field is ignored

Can't figure out how to filter nested association belongs to while search in rails admin. I have the following code in my rails_admin config in model. class Painting < ApplicationRecord ... rails_admin do configure :translations, :globalize_tabs …
zhisme
  • 1,540
  • 1
  • 14
  • 20
3
votes
1 answer

Rails - Could not find i18n-0.9.5 in any of the sources

I'm working on a Ruby website using MySQL and I was working on internationalization using Globalize. However, when I run rails g migration create_translation_for_articles The terminal displays the following: Could not find i18n-0.9.5 in any of the…
TamerB
  • 1,095
  • 1
  • 10
  • 23
3
votes
2 answers

Rails - Globalize and Permanent_record dependent: :destroy callbacks

In a Rails 4.2 project I use gem 'permanent_records' to handle records soft-deletion and gem 'globalize' for translations. Globalize sets the following relationships between the translated Model and the Translation Model (source): has_many…
davideghz
  • 3,101
  • 5
  • 19
  • 39
1
2 3
9 10