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.

134 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
  • 489
  • 5
  • 20
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
  • 2,903
  • 7
  • 58
  • 114
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,386
  • 1
  • 19
  • 27
4
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,845
  • 3
  • 35
  • 63
4
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
  • 1,174
  • 12
  • 17
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
  • 14,328
  • 21
  • 91
  • 174
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
  • 277
  • 1
  • 5
  • 17
4
votes
1 answer

rails_admin_globalize_field support to file upload for globalized translations

I am using globalize gem for some locales. I have added a field in translation that saves different image for different locales. Rails admin globalize field only supports for string and it doesn't provide any option to upload a file. How can I…
Jaswinder
  • 1,455
  • 14
  • 27
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
  • 3,009
  • 4
  • 30
  • 32
4
votes
1 answer

Switch locale on current page rails

i'm currently working on a project which has 2 different locals (nl/fr). We're facing this problem : How can I get the translated url for the current page when I display fr/nl button I'm currently working with friendly_id and globalize we've tried…
Thounder
  • 315
  • 2
  • 14
4
votes
1 answer

Enter field value in different languages in Rails

I'm writing an application that will be accessed by users of different languages. As I understand, the standard way to localize Rails app is to use gems i18n (localize static text) and globalize (localize db field values). These gems work fine and…
xaxa
  • 1,057
  • 1
  • 24
  • 53
1
2 3
8 9