Project

General

Profile

« Previous | Next » 

Revision 2413

Load plugin translation files found under <plugin>/config/locales/. Sample plugin updated.

View differences:

sandbox/rails-2.2/extra/sample_plugin/lang/en.yml
1
# Sample plugin
2
label_plugin_example: Sample Plugin
3
label_meeting_plural: Meetings
4
text_say_hello: Plugin say 'Hello'
5
text_say_goodbye: Plugin say 'Good bye'
6 0

  
sandbox/rails-2.2/extra/sample_plugin/lang/fr.yml
1
# Sample plugin
2
label_plugin_example: Plugin exemple
3
label_meeting_plural: Meetings
4
text_say_hello: Plugin dit 'Bonjour'
5
text_say_goodbye: Plugin dit 'Au revoir'
6 0

  
sandbox/rails-2.2/extra/sample_plugin/config/locales/en.yml
1
# Sample plugin
2
en:
3
  label_plugin_example: Sample Plugin
4
  label_meeting_plural: Meetings
5
  text_say_hello: Plugin say 'Hello'
6
  text_say_goodbye: Plugin say 'Good bye'
0 7

  
sandbox/rails-2.2/extra/sample_plugin/config/locales/fr.yml
1
# Sample plugin
2
fr:
3
  label_plugin_example: Plugin exemple
4
  label_meeting_plural: Meetings
5
  text_say_hello: Plugin dit 'Bonjour'
6
  text_say_goodbye: Plugin dit 'Au revoir'
0 7

  
sandbox/rails-2.2/lib/redmine/plugin.rb
67 67
      p.instance_eval(&block)
68 68
      # Set a default name if it was not provided during registration
69 69
      p.name(id.to_s.humanize) if p.name.nil?
70
      # Adds plugin locales if any
71
      # YAML translation files should be found under <plugin>/config/locales/
72
      ::I18n.load_path += Dir.glob(File.join(RAILS_ROOT, 'vendor', 'plugins', id.to_s, 'config', 'locales', '*.yml'))
70 73
      registered_plugins[id] = p
71 74
    end
72 75
    

Also available in: Unified diff