Giter Site home page Giter Site logo

i18n_backend_database's Introduction

๐Ÿ“ซ How to reach me: dylans @ gmail

matrix

i18n_backend_database's People

Contributors

dylanz avatar smingins 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar

i18n_backend_database's Issues

tlt shouldn't allow blank entries

When we parse tlt tags, we translate anything in-between the set tag, ie: ^^this will be translated^^. However, we will incorrectly try and parse this ^^^^. Our regex should account for these cases, and require included content.

seed_application_translations not respecting options

To replicate:

Place this somewhere in the /app directory:
I18n.t('activerecord.errors.messages.record_invalid', :errors => "test test test")

Run the "I18n:populate:from_rails" rake task. The regular expressions grabs the key, but not the interpolation arguments, which it should.

Error at "rails g i18n_backend_database" (Rails 3.1)

terminal output:

rails g i18n_backend_database
$HOME/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.3/lib/active_record/base.rb:1088:in `method_missing': undefined method `named_scope' for #<Class:0xa050d5c> (NoMethodError)ax
  from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/i18n_backend_database-0.0.1/lib/models/locale.rb:6:in `<class:Locale>'
  from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/i18n_backend_database-0.0.1/lib/models/locale.rb:1:in `<top (required)>'
  from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
  from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `block in require'
  from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `block in load_dependency'
  from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in'
  from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
  from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:240:in `require'
  from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/i18n_backend_database-0.0.1/lib/i18n_backend_database.rb:1:in `<top (required)>'
  from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
  from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
  from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each'
  from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `block in require'
  from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each'
  from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require'
  from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
  from /media/PORT/work/couture/config/application.rb:13:in `<top (required)>'
  from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/commands.rb:21:in `require'
  from $HOME/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.1.3/lib/rails/commands.rb:21:in `<top (required)>'
  from script/rails:6:in `require'
  from script/rails:6:in `<main>'

Rails 3.x support

Hi there,

Awesome gem. Is there any rails 3 support planned for it?
Or do you know a way to get it to work?

Many thanks

Wijnand

"Interpolation argument * missing in *" error in rake task

Hello,
I am trying to import my translations into database with rake i18n:populate:from_application but the task is always interrupted by an interpolation argument error:

interpolation argument product missing in "{{product}} {{version}} released!"

In application, the translation is used several times:
text = I18n.t('txt.home.new_release', :product => product_name, :version => version)
xml.title t('txt.home.new_release', :product => post.product_name, :version => post.version)
<%= t('txt.home.new_release', :product => latest.product_name, :version => latest.version) %>

All the interpolation arguments are correct and a whole bunch of other translations with interpolation arguments is being imported without a problem. Am I missing something?

Thanks!

rails 2.3.8 bug

I18n defines a Locale module,
This messes up the access to the plugin's Locale Class...
All the methods the are called from the Database instance like available_locales fails because they are trying to reach Locale module instead of the Locale class

rake i18n:populate:all causes interpolation argument errors missing in "Validation failed: {{errors}}"

We're running Rails 2.3.5, not sure if something changed in there. The problem has to do with some of the stuff in this commit http://github.com/dylanz/i18n_backend_database/commit/e1faa3f384daf26b2809aadfdb4f86569615497f

What I was seeing is the object that was being scanned for interpolation arguments looking something like this:
"'activerecord.errors.messages.record_invalid', :errors=>errors"

and not being able to parse out the fact that it needs an errors option. My regex_fu is limited so I haven't been able to come up with something better.

License issue

Why did you release this under such a strange license?

I'd use this, but requiring all companies to display "This product includes software developed by ELC Technologies" seems excessive.

Would you reconsider releasing this under a more standard open license (MIT, BSD, GPL)?

use text instead of strings for raw_key, value

'string' ends up being 255 chars, which is not enough for longer bits of text.

 create_table :translations do |t|
   t.string   :key
-      t.string   :raw_key
-      t.string   :value
+      t.text     :raw_key
+      t.text     :value
   t.integer  :pluralization_index, :default => 1
   t.integer  :locale_id
 end

There should also be a little bit more room in the translation workspace:

--- a/lib/views/translations/translations.html.erb
+++ b/lib/views/translations/translations.html.erb
@@ -19,7 +19,7 @@
   <% remote_form_for([@locale, translation]) do |f| %>
 <p><%=h translation.default_locale_value || translation.raw_key %></p>
 <p>
-      <%= f.text_field :value %>
+      <%= f.text_field :value, :size => 128 %>
   <%= f.submit "Update" %>
 </p>
   <% end %>

That could also be made to be a bit 'clever', and use a text area for larger bits of text...

Please add a license file

We are interested in using this software but we need to know what the license is. MIT? Pretty much any non GPLish would be great.

Geoff

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.