globalize2

Globalize2 Get only translated attributes from model

class Site < ActiveRecord::Base translates :title, :content attr_accessor :rank end How I can list only the attributes of the Site model, which work with the translates method ? (in this case, I should get an array with ['title', 'content'], without the rank attribute, because it is not translated. ...

Using Formtastic and Globalize2 together

I use Formtastic. Now I would like to add model translations for some fields. I look at Globalize2 and it seems like what I need. But I have no idea how to integrate it with Formtastic. Does anybody have such experience? ...

Populating globalized (Globalize2) DB using db:seed

I,m using Globalize2. I'd like to populate DB with db:seed for different locales: en, de and ru. Is there a better solution then: categories = [{ :en => 'Health & Beauty', :ru => 'Красота и здоровье', :de => 'Beauty & Gesundheit'}, { :en => 'Baby', :ru => 'Детские товары', :de => 'Baby' }] categories.each_index do |i| I...

globalize2 - extract translation for specified locale

Hi, Is there any possibility to extract globalize2 translation for specified locale without setting I18n.locale = :ru as i know - i can extract ALL translations using model.translations but maybe there are simplest way to extract only for one language? ...

globalize2 with xml/json support

I'm implementing a distributed application, server with rails and mobile clients in objective c (iPhone). To enable internationalization, I use the rails plugin 'globalize2' by joshmh. However, it turned out that this plugin does not translate attributes when calling to_xml or to_json on an ActiveRecord. Does anyone know of a workaround...

How to enable fallback in I18n with globalize2

So that's the problem. In my application globalize2 returns a NIL string if there's no translation on some record, instead of falling back to default_locale. I wonder how to enable thin functionality? Does anyone figured that out? ...

Eager loading for globalize2 translations

Hi, i have 2 models - Issue and Answers (issue has many answers) and both have translations with globalize2. Every time i attempting to load Issue with answers via @issue = Issue.find(params[:id]) @answers = @issue.answers causes loading of translations for each Answer (1 sql query per Answer). How can i optimize it? ...

globalize2 - create_translation_table! and options for columns

Hi, could you tell me please - how to use method create_translation_table! of globalize2 with additional options such as :null => false, :default => "abc" ??? ...

Rails Globalize2

How can i implement multiple language translation fields in one form with globalize2? ...

Supporting different locale regions using Rails i18n

I'm using the standard Rails I18n API to localise some of our views. This is working really well, but we now have a few use cases for regional changes to the en locale. The API guide mentions that this isn't supported directly, and other plugins should be used. However, I'm wondering whether there's a simpler way to do this. I alread...

Globalize2 and migrations

Hi, I have used globalize2 to add i18n to an old site. There is already a lot of content in spanish, however it isn't stored in globalize2 tables. Is there a way to convert this content to globalize2 with a migration in rails? The problem is I can't access the stored content: >> Panel.first => #<Panel id: 1, name: "RT", description: "...

Fetch main model and translations in one query with globalize2

Is there a way to fetch the model and the translations in one query when using globalize2? For example, having a model called Language which have two fields, code and name of which the second is translatable I do the following: en = Language.find_by_code("en") and it runs this query: SELECT SQL_NO_CACHE * FROM `languages` WHERE (`l...

How to manage translations as they are added by release?

I work on a RoR website that is translated into a number of languages. It's a real pain to manage the "what's new to translate" for each release. We have to collect all the new keys and send them out in a spreadsheet to the translation team. So, my question is: How do people structure their locales files and manage the addition of new...

Acts As Taggable On: translate tags

I'm working with RoR and I was wondering how can I translate Acts As Taggable On tags without having to manually insert it every time I use a tag again? Example: I have a Post (title and body in English) and I create it with tags "shoes, dress, beauty". I've title and body translated to Japanese in a text file, so I just need to copy/pa...

Sorting model instaces with Globalize3

The problem seems trivial, but I can't find any resonable solution. I have list of countries with translations stored in Globalize3 translation tables. How can I fetch the list of countries sorted by name? Country name isn't stored directly in the model, but in separate table. Is there any resonable way to sort the result other than ma...

Temporary disable i18n fallback in Rails

I18n fallback is loaded: I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks) Any idea now to temporary disable it? I have forms, where I want to edit various language versions, and with fallback I am getting fields with default language, if given translation is yet not present. ...