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
2
votes
1 answer

Rails :: Generate slugs with FriendlyId, Globalize and slug_candidates

I am building a Rails application and I am stuck when generating slug for an article with the second locale defined. For the main locale (french), it checked if an article already have the title and if it’s the case add an integer (id) at the end…
anthony
  • 640
  • 1
  • 10
  • 32
2
votes
1 answer

Rails globalize + friendly id

I have a problem with globalize and friendly_id. The site has 2 languages Ru and En. Gem friendly_id, globalize and friendly_id-globalize configured and work. If I change the language from Russian to English, all is…
alexin
  • 243
  • 1
  • 15
2
votes
0 answers

Globalize and ElasticSearch integration questions

I use elasticsearch, just installed globalize gem (https://github.com/globalize/globalize#i18n-fallbacks-for-empty-translations) with OneIndexPerLanguage class included and I have the following Product model: class Product < ActiveRecord::Base …
Miroslav
  • 158
  • 2
  • 22
2
votes
0 answers

How globalize gem decides which content goes to translated table?

In my rails 4.2 app I have set it as the default locale by setting it in config/application.rb: config.i18n.default_locale = :it I have a simple "product" model class Product < ActiveRecord::Base translates :name, :description end My need is…
kranz
  • 599
  • 1
  • 6
  • 23
2
votes
0 answers

Issue with paperclip-globalize and activeadmin

I am trying to setup a multi language form upload in activeadmin. My goal is to be able to upload a different pdf file depending on the locale (french and english). I created a "Resume" model and setup the paperclip and translate attributes as…
anthony
  • 640
  • 1
  • 10
  • 32
2
votes
0 answers

In Rails with Globalize, update seems to ignore empty string fields

I am very new to Rails and I am facing a somehow weird problem, and my googling didn't helped me so far... I have implemented a classical CRUD ressource following the Getting Started with Rails guide and I am blocking on the "update"…
VooDooS
  • 156
  • 6
2
votes
2 answers

RSpec + factory_girl + Globalize bug?

I am having an annoying issue with using Globalize + RSpec + factory_girl. I have a model with an attribute translated, and when creating factories using factory_girl the issue occurs. The code explains it perfectly: Translation migration: def…
2
votes
3 answers

Get an array of many objects associations

I didn't know exactly how to find an understandable title so I'll try my best to explain my problem. I have 2 models: - Country translatable with globalize, with a name and many regions - Region belongs_to country What I would like to do is geting…
Ugo Mare
  • 442
  • 5
  • 15
2
votes
0 answers

rake db:migrate fails with globalize gem and rails 4.1.7

I'm trying to use the globalize gem with Rails 4.1.7. Using latest RVM version, os is Ubuntu 12.04, db is postgresql 9.3. Following the instructions found in readme.md on github i added the translates directive in my model and scaffolded a…
kranz
  • 599
  • 1
  • 6
  • 23
2
votes
1 answer

What steps are involved when adding Globalize to my Rails Project

I have a rails project that needs to be multi-lingual. I ran into a few issues while enabling globalize for my rails project. I was wondering if there is a thorough checklist / recipe for enabling internationalisation for a rails app. Please note…
Besi
  • 22,579
  • 24
  • 131
  • 223
2
votes
4 answers

Validate uniqueness of globalized field

I have a model with translated fields using the globalize gem and globalize-accessors gem for providing localized attributes such as name_en, name_zh_hk for a localized name field. for example: class Person < ActiveRecord::Base translates :name …
PeterWong
  • 15,951
  • 9
  • 59
  • 68
2
votes
1 answer

How to save multiple translation from 1 object without to reset I18n.locale with Globalize?

I'm trying to set my controller to save multiple languages with an object like this: { text: { fr: "francais", en: "English" } }
2
votes
2 answers

Globalize gem and Rails 4 strong parameters

I am using rails 4.0.2 and globalize 4.0.0.alpha.3, but i can not get the thing to write the data into the translation databases with a list of strong parameters. I have an offer model and a concern (OfferTranslationConcern) class Offer <…
2
votes
4 answers

gem globalize3 on rails 4

Someon are using globalize3 with rails4. How you configure it? i tryed to install, on my Gemfile: gem 'globalize3', github: 'svenfuchs/globalize3', branch: 'rails4' but i have these errors: Bundler could not find compatible versions for gem…
easteregg
  • 149
  • 9
1
vote
1 answer

Rails Globalize - Eager Load Specific Translations by Locale

So I have a model in Rails, with globalize installed and configured: model.rb class Model < ApplicationRecord include TranslationWrites translates :column ... end I want to Eager Load "English" and "French" translations only, to prevent an…
Tim Lewis
  • 27,813
  • 13
  • 73
  • 102
1 2
3
8 9