Search Results

Search found 7 results on 1 pages for 'globalize2'.

Page 1/1 | 1 

  • globalize2 with xml/json support

    - by Philipp Bolliger
    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 / patch? Do you have any ideas how to fix this, where to alter globalize2? Using: Rails 2.3.5 globalize2: commit from 2010-01-11

    Read the article

  • Globalize2 and migrations

    - by diegogs
    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: "asd", proje.... >> Panel.first.name => nil >> I18n.locale = nil => nil >> Panel.first.name => nil Any ideas?

    Read the article

  • Fetch main model and translations in one query with globalize2

    - by J. Pablo Fernández
    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 (`languages`.`code` = 'en') LIMIT 1 and when I do: en.name it runs: SELECT SQL_NO_CACHE * FROM `language_translations` WHERE (`language_translations`.language_id = 123 AND (`language_translations`.`locale` IN ('en','root'))) and if I do it again it'll re-run the query. Is there a way to fetch all the translated data in the first query? I've tried: en = Language.find_by_code("en", :joins => "JOIN language_translations ON language_translations.language_id = languages.id") but it made no difference. UPDATE: this is being discussed as an issue in globalize2: http://github.com/joshmh/globalize2/issues/#issue/33

    Read the article

  • Supporting different locale regions using Rails i18n

    - by Olly
    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 already have en.yml, so in theory I could just create en-AU.yml and en-US.yml which are effectively clones of en.yml but with a few regional changes applied. I could then add additional English - American and English - Australian options to our configuration which would map to the new region-specific locales and allow users to use a region-specific locale. The only problem I can think of with this is that it isn't DRY -- I would have duplicate translations for all common English words. I can't see a way around this. Are there any other disadvantages to this approach, or should I just bite the bullet and dive into one of the plug-ins such as Globalize2 instead?

    Read the article

1