BadrIT / translation_center

Translation Center is a multi-lingual, GUI rich, community based, translation center for Rails apps
http://www.badrit.com/gems/translation_center/
MIT License
152 stars 71 forks source link

PG::UndefinedColumn: ERROR: column translation_center_translations.en does not exist #57

Closed ryan2johnson9 closed 10 years ago

ryan2johnson9 commented 10 years ago

I got this error; root cause I think is in .rvm/gems/ruby-2.1.1/gems/translation_center-1.7.0/app/models/translation_center/translation_key.rb in method def create_default_translation on the line: translation = self.translations.build(value: self.name.to_s.split('.').last.titleize, lang: :en, status: 'accepted')

the error occurs for me because of the attribute lang: :en my PG db does not understand the symbol :en The error is fixed if I change it to a String translation = self.translations.build(value: self.name.to_s.split('.').last.titleize, lang: 'en', status: 'accepted')

any idea why I need to do this? - couldn't see anyone else having issues with this.

another related issue is that if I call 't' with a symbol I get a similar error , eg ' t(:any_symbol)

ryan2johnson9 commented 10 years ago

This issue is because of the sqeel gem. It does not allow using symbols for values in queries. Therefore, it cannot be used with the translation_center gem.