GithubHelp home page GithubHelp logo

Comments (12)

fillman avatar fillman commented on June 16, 2024

Damn! I also wonder how to enable I18n Fallbacks. Please someone help us out!

from globalize2.

triaxman avatar triaxman commented on June 16, 2024

i delete the joshmh/globalize2 and took the OLD one from fd/globalize2.
guess what! whit this one I don't get anny error!
the only thing is, that the specified fallback language won't get retrieved, so it's always falling back on english even if I said german.
anyways, can someone explain, how come that the NEWER joshmh/globalize2 ain't working? :-(

from globalize2.

triaxman avatar triaxman commented on June 16, 2024

i gave it a new shot:
sudo script/plugin install git://github.com/hukl/globalize2

ain't working either:
ActionView::TemplateError (undefined method `fallbacks' for I18n:Module) on line #1 of app/views/posts/index.html.erb:
1: <%- I18n.fallbacks[:de] %>

from globalize2.

triaxman avatar triaxman commented on June 16, 2024

So, I wanna share my latest bad news with you.
I've been trying some older versions of the Globalize2 plugin and they seem to have no problem with the fallbacks method. However, they all have some severe problems with form_for, hash building and some other very strange stuff which makes my current apllication break apart. Sadly.

Nobody has a statement what can be done here? How can I make following to work?
I18n.fallbacks.inspect ---> undefined method fallbacks I18n:Module
@posts.each do |post|
post.title.fallback? ---> undefined method fallback?' for nil:NilClass post.title.locale.to ---> undefined methodlocale' for nil:NilClass
end
Don't wanna repeat myself, but those method calls DO work previous to 0.2.0. :-)
So, what am I doing wrong?

@fillman: Your Globalize2 version is also a 0.1.1 version which actually work with fallback but crashes on form_for and other stuff.

from globalize2.

triaxman avatar triaxman commented on June 16, 2024

A sample of what older versions (i.e.0.1.1) prior 0.2.0 produce:

ArgumentError in Pages#new
Showing app/views/pages/_form.html.erb where line #6 raised:
"odd number of arguments for Hash"
Extracted source (around line #6):
5: <%- form_for @page do |f| %>
6: <%= f.error_messages %>

etc.

As soon as I remove the plugin, restart the server, all is fine. So I guess the plugin interferres with Rails so deep, that it actually does its purpose for globalizing but also mixes up some other stuff. :-/

from globalize2.

triaxman avatar triaxman commented on June 16, 2024

I wanna quote Sven Fuchs: "Big refactoring towards version 0.2.0. Stripping off all features that have been duplicated in I18n. Only model translations related features
will remain in Globalize2."
Ok, no problem with that. But can you tell us what's the alternative for the "fallback?" method ?? Otherwise 0.2.0 is a total downgrade. So where is the point?

from globalize2.

ncri avatar ncri commented on June 16, 2024

Well, i am also pulling my hair out about this. Globalize2 is great, but its documentation is more than poor. It seems you need to install the I18n plugin to get the locale fallbacks back. See here: http://stackoverflow.com/questions/2147179/how-to-enable-fallback-in-i18n-with-globalize2

This is quite confusing. I wish there would be some overview page clearly explaining when to use what and what for (Globalize2, I18n Gem,...). And of cause a good documentation of G2.

from globalize2.

stuffmc avatar stuffmc commented on June 16, 2024

Anything new on this?

from globalize2.

fillman avatar fillman commented on June 16, 2024

what u wanna know?

from globalize2.

stuffmc avatar stuffmc commented on June 16, 2024

Actually I can't make Globalize2 work in my App, and in the Sample App, it's failing on fallbacks. A sample app failing it's kind of uncool :)

from globalize2.

ncri avatar ncri commented on June 16, 2024

Any body got fallbacks working? See also this post:
http://github.com/svenfuchs/i18n/issues/#issue/11

from globalize2.

bernardeli avatar bernardeli commented on June 16, 2024

just take a look here:
http://stackoverflow.com/questions/2147179/how-to-enable-fallback-in-i18n-with-globalize2

it worked smoothly for me.

from globalize2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.