Fixing upadtepo, Duplicated Messages

So far i found 2 causes of duplicated messages (duplicate message definition) when updating po files(rake updatepo)

  1. Subclassing — hard to fix, official manual says: ” write a model per a file(modelname.rb)”, which helped me really…not.. adding common columns id/created_at/updated_at to untranslated colums can help
      GetText::ActiveRecordParser.init(
        :untranslate_columns => %w[id created_at updated_at user_id]
      ) 
    

    You can also limit the classes that will be parsed with :activerecord_classes = [‘name’], which will be used like current_class =~ /class.*name /, so one could add wildcards and stuff.

  2. Observers: deactivate them in environment.rb while updating

While trying through these options, remember to always clenup or delete your old pot file, or updatepo can never succeed.

BTW: never try to use :use_classes => false,

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s