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

Locale fallback from country to language without having to define each individually

I am localizing an app with the default rails I18n with globalize3 as the back-end. Is it possible to set a locale with a country code (ie :fr-CA) to fallback to its specific language (:fr) before going to the default fallback automatically? I know…
2
votes
1 answer

Sort ActiveRecord query response by Globalize3 translation on an association using locale

I have two models and three tables total which are involved. Unfortunately, some renaming of the models from the original table names has occurred, so pardon the confusion.: Symptom (chief_complaints) SymptomName…
2
votes
1 answer

Seeding translation table that has no model, rails app

I am using the Globalize 3 gem as seen in Ryan Bates railscasts, and everything works fine. I need to know how to seed the data though. Currently, I created a table called monthly_post_translations with the following schema schema.rb create_table…
ruevaughn
  • 1,319
  • 1
  • 17
  • 48
1
vote
2 answers

What gem should I use in order to have all the translations in the DB?

I've played a bit with globalize and rails 3, but from what I'm able to tell, globalize only works for ActiveRecord instances. I'd also like to be able to have the translations for other static pages in the database ( say for example header,footer,…
Geo
  • 93,257
  • 117
  • 344
  • 520
1
vote
0 answers

Ruby on Rails with Globalize3: find by translated field makes record readonly

I´m using rails 3.0.7 with the globalize3 gem. I have the model "Country" with traslated field "title". In the rails console, try to find the record by its translated title like this: gr = Country.find_by_title 'Greece' This returns the correct…
Majiy
  • 1,890
  • 2
  • 24
  • 32
1
vote
2 answers

Are duplicate translations necessary for same strings in Globalize3?

I was hoping to utilize Globalize3 to translate models in a project I'm building. However, trying it out it looks like each model, say Post like: class Post < ActiveRecord::Base translates :title, :body end will be completely independent from…
murrekatt
  • 5,961
  • 5
  • 39
  • 63
1
vote
0 answers

Rails3 & Globalize3 custom translation model

i'm using globalize3 in a rails3 app. I have a model called Book with some attributes to be translated, all working great. I'm trying to write a before_save function to validate changes in the translation object. So i created a model: class…
Phil
  • 11
  • 2
1
vote
1 answer

Dynamically adding paper_trail to translations in Rails5

I have an application that translates some model data and I would like to version this data. So this is my setup: Rails 5.1.4 Ruby 2.4.1 (with RVM) Globalize @ master PaperTrail for versioning of the translations I have created a pull-request that…
Besi
  • 22,579
  • 24
  • 131
  • 223
1
vote
1 answer

Rails - Database translation on user selection values

On my rails app there is a select box with values of, fuel_types, such as, Oil, Gas, Petroleum, Diesel. The default language is en so this is fine. When user changes website to french these data should be shown as french and when user submits the…
Shalafister's
  • 761
  • 1
  • 7
  • 34
1
vote
1 answer

Globalize 3 gem sorting array with translation::

What I want to achieve: dynamically create category sorter using isotope.js from my Gallery.tag To do that I need to loop out a lowercase unique tags for my html .class loop out the tag (using globalize 3 for translation) to display in the…
Rex
  • 238
  • 2
  • 13
1
vote
0 answers

Globalize & globalize-accessors single form translations - throwing error when updating attributes

I wanted to make a form for creating and updating a model, with support for adding/editing translations for multiple languages inline. This is how my form looks like: <%= form_for([:admin, @category], remote: true) do |f| %> <%…
1
vote
2 answers

I18n with_translation and where condition

I'm trying to run a query on table Testimonials which has a Translation Table TestimonialTranslations. The Following query works like a charm: Testimonial.with_translations(I18n.locale).where(:id => params[:id]).first When I change the query…
1
vote
1 answer

Friendly_id-globalize 'find() through' association isn't using translation table

In Rails 4: Using find() directly on my model generates a query which looks up the slug in the page_translations table: Page.find('my-title') SELECT FROM "pages" LEFT OUTER JOIN "page_translations" ... -> # When I use find through a…
David
  • 937
  • 1
  • 12
  • 22
1
vote
0 answers

Rails dynamic field additing (multilanguage)

I have a set of 2 fields (title, description) and some locales (English,Swedish) for translation. When you visit the page you can only see English set fields. But, user must be able to provide additional translations (if he wants). For that purpose…
Dmitri
  • 2,451
  • 6
  • 35
  • 55
1
vote
1 answer

Globalize.with_locale in after_commit callback does not change anything

I'm having troubles with Globalize3 gem when updating cached attribute in after_commit callback. #In My Model after_commit :write_localized_caches private def write_localized_caches I18n.available_locales.each do |locale| …
prikha
  • 1,853
  • 1
  • 16
  • 26