zena 1.0.0.rc2 → 1.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +23 -0
- data/README.rdoc +1 -1
- data/app/controllers/columns_controller.rb +3 -31
- data/app/controllers/comments_controller.rb +8 -3
- data/app/controllers/data_entries_controller.rb +1 -1
- data/app/controllers/documents_controller.rb +2 -2
- data/app/controllers/nodes_controller.rb +29 -12
- data/app/controllers/relations_controller.rb +2 -2
- data/app/controllers/sites_controller.rb +1 -1
- data/app/controllers/user_sessions_controller.rb +6 -3
- data/app/controllers/users_controller.rb +18 -16
- data/app/controllers/versions_controller.rb +20 -18
- data/app/controllers/virtual_classes_controller.rb +103 -17
- data/app/helpers/users_helper.rb +1 -1
- data/app/models/column.rb +19 -50
- data/app/models/comment.rb +2 -1
- data/app/models/node.rb +45 -22
- data/app/models/relation.rb +13 -0
- data/app/models/relation_proxy.rb +3 -2
- data/app/models/role.rb +213 -4
- data/app/models/site.rb +18 -11
- data/app/models/template.rb +37 -35
- data/app/models/version.rb +1 -1
- data/app/models/virtual_class.rb +154 -86
- data/app/views/columns/_li.html.erb +1 -1
- data/app/views/columns/index.html.erb +1 -9
- data/app/views/comments/index.rhtml +10 -8
- data/app/views/documents/_crop.rhtml +5 -6
- data/app/views/documents/crop_form.rjs +3 -2
- data/app/views/groups/index.rhtml +1 -1
- data/app/views/iformats/index.rhtml +1 -1
- data/app/views/nodes/_import_results.rhtml +1 -1
- data/app/views/nodes/_parent.rhtml +1 -2
- data/app/views/nodes/update.rjs +3 -4
- data/app/views/relations/index.erb +1 -1
- data/app/views/sites/index.erb +1 -1
- data/app/views/templates/drive_tabs/_drive.rhtml +0 -2
- data/app/views/templates/edit_tabs/_image.rhtml +1 -1
- data/app/views/templates/edit_tabs/_title.rhtml +0 -6
- data/app/views/users/index.rhtml +1 -1
- data/app/views/users/preferences.html.erb +2 -2
- data/app/views/versions/backup.rjs +1 -1
- data/app/views/versions/custom_tab.rhtml +9 -4
- data/app/views/versions/destroy.rjs +2 -2
- data/app/views/versions/update.rjs +2 -9
- data/app/views/virtual_classes/_form.erb +3 -2
- data/app/views/virtual_classes/import_prepare.html.erb +13 -0
- data/app/views/virtual_classes/index.erb +28 -8
- data/app/views/zafu/default/Node-+adminLayout.zafu +1 -13
- data/app/views/zafu/default/Node-+login.zafu +1 -0
- data/app/views/zafu/default/Node-+notFound.zafu +1 -1
- data/app/views/zafu/default/Node-+popupLayout.zafu +1 -2
- data/app/views/zafu/default/Node-+search.zafu +1 -1
- data/app/views/zafu/default/Node-admin.zafu +205 -0
- data/app/views/zafu/default/Node.zafu +11 -11
- data/bricks/captcha/lib/bricks/captcha.rb +3 -2
- data/bricks/mongrel/zena/init.rb +2 -1
- data/bricks/pdf/README +5 -5
- data/bricks/pdf/lib/bricks/pdf/engine/prince.rb +2 -2
- data/bricks/pdf/lib/bricks/pdf/engine/xhtml2pdf.rb +2 -2
- data/bricks/pdf/lib/bricks/pdf/install.rb +5 -5
- data/bricks/pdf/lib/bricks/pdf.rb +11 -11
- data/bricks/pdf/test/engines/test_prince.rb +4 -4
- data/bricks/pdf/test/engines/test_xhtml2pdf.rb +4 -4
- data/bricks/pdf/test/shoulda_macros/shoulda_pdf.rb +2 -2
- data/bricks/pdf/zena/init.rb +2 -2
- data/bricks/pdf/zena/tasks.rb +2 -2
- data/bricks/sphinx/lib/bricks/sphinx.rb +6 -2
- data/bricks/sphinx/zena/{sphinx.yml → sphinx.yml.erb} +2 -2
- data/bricks/sphinx/zena/tasks.rb +28 -2
- data/bricks/tags/lib/bricks/tags.rb +16 -1
- data/bricks/tags/zena/test/unit/tags_test.rb +15 -0
- data/bricks/tags/zena/test/zafu/tags.yml +5 -1
- data/bricks/worker/lib/bricks/worker.rb +39 -0
- data/bricks/worker/zena/deploy.rb +0 -2
- data/bricks/worker/zena/init.rb +1 -0
- data/bricks/worker/zena/test/sites/zena/delayed_jobs.yml +16 -0
- data/bricks/worker/zena/test/zafu/worker.yml +8 -0
- data/bricks/zena/zena/migrate/01_base.rb +36 -60
- data/bricks/zena/zena/migrate/02_zerox1_schema.rb +388 -0
- data/bricks/zena/zena/migrate/03_zerox1_data.rb +380 -0
- data/bricks/zena/zena/migrate/20110315161158_add_reverse_scope_to_roles.rb +9 -0
- data/config/database_example.yml +1 -1
- data/config/environment.rb +1 -1
- data/config/gems.yml +17 -14
- data/db/init/base/skins/default/Node-+index.zafu +8 -1
- data/db/init/base/skins/default/Node-+login.zafu +1 -0
- data/db/init/base/skins/default/Node-+popupLayout.zafu +1 -2
- data/db/init/base/skins/default/Node-+search.zafu +2 -2
- data/db/init/base/skins/default/Node.zafu +9 -9
- data/db/init/base/skins/default/{favicon.png → img/favicon.png} +0 -0
- data/db/init/base/skins/default/{style.css → img/style.css} +0 -0
- data/db/init/base/skins/default/img/translations.yml +11 -0
- data/db/init/base/skins/default/notes.zafu +7 -9
- data/doc/zafu_changes.yml +12 -0
- data/lib/bricks/loader.rb +38 -15
- data/lib/tasks/zena.rake +74 -24
- data/lib/zena/acts/enrollable.rb +4 -1
- data/lib/zena/acts/secure.rb +2 -48
- data/lib/zena/acts/serializable.rb +13 -1
- data/lib/zena/app.rb +9 -0
- data/lib/zena/code_syntax.rb +154 -151
- data/lib/zena/console.rb +141 -0
- data/lib/zena/controller/test_case.rb +1 -1
- data/lib/zena/db_helper/abstract_db.rb +17 -5
- data/lib/zena/db_helper/mysql.rb +14 -12
- data/lib/zena/db_helper/postgresql.rb +1 -2
- data/lib/zena/db_helper/sqlite3.rb +6 -6
- data/lib/zena/deploy/awstats.conf.rhtml +1 -1
- data/lib/zena/deploy/httpd.rhtml +6 -1
- data/lib/zena/deploy/vhost.rhtml +9 -1
- data/lib/zena/deploy.rb +12 -7
- data/lib/zena/foxy_parser.rb +3 -1
- data/lib/zena/info.rb +1 -1
- data/lib/zena/parser/zafu_tags.rb +1 -0
- data/lib/zena/parser/zazen_rules.rb +1 -1
- data/lib/zena/remote/node.rb +15 -3
- data/lib/zena/remote/serializable_array.rb +19 -0
- data/lib/zena/remote.rb +1 -0
- data/lib/zena/routes.rb +7 -2
- data/lib/zena/site_worker.rb +11 -1
- data/lib/zena/unit/test_case.rb +68 -0
- data/lib/zena/use/action.rb +6 -2
- data/lib/zena/use/ajax.rb +127 -53
- data/lib/zena/use/ancestry.rb +11 -8
- data/lib/zena/use/calendar.rb +265 -129
- data/lib/zena/use/conditional.rb +1 -1
- data/lib/zena/use/context.rb +5 -5
- data/lib/zena/use/dates.rb +172 -60
- data/lib/zena/use/display.rb +70 -39
- data/lib/zena/use/error_rendering.rb +1 -3
- data/lib/zena/use/field_index.rb +4 -1
- data/lib/zena/use/forms.rb +94 -72
- data/lib/zena/use/fulltext.rb +16 -24
- data/lib/zena/use/html_tags.rb +20 -12
- data/lib/zena/use/i18n.rb +37 -37
- data/lib/zena/use/image_builder.rb +8 -1
- data/lib/zena/use/ml_index.rb +16 -16
- data/lib/zena/use/prop_eval.rb +10 -5
- data/lib/zena/use/query_builder.rb +55 -23
- data/lib/zena/use/query_node.rb +51 -25
- data/lib/zena/use/refactor.rb +2 -28
- data/lib/zena/use/relations.rb +1 -1
- data/lib/zena/use/rendering.rb +29 -0
- data/lib/zena/use/scope_index.rb +75 -14
- data/lib/zena/use/search.rb +5 -10
- data/lib/zena/use/test_helper.rb +2 -2
- data/lib/zena/use/urls.rb +125 -104
- data/lib/zena/use/workflow.rb +2 -1
- data/lib/zena/use/zafu_attributes.rb +2 -2
- data/lib/zena/use/zafu_safe_definitions.rb +20 -0
- data/lib/zena/use/zafu_templates.rb +20 -6
- data/lib/zena/use/zazen.rb +31 -20
- data/lib/zena/view/test_case.rb +5 -0
- data/lib/zena/zafu_compiler.rb +24 -2
- data/lib/zena.rb +12 -6
- data/locale/de/LC_MESSAGES/zena.mo +0 -0
- data/locale/de/zena.po +1345 -1164
- data/locale/en/LC_MESSAGES/zena.mo +0 -0
- data/locale/en/zena.po +1275 -1129
- data/locale/fr/LC_MESSAGES/zena.mo +0 -0
- data/locale/fr/zena.mo +0 -0
- data/locale/fr/zena.po +1617 -1441
- data/locale/log.txt +9 -0
- data/locale/zena.pot +957 -748
- data/public/javascripts/prototype.js +1 -1
- data/public/javascripts/zena.js +99 -44
- data/public/stylesheets/admin.css +6 -4
- data/public/stylesheets/backend.css +71 -0
- data/public/stylesheets/calendar.css +24 -25
- data/public/stylesheets/code.css +11 -6
- data/public/stylesheets/comment.css +2 -1
- data/public/stylesheets/popup.css +7 -8
- data/test/custom_queries/complex.host.yml +15 -1
- data/test/fixtures/files/Node-test.zafu +29 -28
- data/test/fixtures/files/translations_de.yml +12 -1
- data/test/fixtures/files/translations_fr.yml +12 -1
- data/test/functional/comments_controller_test.rb +9 -0
- data/test/functional/iformats_controller_test.rb +1 -1
- data/test/functional/nodes_controller_test.rb +124 -35
- data/test/functional/users_controller_test.rb +132 -3
- data/test/functional/virtual_classes_controller_test.rb +75 -4
- data/test/integration/navigation_test.rb +51 -9
- data/test/integration/query_node/basic.yml +19 -7
- data/test/integration/query_node/complex.yml +1 -1
- data/test/integration/query_node/dates.yml +27 -1
- data/test/integration/query_node/filters.yml +1 -1
- data/test/integration/query_node/relations.yml +13 -4
- data/test/integration/query_node_test.rb +4 -0
- data/test/integration/xml_api_test.rb +6 -1
- data/test/integration/zafu_compiler/action.yml +3 -3
- data/test/integration/zafu_compiler/ajax.yml +103 -22
- data/test/integration/zafu_compiler/basic.yml +0 -52
- data/test/integration/zafu_compiler/calendar.yml +44 -20
- data/test/integration/zafu_compiler/comments.yml +53 -0
- data/test/integration/zafu_compiler/complex.yml +11 -11
- data/test/integration/zafu_compiler/complex_ok.yml +16 -3
- data/test/integration/zafu_compiler/conditional.yml +15 -5
- data/test/integration/zafu_compiler/context.yml +9 -0
- data/test/integration/zafu_compiler/dates.yml +43 -15
- data/test/integration/zafu_compiler/display.yml +60 -6
- data/test/integration/zafu_compiler/errors.yml +6 -2
- data/test/integration/zafu_compiler/forms.yml +45 -6
- data/test/integration/zafu_compiler/i18n.yml +8 -1
- data/test/integration/zafu_compiler/meta.yml +38 -0
- data/test/integration/zafu_compiler/query.yml +43 -4
- data/test/integration/zafu_compiler/relations.yml +26 -33
- data/test/integration/zafu_compiler/rubyless.yml +10 -0
- data/test/integration/zafu_compiler/safe_definitions.yml +21 -1
- data/test/integration/zafu_compiler/urls.yml +75 -5
- data/test/integration/zafu_compiler/version.yml +2 -2
- data/test/integration/zafu_compiler/zafu_attributes.yml +5 -1
- data/test/integration/zafu_compiler/zazen.yml +14 -6
- data/test/integration/zafu_compiler_test.rb +5 -1
- data/test/sites/complex/columns.yml +5 -0
- data/test/sites/complex/roles.yml +4 -0
- data/test/sites/zena/nodes.yml +13 -2
- data/test/sites/zena/roles.yml +13 -5
- data/test/sites/zena/versions.yml +27 -9
- data/test/unit/column_test.rb +51 -5
- data/test/unit/iformat_test.rb +2 -2
- data/test/unit/node_test.rb +29 -17
- data/test/unit/note_test.rb +1 -1
- data/test/unit/relation_proxy_test.rb +4 -5
- data/test/unit/relation_test.rb +16 -0
- data/test/unit/remote_test.rb +2 -2
- data/test/unit/role_test.rb +292 -4
- data/test/unit/site_test.rb +12 -0
- data/test/unit/template_test.rb +1 -1
- data/test/unit/text_document_test.rb +1 -1
- data/test/unit/virtual_class_test.rb +200 -83
- data/test/unit/zena/acts/enrollable_test.rb +26 -31
- data/test/unit/zena/use/calendar_test.rb +90 -37
- data/test/unit/zena/use/field_index_test.rb +28 -0
- data/test/unit/zena/use/html_tags_test.rb +7 -3
- data/test/unit/zena/use/ml_index_test.rb +2 -16
- data/test/unit/zena/use/nested_attributes_alias_view_test.rb +2 -2
- data/test/unit/zena/use/prop_eval_test.rb +50 -8
- data/test/unit/zena/use/query_node_test.rb +11 -0
- data/test/unit/zena/use/rendering_test.rb +72 -0
- data/test/unit/zena/use/scope_index_test.rb +37 -2
- data/test/unit/zena/use/urls_test.rb +10 -0
- data/test/unit/zena/use/zazen_test.rb +3 -3
- data/vendor/plugins/gettext_i18n_rails/Gemfile +11 -0
- data/vendor/plugins/gettext_i18n_rails/Gemfile.lock +92 -0
- data/vendor/plugins/gettext_i18n_rails/Rakefile +12 -17
- data/vendor/plugins/gettext_i18n_rails/Readme.md +215 -0
- data/vendor/plugins/gettext_i18n_rails/VERSION +1 -1
- data/vendor/plugins/gettext_i18n_rails/gettext_i18n_rails.gemspec +38 -34
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/active_record.rb +1 -1
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/backend.rb +30 -14
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/haml_parser.rb +1 -1
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/html_safe_translations.rb +29 -0
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/i18n_hacks.rb +29 -1
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/model_attributes_finder.rb +7 -1
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/railtie.rb +10 -0
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/ruby_gettext_extractor.rb +6 -2
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/string_interpolate_fix.rb +20 -0
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails/tasks.rb +120 -0
- data/vendor/plugins/gettext_i18n_rails/lib/gettext_i18n_rails.rb +10 -3
- data/vendor/plugins/gettext_i18n_rails/lib/tasks/gettext_rails_i18n.rake +1 -74
- data/vendor/plugins/gettext_i18n_rails/spec/gettext_i18n_rails/active_record_spec.rb +51 -20
- data/vendor/plugins/gettext_i18n_rails/spec/gettext_i18n_rails/backend_spec.rb +12 -7
- data/vendor/plugins/gettext_i18n_rails/spec/gettext_i18n_rails/string_interpolate_fix_spec.rb +32 -0
- data/vendor/plugins/gettext_i18n_rails/spec/gettext_i18n_rails_spec.rb +38 -1
- data/vendor/plugins/gettext_i18n_rails/spec/rails2/Gemfile +11 -0
- data/vendor/plugins/gettext_i18n_rails/spec/spec_helper.rb +1 -8
- data/zena.gemspec +2241 -2217
- metadata +123 -83
- data/.gitignore +0 -36
- data/app/views/nodes/_dates.rhtml +0 -13
- data/db/init/base/skins/default/Node-+adminLayout.zafu +0 -46
- data/db/init/base/skins/default/Node-tree.zafu +0 -19
- data/vendor/plugins/gettext_i18n_rails/README.markdown +0 -143
@@ -1,19 +0,0 @@
|
|
1
|
-
<r:include template='layout'>
|
2
|
-
<r:with part='menu'/>
|
3
|
-
|
4
|
-
<r:with part='main'>
|
5
|
-
<div class='header'><h1 do='title' class='s70' status='true' actions='all'>this is the title</h1></div>
|
6
|
-
<ul class='tree' do='nodes'>
|
7
|
-
<li class='parent' do='parent'><r:title actions='all' link='tree'/></li>
|
8
|
-
<li class='current'><r:show attr='title'/></li>
|
9
|
-
<li do='each'><r:show attr='title' edit='true'/>
|
10
|
-
<ul do='nodes' name='tree'>
|
11
|
-
<li do='each'>
|
12
|
-
<r:link mode='tree' attr='title'/>
|
13
|
-
</li>
|
14
|
-
</ul>
|
15
|
-
</li>
|
16
|
-
</ul>
|
17
|
-
</r:with>
|
18
|
-
|
19
|
-
</r:include>
|
@@ -1,143 +0,0 @@
|
|
1
|
-
Simple [FastGettext](http://github.com/grosser/fast_gettext) / Rails integration.
|
2
|
-
|
3
|
-
Do all translations you want with FastGettext, use any other I18n backend as extension/fallback.
|
4
|
-
|
5
|
-
Rails does: `I18n.t('weir.rails.syntax.i.hate')`
|
6
|
-
We do: `_('Just translate my damn text!')`
|
7
|
-
To use I18n calls define a `weir.rails.syntax.i.hate` translation.
|
8
|
-
|
9
|
-
[See it working in the example application.](https://github.com/grosser/gettext_i18n_rails_example)
|
10
|
-
|
11
|
-
Setup
|
12
|
-
=====
|
13
|
-
###Installation
|
14
|
-
As plugin: ` script/plugin install git://github.com/grosser/gettext_i18n_rails.git `
|
15
|
-
Or Gem: ` sudo gem install gettext_i18n_rails `
|
16
|
-
|
17
|
-
[FastGettext](http://github.com/grosser/fast_gettext): ` sudo gem install fast_gettext `
|
18
|
-
|
19
|
-
### Want to find used messages in your ruby files ?
|
20
|
-
GetText 1.93 or GetText 2.0: ` sudo gem install gettext `
|
21
|
-
GetText 2.0 will render 1.93 unusable, so only install if you do not have apps that use 1.93!
|
22
|
-
|
23
|
-
` sudo gem install ruby_parser `
|
24
|
-
|
25
|
-
### Locales & initialisation
|
26
|
-
Copy default locales with dates/sentence-connectors/AR-errors you want from e.g.
|
27
|
-
[rails i18n](http://github.com/svenfuchs/rails-i18n/tree/master/rails/locale/) into 'config/locales'
|
28
|
-
|
29
|
-
#environment.rb
|
30
|
-
Rails::Initializer.run do |config|
|
31
|
-
...
|
32
|
-
config.gem "fast_gettext", :version => '>=0.4.8'
|
33
|
-
#only used for mo/po file generation in development, !do not load(:lib=>false), will needlessly eat ram!
|
34
|
-
config.gem "gettext", :lib => false, :version => '>=1.9.3'
|
35
|
-
# with bundler this would be
|
36
|
-
# gem "fast_gettext", '>=0.4.8'
|
37
|
-
# gem '>=1.9.3', "gettext", :require => false
|
38
|
-
end
|
39
|
-
|
40
|
-
#config/initialisers/fast_gettext.rb
|
41
|
-
FastGettext.add_text_domain 'app', :path => 'locale'
|
42
|
-
FastGettext.default_available_locales = ['en','de'] #all you want to allow
|
43
|
-
FastGettext.default_text_domain = 'app'
|
44
|
-
|
45
|
-
#application_controller
|
46
|
-
class ApplicationController < ...
|
47
|
-
before_filter :set_gettext_locale
|
48
|
-
|
49
|
-
Translating
|
50
|
-
===========
|
51
|
-
###Getting started
|
52
|
-
####Option A: Traditional mo/po files
|
53
|
-
- use some _('translations')
|
54
|
-
- run `rake gettext:find`, to let GetText find all translations used
|
55
|
-
- (optional) run `rake gettext:store_model_attributes`, to parse the database for columns that can be translated
|
56
|
-
- if this is your first translation: `cp locale/app.pot locale/de/app.po` for every locale you want to use
|
57
|
-
- translate messages in 'locale/de/app.po' (leave msgstr blank and msgstr == msgid)
|
58
|
-
new translations will be marked "fuzzy", search for this and remove it, so that they will be used.
|
59
|
-
Obsolete translations are marked with ~#, they usually can be removed since they are no longer needed
|
60
|
-
- run `rake gettext:pack` to write GetText format translation files
|
61
|
-
|
62
|
-
####Option B: Database
|
63
|
-
This is the most scalable method, since all translators can work simultanousely and online.
|
64
|
-
|
65
|
-
Most easy to use with the [translation database Rails engine](http://github.com/grosser/translation_db_engine).
|
66
|
-
FastGettext setup would look like:
|
67
|
-
include FastGettext::TranslationRepository::Db.require_models #load and include default models
|
68
|
-
FastGettext.add_text_domain 'app', :type=>:db, :model=>TranslationKey
|
69
|
-
Translations can be edited under `/translation_keys`
|
70
|
-
|
71
|
-
###I18n
|
72
|
-
|
73
|
-
I18n.locale <==> FastGettext.locale.to_sym
|
74
|
-
I18n.locale = :de <==> FastGettext.locale = 'de'
|
75
|
-
|
76
|
-
Any call to I18n that matches a gettext key will be translated through FastGettext.
|
77
|
-
|
78
|
-
Namespaces
|
79
|
-
==========
|
80
|
-
Car|Model means Model in namespace Car.
|
81
|
-
You do not have to translate this into english "Model", if you use the
|
82
|
-
namespace-aware translation
|
83
|
-
s_('Car|Model') == 'Model' #when no translation was found
|
84
|
-
|
85
|
-
ActiveRecord - error messages
|
86
|
-
=============================
|
87
|
-
ActiveRecord error messages are translated through Rails::I18n, but
|
88
|
-
model names and model attributes are translated through FastGettext.
|
89
|
-
Therefore a validation error on a BigCar's wheels_size needs `_('big car')` and `_('BigCar|Wheels size')`
|
90
|
-
to display localized.
|
91
|
-
|
92
|
-
The model/attribute translations can be found through `rake gettext:store_model_attributes`,
|
93
|
-
(which ignores some commonly untranslated columns like id,type,xxx_count,...).
|
94
|
-
|
95
|
-
Error messages can be translated through FastGettext, if the ':message' is a translation-id or the matching Rails I18n key is translated.
|
96
|
-
In any other case they go through the SimpleBackend.
|
97
|
-
|
98
|
-
####Option A:
|
99
|
-
Define a translation for "I need my rating!" and use it as message.
|
100
|
-
validates_inclusion_of :rating, :in=>1..5, :message=>N_('I need my rating!')
|
101
|
-
|
102
|
-
####Option B:
|
103
|
-
Do not use :message
|
104
|
-
validates_inclusion_of :rating, :in=>1..5
|
105
|
-
and make a translation for the I18n key: `activerecord.errors.models.rating.attributes.rating.inclusion`
|
106
|
-
|
107
|
-
####Option C:
|
108
|
-
Add a translation to each config/locales/*.yml files
|
109
|
-
en:
|
110
|
-
activerecord:
|
111
|
-
errors:
|
112
|
-
models:
|
113
|
-
rating:
|
114
|
-
attributes:
|
115
|
-
rating:
|
116
|
-
inclusion: " -- please choose!"
|
117
|
-
The [rails I18n guide](http://guides.rubyonrails.org/i18n.html) can help with Option B and C.
|
118
|
-
|
119
|
-
Plurals
|
120
|
-
=======
|
121
|
-
FastGettext supports pluralization
|
122
|
-
n_('Apple','Apples',3) == 'Apples'
|
123
|
-
|
124
|
-
Unfound translations
|
125
|
-
====================
|
126
|
-
Sometimes translations like `_("x"+"u")` cannot be fond. You have 4 options:
|
127
|
-
|
128
|
-
- add `N_('xu')` somewhere else in the code, so the parser sees it
|
129
|
-
- add `N_('xu')` in a totally seperate file like `locale/unfound_translations.rb`, so the parser sees it
|
130
|
-
- use the [gettext_test_log rails plugin ](http://github.com/grosser/gettext_test_log) to find all translations that where used while testing
|
131
|
-
- add a Logger to a translation Chain, so every unfound translations is logged ([example]((http://github.com/grosser/fast_gettext)))
|
132
|
-
|
133
|
-
|
134
|
-
Contributors
|
135
|
-
======
|
136
|
-
- [ruby gettext extractor](http://github.com/retoo/ruby_gettext_extractor/tree/master) from [retoo](http://github.com/retoo)
|
137
|
-
- [Paul McMahon](http://github.com/pwim)
|
138
|
-
- [Duncan Mac-Vicar P](http://duncan.mac-vicar.com/blog/)
|
139
|
-
- [Ramihajamalala Hery](http://my.rails-royce.org/)
|
140
|
-
|
141
|
-
[Michael Grosser](http://pragmatig.wordpress.com)
|
142
|
-
grosser.michael@gmail.com
|
143
|
-
Hereby placed under public domain, do what you want, just do not hold me accountable...
|