Questions tagged [globalize3]

Globalize3 is a popular Ruby on Rails extension that aids development of the global-ready web applications.

Globalize3 is a popular Ruby on Rails extension that aids development of the global-ready web applications.

Globalize3 is the successor of Globalize for Rails and is targeted at ActiveRecord version 3.x. It is compatible with and builds on the new I18n API in Ruby on Rails and adds model translations to ActiveRecord.

Globalize3 is much more lightweight and compatible than its predecessor. Model translations in Globalize3 use default ActiveRecord features and no longer limit any ActiveRecord functionality.

83 questions
10
votes
3 answers

undefined method `create_translation_table!'

I have a new rails engine and I want to use globalize3. I did this in my lib//engine.rb : require 'globalize3' module SimpleCms class Engine < ::Rails::Engine end end Now, I try to create a migration like this : class CreatePages <…
Dougui
  • 7,142
  • 7
  • 52
  • 87
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
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…
6
votes
2 answers

Simple search on a Globalize3 table in Rails

I am looking to implement a simple search function while using the globalize3 gem for Ruby on Rails. Since the translations of the model are stored in a separate table, the code below doesn't work as there is no longer a :name field in the products…
diasks2
  • 2,033
  • 2
  • 36
  • 61
5
votes
2 answers

ActiveRecord StatementInvalid when getting data with globalize3

When I'm trying to get all Audio songs by specified artist, I get error: ActiveRecord::StatementInvalid: PGError: ERROR: column reference "artist" is ambiguous LINE 1: ... AND (audio_translations.artist IS NOT NULL) AND (artist = '... …
NARKOZ
  • 27,203
  • 7
  • 68
  • 90
5
votes
3 answers

How to avoid Globalize3 from returning fallback translations for an attribute into a specific context?

I'm working in the internationalization/localization of web site using Globalize3 and easy_globalize_accesors and right now I'm adapting the forms to manage fields with possible translations. Suppose I have a class named Role: class Role …
5
votes
0 answers

Rails: friendly_id & globalize not checking translation tables for conflicts

I'm using friendly_id (4.10.1) and globalize (3.0.0) in my Rails 3.2.14 app: # globalize3 translates :title, :slug # friendly_id extend FriendlyId friendly_id :title, use: [:slugged, :globalize] When I save my inputs, friendly_id checks for…
Railsana
  • 1,813
  • 2
  • 21
  • 30
5
votes
0 answers

Rails fixtures don't seem to store values in Globalize3 translation tables

I have a Rails 3.2.7 project using Globalize3 0.3.0 It seems that if you make a fixture for a model with an attribute that is translated with Globalize3, the fixture will populate the model's table in the database, but not the translation table…
4
votes
2 answers

Rails, Globalize3 check if translated attributes changed?

In Rails we can check if a model attribute is changed, using obj.field_changed?. Say I have a model that uses Globalize3. It has translates :name How can I check if the name attribute got changed? Something like obj.name_changed?
Muntasim
  • 6,689
  • 3
  • 46
  • 69
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
4
votes
2 answers

Globalize3 order records by translated attributes and taking fallbacks into consideration

Im having troubles with awesome Globalize3 gem. For now I`m having two languages :en and :ru. And :ru falls back to :en like this #/config/initializers/globalize.rb Globalize.fallbacks = {:ru => [:ru, :en]} In my controller I am trying to sort the…
prikha
  • 1,853
  • 1
  • 16
  • 26
4
votes
3 answers

How to make localized Paperclip attachments with Globalize3?

I have a project using Paperclip gem for attachments and Globalize3 for attribute translation. Records need to have a different attachment for each locale. I though about moving Paperclip attributes to translation table, and that might work, but I…
4
votes
1 answer

How to validate translated data?

I am using Ruby on Rails (3.2.2), globalize3 (0.2.0) and batch_translations (0.1.2) ruby-gems. I would like to validate translated data handled by globalize3 as well as it should be. That is, for example, if... ... in my…
Backo
  • 18,291
  • 27
  • 103
  • 170
3
votes
1 answer

form_for mixing id and locale parameters

I'm trying to get Globalize3 working on my app. I have the toy projet of blog posts, that I want to translate. My urls look like this : localhost/en/posts localhost/fr/posts Here's how I do it in my ApplicationController before_action…
Pacane
  • 20,273
  • 18
  • 60
  • 97
3
votes
2 answers

Trouble upgrading Ruby on Rails from version 3.2.13 to 4.0.0

For a my application I am trying to upgrade Ruby on Rails from version 3.2.13 to 4.0.0 and I am in trouble when installing / updating some gem (by using the Bundler), specifically the globalize3 gem. I am running Ruby 2.0.0-p247. Given my Gemfile…
Backo
  • 18,291
  • 27
  • 103
  • 170
1
2 3 4 5 6