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

Globalize js inside angular component

Hi im trying to create a angular 4 application that supports L10n .I want to use globalize in the application .My component App component is below import { Component,OnInit } from '@angular/core'; import globalize from…
dockerrrr
  • 237
  • 1
  • 5
  • 16
3
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,225
  • 12
  • 24
3
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
  • 295
  • 2
  • 14
3
votes
0 answers

Thinking Sphinx : Multiple indices and Delta

Since I have a model with localized fields (using Globalize, I'd like to make localized search. I set up two indices on my model : ThinkingSphinx::Index.define :document, name: "document_fr", :with => :active_record, :delta => true do indexes…
LapinLove404
  • 1,889
  • 1
  • 21
  • 25
3
votes
1 answer

How to get a list of Globalized fields in model?

I use gems globalize and globalize_accessors for translating my models. Here is an example: # model.rb class Model < ActiveRecord::Base translates :title, :description globalize_accessors end I want to be able to retreive the list of fields…
firedev
  • 19,222
  • 18
  • 58
  • 91
3
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,531
  • 1
  • 18
  • 43
2
votes
1 answer

ActiveAdmin Globalize create index filters

I'm using Globalize and ActiveAdmin, and I've now installed a gem from a fork of ActiveAdminGlobalize Everything that is described in the readme is working, but I'd like to add a filter to the Active Admin Index. So, for the model stuff.rb class…
Tiago
  • 453
  • 5
  • 22
2
votes
0 answers

Rails Globalize Gem + JSON Resources Gem

I have a project where I need to use internacionalization for table fields and to provide a jsonapi. To accomplish this I'm using the Globalize Gem and the JSON API Gem. This is the code for a simple model called category: class Category <…
2
votes
1 answer

Cannot load gem installed using bundler in rails console

I am trying to install the latest version of Globalize gem - the only one compatible with Rails 5. To do that I have to install it from Github. So I added the following line to the Gemfile as suggested by the Readme file: gem 'globalize', git:…
wael34218
  • 4,550
  • 8
  • 39
  • 60
2
votes
1 answer

How to use Globalize with Angular CLI

How do I load the Globalize library along with the CLDR data in an Angular app generated from angular cli. When I perform the following steps: npm install globalize cldr-data import {Globalize} from 'globalize'; in app.component.ts ng serve I get…
takeradi
  • 3,021
  • 5
  • 24
  • 47
2
votes
0 answers

Rails - adding scope to routes breaks Friendy Urls

I recently added localizations scope to my routes (like described in Railscasts PRO #138), because I need them to look like this: localhost/en/admin/posts localhost/en/admin/posts/happy-new-post/edit But adding a scope throws an error: can't find…
mohnstrudel
  • 514
  • 3
  • 18
2
votes
1 answer

Globalize / Cldr : Globalize.formatDate(new Date(), {datetime:"long"}) resulted in something like "16. januar 2017. 13.30.17 GMT+1"

I have ASP.NET MVC 5 application, and my Globalization / Validation (Globalize 1.2.2) loads are:
2
votes
1 answer

How to check if Globalize has used a fallback

I am using: gem 'rails', '4.0.0' gem 'globalize', '~> 4.0.2' In my Image.rb model I have two columns I want translate (English and German): translates :name, :description In application.rb I set: config.i18n.fallbacks = true Everthing works fine.…
user929062
  • 777
  • 4
  • 10
  • 32
2
votes
1 answer

Rails: rename globalize column

The rails globalize gem docs are great, but I can't find a solution, what I have to do, when I want to rename a column. Last Year I did that, to add the translation fields. def up remove_column :news, :name News.add_translation_fields!…
Archer
  • 830
  • 9
  • 28
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
  • 620
  • 1
  • 8
  • 27
1
2
3
9 10