GithubHelp home page GithubHelp logo

mutoh / gettext_rails Goto Github PK

View Code? Open in Web Editor NEW
23.0 23.0 5.0 662 KB

Ruby on Rails (>=2.3) localization support with Ruby-GetText-Package.

Home Page: http://www.rubyforge.org/projects/gettext/

License: Other

JavaScript 0.46% Ruby 99.54%

gettext_rails's People

Contributors

barttenbrinke avatar mutoh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gettext_rails's Issues

rendering a JSON response

I'm unable to render a JSON response from my controller, because every time when I try with 'render :json => result' I get the following error:

ActionView::MissingTemplate (Missing template offer/search_items_json.erb in view path app/views):
/usr/lib/ruby/gems/1.8/gems/locale_rails-2.0.4/lib/locale_rails/action_view.rb:46:in `find_template'
public/dispatch.fcgi:24

it looks like that the gettext is eating the :json parameter as it their parameter

GetText taking too long when translating in layout

Hi,

When translating messages in a layout, GetText takes most of the request time to translate the message, because it seems that its domaintext isn't set (even if we force it with GetText.bindtextdomain).

For example, just rendering the following code in a layout takes more than 30s, where it takes less than a second when the code is in a view. Am I doing something wrong to have such difference between a layout and a view rendering?

Regards.

<% 1000.times.each do |i| %>
<%= _("toto #{i}") %>
<% end %>

Localized implicit multipart mailer views not working

With gettext_rails 2.2.0 and Rails 2.3.8 (was also a case with older Rails for sure) localized implicit multipart views (in the form on foo.text.plain.erb, foo.text.html.erb, foo_el_GR.text.plain.erb, foo_el_GR.text.html.erb) do not work. The default views are always rendered regardless of the current locale. The reason (in essence) is the the original_template_path that's passed to find_template_with_locale_rails is already initialized and (responds to :render) and thus find_template_with_locale_rails returns it as is without trying to localize it.

Here's an ugly monkey patch for ActionMailer::Base#create! that provides a workaround for this issue : https://gist.github.com/663970

Let me know if this should go into gettext_rails instead

Version 2.2.0 is not on RubyGems

It seems that version 2.2.0 of gettext_rails, the one that supports Rails 2.3.5, has not been pushed to RubyGems.

Masao, I know I sent you an email about this, this is just so others can see the issue too, comment and keep track of it.

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.