tr8n 3.1.1 → 3.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +6 -3
- data/.rspec +2 -0
- data/Gemfile +3 -6
- data/Gemfile.lock +21 -6
- data/README.rdoc +61 -33
- data/Rakefile +1 -11
- data/app/assets/images/tr8n/photo_system.gif +0 -0
- data/app/assets/stylesheets/tr8n/application.css +42 -1
- data/{test/dummy/app/assets/stylesheets/components.css.scss → app/assets/stylesheets/tr8n/component.css.scss} +0 -0
- data/{test/dummy/app/assets/stylesheets → app/assets/stylesheets/tr8n}/layout.css.scss +0 -0
- data/app/assets/stylesheets/tr8n/tr8n.css.scss +16 -8
- data/app/controllers/tr8n/admin/base_controller.rb +1 -1
- data/app/controllers/tr8n/admin/clientsdk_controller.rb +1 -1
- data/app/controllers/tr8n/admin/domain_controller.rb +1 -1
- data/app/controllers/tr8n/admin/forum_controller.rb +1 -1
- data/app/controllers/tr8n/admin/glossary_controller.rb +1 -1
- data/app/controllers/tr8n/admin/language_controller.rb +1 -1
- data/app/controllers/tr8n/admin/translation_controller.rb +1 -1
- data/app/controllers/tr8n/admin/translation_key_controller.rb +5 -1
- data/app/controllers/tr8n/admin/translator_controller.rb +1 -1
- data/app/{helpers/tr8n/application_helper.rb → controllers/tr8n/api/v1/sync_controller.rb} +6 -3
- data/app/controllers/tr8n/awards_controller.rb +12 -12
- data/app/controllers/tr8n/base_controller.rb +140 -137
- data/app/controllers/tr8n/dashboard_controller.rb +2 -1
- data/app/controllers/tr8n/forum_controller.rb +1 -1
- data/app/controllers/tr8n/glossary_controller.rb +1 -1
- data/app/controllers/tr8n/help_controller.rb +1 -1
- data/app/controllers/tr8n/language_cases_controller.rb +43 -45
- data/app/controllers/tr8n/language_controller.rb +1 -1
- data/app/controllers/tr8n/phrases_controller.rb +1 -1
- data/app/controllers/tr8n/translations_controller.rb +1 -1
- data/app/controllers/tr8n/translator_controller.rb +1 -1
- data/app/helpers/tr8n/base_helper.rb +0 -4
- data/app/models/tr8n/base_filter.rb +1 -1
- data/app/models/tr8n/daily_language_metric.rb +1 -1
- data/app/models/tr8n/date_rule.rb +1 -1
- data/app/models/tr8n/gender_list_rule.rb +1 -1
- data/app/models/tr8n/gender_rule.rb +1 -1
- data/app/models/tr8n/glossary.rb +1 -1
- data/app/models/tr8n/glossary_filter.rb +1 -1
- data/app/models/tr8n/integration/ru/russian_gender_list_rule.rb +1 -1
- data/app/models/tr8n/integration/ru/russian_numeric_rule.rb +1 -1
- data/app/models/tr8n/ip_location.rb +1 -1
- data/app/models/tr8n/ip_location_filter.rb +1 -1
- data/app/models/tr8n/language.rb +17 -8
- data/app/models/tr8n/language_case.rb +1 -1
- data/app/models/tr8n/language_case_filter.rb +1 -1
- data/app/models/tr8n/language_case_rule.rb +1 -1
- data/app/models/tr8n/language_case_rule_filter.rb +1 -1
- data/app/models/tr8n/language_case_value_map.rb +1 -1
- data/app/models/tr8n/language_case_value_map_filter.rb +1 -1
- data/app/models/tr8n/language_filter.rb +1 -1
- data/app/models/tr8n/language_forum_abuse_report.rb +1 -1
- data/app/models/tr8n/language_forum_abuse_report_filter.rb +1 -1
- data/app/models/tr8n/language_forum_message.rb +2 -2
- data/app/models/tr8n/language_forum_message_filter.rb +1 -1
- data/app/models/tr8n/language_forum_topic.rb +3 -3
- data/app/models/tr8n/language_forum_topic_filter.rb +1 -1
- data/app/models/tr8n/language_metric.rb +2 -2
- data/app/models/tr8n/language_metric_filter.rb +1 -1
- data/app/models/tr8n/language_rule.rb +37 -2
- data/app/models/tr8n/language_rule_filter.rb +1 -1
- data/app/models/tr8n/language_user.rb +3 -3
- data/app/models/tr8n/language_user_filter.rb +1 -1
- data/app/models/tr8n/list_rule.rb +1 -1
- data/app/models/tr8n/monthly_language_metric.rb +2 -2
- data/app/models/tr8n/numeric_rule.rb +1 -1
- data/app/models/tr8n/sync_log.rb +76 -0
- data/app/{controllers/tr8n/application_controller.rb → models/tr8n/sync_log_filter.rb} +4 -3
- data/app/models/tr8n/total_language_metric.rb +5 -4
- data/app/models/tr8n/translation.rb +61 -13
- data/app/models/tr8n/translation_domain.rb +1 -1
- data/app/models/tr8n/translation_domain_filter.rb +1 -1
- data/app/models/tr8n/translation_filter.rb +1 -1
- data/app/models/tr8n/translation_key.rb +33 -5
- data/app/models/tr8n/translation_key_comment.rb +1 -1
- data/app/models/tr8n/translation_key_comment_filter.rb +1 -1
- data/app/models/tr8n/translation_key_filter.rb +1 -1
- data/app/models/tr8n/translation_key_lock.rb +2 -2
- data/app/models/tr8n/translation_key_lock_filter.rb +1 -1
- data/app/models/tr8n/translation_key_source.rb +2 -2
- data/app/models/tr8n/translation_key_source_filter.rb +1 -1
- data/app/models/tr8n/translation_source.rb +2 -2
- data/app/models/tr8n/translation_source_filter.rb +1 -1
- data/app/models/tr8n/translation_vote.rb +3 -4
- data/app/models/tr8n/translation_vote_filter.rb +1 -1
- data/app/models/tr8n/translator.rb +19 -5
- data/app/models/tr8n/translator_filter.rb +1 -1
- data/app/models/tr8n/translator_following.rb +2 -2
- data/app/models/tr8n/translator_following_filter.rb +1 -1
- data/app/models/tr8n/translator_log.rb +1 -1
- data/app/models/tr8n/translator_log_filter.rb +1 -1
- data/app/models/tr8n/translator_metric.rb +15 -21
- data/app/models/tr8n/translator_metric_filter.rb +1 -1
- data/app/models/tr8n/translator_report.rb +2 -2
- data/app/models/tr8n/translator_report_filter.rb +1 -1
- data/app/models/tr8n/value_rule.rb +1 -1
- data/app/views/tr8n/admin/common/_paginator.html.erb +29 -17
- data/app/views/tr8n/admin/translation_key/_tabs.html.erb +3 -1
- data/app/views/tr8n/admin/translation_key/sync_logs.html.erb +5 -0
- data/app/views/tr8n/awards/index.html.erb +0 -2
- data/app/views/tr8n/common/_paginator.html.erb +24 -6
- data/app/views/tr8n/common/_tabs.html.erb +9 -5
- data/app/views/tr8n/forum/_messages.html.erb +1 -1
- data/app/views/tr8n/forum/index.html.erb +1 -1
- data/app/views/tr8n/glossary/index.html.erb +2 -2
- data/app/views/tr8n/{home → help}/credits.html.erb +0 -0
- data/app/views/tr8n/{home → help}/license.html.erb +0 -0
- data/app/views/tr8n/language_cases/index.html.erb +2 -2
- data/app/views/tr8n/phrases/_comments_module.html.erb +1 -1
- data/app/views/tr8n/phrases/index.html.erb +2 -6
- data/app/views/tr8n/translations/_list.html.erb +2 -6
- data/config/routes.rb +2 -2
- data/config/tr8n/config.yml +48 -13
- data/config/tr8n/rules/default_language_cases.yml +272 -0
- data/config/tr8n/tokens/data.yml +3 -1
- data/db/migrate/20111003194443_create_tr8n_sync_tables.rb +22 -0
- data/db/migrate/20111011013640_add_remote_id_to_tr8n_translators.rb +5 -0
- data/doc/classes.graffle +7049 -5152
- data/doc/classes.pdf +0 -0
- data/lib/generators/tr8n/templates/{create_tr8n_tables.rb → db/create_tr8n_tables.rb} +0 -0
- data/lib/generators/tr8n/templates/layouts/tr8n.html.erb +49 -0
- data/lib/generators/tr8n/templates/layouts/tr8n_admin.html.erb +61 -0
- data/lib/generators/tr8n/tr8n_generator.rb +11 -4
- data/lib/tasks/{tr8n_tasks.rake → tr8n.rake} +4 -0
- data/{app/controllers/tr8n/home_controller.rb → lib/tr8n/cache_adapters/memcached.rb} +12 -15
- data/lib/tr8n/config.rb +96 -53
- data/lib/tr8n/extensions/action_controller_extension.rb +1 -1
- data/lib/tr8n/extensions/action_view_extension.rb +4 -28
- data/lib/tr8n/tokens/data_token.rb +1 -1
- data/lib/tr8n/tokens/method_token.rb +1 -1
- data/lib/tr8n/tokens/transform_token.rb +1 -1
- data/lib/tr8n/version.rb +1 -1
- data/{test/dummy → local/tr8n_server}/Rakefile +1 -1
- data/{test/dummy → local/tr8n_server}/app/assets/javascripts/application.js +0 -0
- data/{test/dummy → local/tr8n_server}/app/assets/stylesheets/admin.css +0 -0
- data/{test/dummy → local/tr8n_server}/app/assets/stylesheets/application.css +0 -0
- data/local/tr8n_server/app/assets/stylesheets/components.css.scss +211 -0
- data/local/tr8n_server/app/assets/stylesheets/layout.css.scss +143 -0
- data/{test/dummy → local/tr8n_server}/app/controllers/admin/admins_controller.rb +0 -0
- data/{test/dummy → local/tr8n_server}/app/controllers/admin/base_controller.rb +0 -0
- data/{test/dummy → local/tr8n_server}/app/controllers/admin/users_controller.rb +0 -0
- data/{test/dummy → local/tr8n_server}/app/controllers/application_controller.rb +5 -0
- data/{test/dummy → local/tr8n_server}/app/controllers/demo_controller.rb +0 -0
- data/local/tr8n_server/app/controllers/home_controller.rb +4 -0
- data/{test/dummy → local/tr8n_server}/app/controllers/login_controller.rb +1 -1
- data/{test/dummy → local/tr8n_server}/app/helpers/application_helper.rb +0 -0
- data/{test/dummy → local/tr8n_server}/app/helpers/home_helper.rb +0 -0
- data/{test/dummy → local/tr8n_server}/app/mailers/.gitkeep +0 -0
- data/{test/dummy → local/tr8n_server}/app/models/.gitkeep +0 -0
- data/{test/dummy → local/tr8n_server}/app/models/admin.rb +0 -0
- data/{test/dummy → local/tr8n_server}/app/models/admin_filter.rb +0 -0
- data/{test/dummy → local/tr8n_server}/app/models/user.rb +0 -0
- data/{test/dummy → local/tr8n_server}/app/views/admin/admins/index.html.erb +0 -0
- data/{test/dummy → local/tr8n_server}/app/views/admin/users/index.html.erb +0 -0
- data/{test/dummy → local/tr8n_server}/app/views/demo/index.rhtml +0 -0
- data/{test/dummy → local/tr8n_server}/app/views/demo/tokens.rhtml +0 -0
- data/{app/views/tr8n → local/tr8n_server/app/views}/home/index.html.erb +1 -2
- data/local/tr8n_server/app/views/kaminari/_first_page.html.erb +11 -0
- data/local/tr8n_server/app/views/kaminari/_gap.html.erb +8 -0
- data/local/tr8n_server/app/views/kaminari/_last_page.html.erb +11 -0
- data/local/tr8n_server/app/views/kaminari/_next_page.html.erb +11 -0
- data/local/tr8n_server/app/views/kaminari/_page.html.erb +12 -0
- data/local/tr8n_server/app/views/kaminari/_paginator.html.erb +23 -0
- data/local/tr8n_server/app/views/kaminari/_prev_page.html.erb +11 -0
- data/{test/dummy → local/tr8n_server}/app/views/layouts/_flashes.html.erb +0 -0
- data/{test/dummy → local/tr8n_server}/app/views/layouts/_footer.html.erb +3 -3
- data/{test/dummy → local/tr8n_server}/app/views/layouts/_header.html.erb +1 -1
- data/{test/dummy → local/tr8n_server}/app/views/layouts/admin.html.erb +0 -0
- data/{test/dummy → local/tr8n_server}/app/views/layouts/application.html.erb +0 -0
- data/local/tr8n_server/app/views/layouts/tr8n.html.erb +51 -0
- data/local/tr8n_server/app/views/layouts/tr8n_admin.html.erb +61 -0
- data/{test/dummy → local/tr8n_server}/app/views/login/index.html.erb +0 -0
- data/{test/dummy → local/tr8n_server}/app/views/login/register.html.erb +8 -13
- data/{test/dummy → local/tr8n_server}/config.ru +1 -1
- data/{test/dummy → local/tr8n_server}/config/application.rb +2 -1
- data/{test/dummy → local/tr8n_server}/config/boot.rb +0 -0
- data/{test/dummy → local/tr8n_server}/config/database.yml +0 -0
- data/{test/dummy → local/tr8n_server}/config/environment.rb +1 -1
- data/{test/dummy → local/tr8n_server}/config/environments/development.rb +3 -1
- data/{test/dummy → local/tr8n_server}/config/environments/production.rb +1 -1
- data/{test/dummy → local/tr8n_server}/config/environments/test.rb +1 -1
- data/{test/dummy → local/tr8n_server}/config/initializers/backtrace_silencers.rb +0 -0
- data/{test/dummy → local/tr8n_server}/config/initializers/inflections.rb +0 -0
- data/{test/dummy → local/tr8n_server}/config/initializers/mime_types.rb +0 -0
- data/{test/dummy → local/tr8n_server}/config/initializers/secret_token.rb +1 -1
- data/{test/dummy → local/tr8n_server}/config/initializers/session_store.rb +2 -2
- data/{test/dummy → local/tr8n_server}/config/initializers/wrap_parameters.rb +0 -0
- data/{test/dummy → local/tr8n_server}/config/locales/en.yml +0 -0
- data/{test/dummy → local/tr8n_server}/config/routes.rb +2 -2
- data/{test/dummy → local/tr8n_server}/config/tr8n/config.yml +40 -11
- data/{test/dummy → local/tr8n_server}/config/tr8n/data/ip_locations.csv +0 -0
- data/{test/dummy → local/tr8n_server}/config/tr8n/rules/default_date_rules.yml +0 -0
- data/{test/dummy → local/tr8n_server}/config/tr8n/rules/default_gender_list_rules.yml +0 -0
- data/{test/dummy → local/tr8n_server}/config/tr8n/rules/default_gender_rules.yml +0 -0
- data/local/tr8n_server/config/tr8n/rules/default_language_cases.yml +272 -0
- data/{test/dummy → local/tr8n_server}/config/tr8n/rules/default_list_rules.yml +0 -0
- data/{test/dummy → local/tr8n_server}/config/tr8n/rules/default_numeric_rules.yml +0 -0
- data/{test/dummy → local/tr8n_server}/config/tr8n/rules/default_value_rules.yml +0 -0
- data/{test/dummy → local/tr8n_server}/config/tr8n/site/default_glossary.yml +0 -0
- data/{test/dummy → local/tr8n_server}/config/tr8n/site/default_languages.yml +0 -0
- data/{test/dummy → local/tr8n_server}/config/tr8n/site/features.yml +0 -0
- data/{test/dummy → local/tr8n_server}/config/tr8n/site/shortcuts.yml +0 -0
- data/{test/dummy → local/tr8n_server}/config/tr8n/site/sitemap.json +0 -0
- data/{test/dummy → local/tr8n_server}/config/tr8n/tokens/data.yml +2 -0
- data/{test/dummy → local/tr8n_server}/config/tr8n/tokens/decorations.yml +0 -0
- data/{test/dummy → local/tr8n_server}/config/will_filter/config.yml +0 -0
- data/{test/dummy → local/tr8n_server}/db/migrate/20101207014543_create_users.rb +0 -0
- data/{test/dummy → local/tr8n_server}/db/migrate/20110113223509_create_admins.rb +0 -0
- data/{test/dummy → local/tr8n_server}/db/migrate/20110930041143_create_will_filter_filters.rb +0 -0
- data/{test/dummy → local/tr8n_server}/db/migrate/20110930041150_create_tr8n_tables.rb +0 -0
- data/local/tr8n_server/db/migrate/20111003194443_create_tr8n_sync_tables.rb +22 -0
- data/local/tr8n_server/db/migrate/20111011013640_add_remote_id_to_tr8n_translators.rb +5 -0
- data/{test/dummy → local/tr8n_server}/db/schema.rb +15 -1
- data/{test/dummy → local/tr8n_server}/lib/assets/.gitkeep +0 -0
- data/{test/dummy → local/tr8n_server}/public/404.html +0 -0
- data/{test/dummy → local/tr8n_server}/public/422.html +0 -0
- data/{test/dummy → local/tr8n_server}/public/500.html +0 -0
- data/{test/dummy → local/tr8n_server}/public/favicon.ico +0 -0
- data/{test/dummy → local/tr8n_server}/script/rails +0 -0
- data/script/rails +1 -1
- data/spec/config/config_spec.rb +10 -0
- data/spec/fake_app.rb +50 -0
- data/spec/lib/data_token_spec.rb +26 -0
- data/spec/lib/transform_token_spec.rb +22 -0
- data/spec/models/translation_key_spec.rb +63 -0
- data/spec/spec_helper.rb +29 -0
- data/tr8n.gemspec +3 -1
- metadata +264 -245
- data/app/assets/images/tr8n/tr8n_logo.png +0 -0
- data/app/assets/images/tr8n/tr8n_logo2.gif +0 -0
- data/app/controllers/tr8n/login_controller.rb +0 -86
- data/app/views/layouts/_footer.html.erb +0 -15
- data/app/views/layouts/_header.html.erb +0 -12
- data/app/views/layouts/_html_head.html.erb +0 -5
- data/app/views/layouts/tr8n.html.erb +0 -21
- data/app/views/layouts/tr8n/application.html.erb +0 -14
- data/app/views/layouts/tr8n_admin.html.erb +0 -33
- data/app/views/tr8n/home/languages.html.erb +0 -7
- data/app/views/tr8n/login/index.html.erb +0 -33
- data/app/views/tr8n/login/register.html.erb +0 -57
- data/config/tr8n/rules/default_cases.yml +0 -141
- data/test/dummy/.sass-cache/32be4db30d38349a3a6e662df9bb5599dc8033b9/actions.css.scssc +0 -0
- data/test/dummy/.sass-cache/32be4db30d38349a3a6e662df9bb5599dc8033b9/buttons.css.scssc +0 -0
- data/test/dummy/.sass-cache/32be4db30d38349a3a6e662df9bb5599dc8033b9/calendar.css.scssc +0 -0
- data/test/dummy/.sass-cache/32be4db30d38349a3a6e662df9bb5599dc8033b9/exporter.css.scssc +0 -0
- data/test/dummy/.sass-cache/32be4db30d38349a3a6e662df9bb5599dc8033b9/filter.css.scssc +0 -0
- data/test/dummy/.sass-cache/32be4db30d38349a3a6e662df9bb5599dc8033b9/results.css.scssc +0 -0
- data/test/dummy/.sass-cache/3d45bab40fcae805deb2750a9342f5b355a9f2bf/components.css.scssc +0 -0
- data/test/dummy/.sass-cache/3d45bab40fcae805deb2750a9342f5b355a9f2bf/layout.css.scssc +0 -0
- data/test/dummy/.sass-cache/50f723c1dd802042d0091035528d53e6d5bc5b50/tr8n.css.scssc +0 -0
- data/test/dummy/.sass-cache/bce64928c8e2edcba72a647a44f05af1ff119c5d/actions.css.scssc +0 -0
- data/test/dummy/.sass-cache/bce64928c8e2edcba72a647a44f05af1ff119c5d/buttons.css.scssc +0 -0
- data/test/dummy/.sass-cache/bce64928c8e2edcba72a647a44f05af1ff119c5d/calendar.css.scssc +0 -0
- data/test/dummy/.sass-cache/bce64928c8e2edcba72a647a44f05af1ff119c5d/exporter.css.scssc +0 -0
- data/test/dummy/.sass-cache/bce64928c8e2edcba72a647a44f05af1ff119c5d/filter.css.scssc +0 -0
- data/test/dummy/.sass-cache/bce64928c8e2edcba72a647a44f05af1ff119c5d/results.css.scssc +0 -0
- data/test/dummy/app/assets/stylesheets/keyboard.css +0 -147
- data/test/dummy/config/tr8n/rules/default_cases.yml +0 -141
- data/test/dummy/log/.gitkeep +0 -0
- data/test/dummy/test/functional/home_controller_test.rb +0 -9
- data/test/dummy/test/unit/helpers/home_helper_test.rb +0 -4
- data/test/integration/navigation_test.rb +0 -10
- data/test/test_helper.rb +0 -10
- data/test/tr8n_test.rb +0 -7
data/doc/classes.pdf
CHANGED
Binary file
|
File without changes
|
@@ -0,0 +1,49 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
3
|
+
<head>
|
4
|
+
<title><%=trl("Tr8n Engine Plugin", "Application title")%></title>
|
5
|
+
<%= stylesheet_link_tag("tr8n/layout") %>
|
6
|
+
<%= stylesheet_link_tag("tr8n/components") %>
|
7
|
+
<%= tr8n_scripts_tag %>
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
<div class="document">
|
11
|
+
<div class="page_head">
|
12
|
+
<div class="page_fixed">
|
13
|
+
<div class="mrgn_h">
|
14
|
+
<h1 class="logo"><%=tr("Tr8n Translation Engine", "Application title")%></h1>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<div class="page_fixed">
|
20
|
+
<%= tr8n_flashes_tag %>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<div class="page_fixed">
|
24
|
+
<div class="page_body">
|
25
|
+
<div class="content_module">
|
26
|
+
<div class="content_inner">
|
27
|
+
<%= yield %>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
<div class="page_ft module quiet">
|
32
|
+
<ul class="flt_r right_horiz_list">
|
33
|
+
<li><%=link_to(tr("Home"), "/", :class => "quiet")%></li>
|
34
|
+
<li><%=link_to(tr("Languages"), "/tr8n/language/table", :class => "quiet")%></li>
|
35
|
+
<li><%=link_to(tr("Translator Tools"), "/tr8n/dashboard", :class => "quiet")%></li>
|
36
|
+
<li><%=link_to(tr("Administration Tools"), "/tr8n/admin/language", :class => "quiet")%></li>
|
37
|
+
<li><%=link_to(tr("Credits"), "/tr8n/help/credits", :class => "quiet")%></li>
|
38
|
+
<li><%=link_to(tr("License"), "/tr8n/help/license", :class => "quiet")%></li>
|
39
|
+
</ul>
|
40
|
+
© Copyright 2010 - 2011 tr8n.net
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div style="padding:15px;">
|
44
|
+
<%= tr8n_language_strip_tag %>
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
</div>
|
48
|
+
</body>
|
49
|
+
</html>
|
@@ -0,0 +1,61 @@
|
|
1
|
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
2
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
3
|
+
<head>
|
4
|
+
<title><%=trl("Tr8n Engine Admin Tools", "Application title")%></title>
|
5
|
+
<%= stylesheet_link_tag("tr8n/layout") %>
|
6
|
+
<%= stylesheet_link_tag("tr8n/components") %>
|
7
|
+
<%= tr8n_scripts_tag %>
|
8
|
+
<style>
|
9
|
+
.page_fixed {
|
10
|
+
width:1200px;
|
11
|
+
}
|
12
|
+
.page_body {
|
13
|
+
width:1200px;
|
14
|
+
}
|
15
|
+
|
16
|
+
.wf_form {
|
17
|
+
width: 99.8%;
|
18
|
+
}
|
19
|
+
</style>
|
20
|
+
</head>
|
21
|
+
<body>
|
22
|
+
<div class="document">
|
23
|
+
<div class="page_head">
|
24
|
+
<div class="page_fixed">
|
25
|
+
<div class="mrgn_h">
|
26
|
+
<%= tr8n_translator_login_tag(:class => "flt_r horiz_list top_nav") %>
|
27
|
+
<h1 class="logo"><%=link_to(tr("Tr8n Translation Engine", "Application title"), {:controller => "/tr8n/home"}, :style=>"text-decorations:none;")%></h1>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
<div class="page_fixed">
|
33
|
+
<%= tr8n_flashes_tag %>
|
34
|
+
</div>
|
35
|
+
<div class="page_fixed">
|
36
|
+
<div class="page_body">
|
37
|
+
<div class="content_module">
|
38
|
+
<div class="content_inner">
|
39
|
+
<%= yield %>
|
40
|
+
</div>
|
41
|
+
</div>
|
42
|
+
</div>
|
43
|
+
<div class="page_ft module quiet">
|
44
|
+
<ul class="flt_r right_horiz_list">
|
45
|
+
<li><%=link_to(tr("Home"), "/tr8n/home", :class => "quiet")%></li>
|
46
|
+
<li><%=link_to(tr("Languages"), "/tr8n/language/table", :class => "quiet")%></li>
|
47
|
+
<li><%=link_to(tr("Translator Tools"), "/tr8n/dashboard", :class => "quiet")%></li>
|
48
|
+
<li><%=link_to(tr("Administration Tools"), "/tr8n/admin/language", :class => "quiet")%></li>
|
49
|
+
<li><%=link_to(tr("Credits"), "/tr8n/help/credits", :class => "quiet")%></li>
|
50
|
+
<li><%=link_to(tr("License"), "/tr8n/help/license", :class => "quiet")%></li>
|
51
|
+
</ul>
|
52
|
+
© Copyright 2010 - 2011 tr8n.net
|
53
|
+
</div>
|
54
|
+
|
55
|
+
<div style="padding:15px;">
|
56
|
+
<%= tr8n_language_strip_tag %>
|
57
|
+
</div>
|
58
|
+
</div>
|
59
|
+
</div>
|
60
|
+
</body>
|
61
|
+
</html>
|
@@ -41,9 +41,16 @@ class Tr8nGenerator < Rails::Generators::Base
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def create_migration_file
|
44
|
-
migration_template 'create_tr8n_tables.rb', 'db/migrate/create_tr8n_tables.rb'
|
45
|
-
|
46
|
-
|
47
|
-
|
44
|
+
migration_template 'db/create_tr8n_tables.rb', 'db/migrate/create_tr8n_tables.rb'
|
45
|
+
end
|
46
|
+
|
47
|
+
def copy_configuration
|
48
|
+
config_source = File.expand_path('../../../../config/tr8n', __FILE__)
|
49
|
+
system "rsync -ruv #{config_source} #{Rails.root}/config"
|
50
|
+
end
|
51
|
+
|
52
|
+
def copy_layouts
|
53
|
+
layouts_source = File.expand_path("#{self.class.source_root}/layouts", __FILE__)
|
54
|
+
system "rsync -ruv #{layouts_source} #{Rails.root}/app/views"
|
48
55
|
end
|
49
56
|
end
|
@@ -21,19 +21,16 @@
|
|
21
21
|
# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
22
22
|
#++
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
def credits
|
37
|
-
|
24
|
+
module Tr8n
|
25
|
+
module CacheAdapters
|
26
|
+
class Memcached
|
27
|
+
def fetch(key, options = {})
|
28
|
+
yield
|
29
|
+
end
|
30
|
+
|
31
|
+
def delete(key)
|
32
|
+
yield
|
33
|
+
end
|
34
|
+
end
|
38
35
|
end
|
39
|
-
end
|
36
|
+
end
|
data/lib/tr8n/config.rb
CHANGED
@@ -65,6 +65,16 @@ module Tr8n
|
|
65
65
|
return Tr8n::Language.new(:locale => default_locale) if disabled?
|
66
66
|
@default_language ||= Tr8n::Language.for(default_locale) || Tr8n::Language.new(:locale => default_locale)
|
67
67
|
end
|
68
|
+
|
69
|
+
# only one allowed per system
|
70
|
+
def self.system_translator
|
71
|
+
@system_translator ||= Tr8n::Translator.where(:level => system_level).first || Tr8n::Translator.create(:user_id => 0, :level => system_level)
|
72
|
+
end
|
73
|
+
|
74
|
+
# only one allowed per application
|
75
|
+
def self.application_translator_for(user)
|
76
|
+
Tr8n::Translator.where(:user_id => user.id, :level => application_level).first || Tr8n::Translator.create(:user_id => user.id, :level => application_level)
|
77
|
+
end
|
68
78
|
|
69
79
|
def self.reset!
|
70
80
|
# thread based variables
|
@@ -288,6 +298,10 @@ module Tr8n
|
|
288
298
|
config[:api]
|
289
299
|
end
|
290
300
|
|
301
|
+
def self.synchronization
|
302
|
+
config[:synchronization]
|
303
|
+
end
|
304
|
+
|
291
305
|
#########################################################
|
292
306
|
# Caching
|
293
307
|
def self.enable_caching?
|
@@ -420,80 +434,71 @@ module Tr8n
|
|
420
434
|
end
|
421
435
|
|
422
436
|
def self.user_id(user)
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
end
|
437
|
+
return 0 unless user
|
438
|
+
user.send(site_user_info[:methods][:id])
|
439
|
+
rescue Exception => ex
|
440
|
+
Tr8n::Logger.error("Failed to fetch user id: #{ex.to_s}")
|
441
|
+
0
|
429
442
|
end
|
430
443
|
|
431
444
|
def self.user_name(user)
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
end
|
445
|
+
return "Unknown user" unless user
|
446
|
+
user.send(site_user_info[:methods][:name])
|
447
|
+
rescue Exception => ex
|
448
|
+
Tr8n::Logger.error("Failed to fetch #{user_class_name} name: #{ex.to_s}")
|
449
|
+
"Invalid user"
|
438
450
|
end
|
439
451
|
|
440
452
|
def self.user_gender(user)
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
end
|
453
|
+
return "unknown" unless user
|
454
|
+
user.send(site_user_info[:methods][:gender])
|
455
|
+
rescue Exception => ex
|
456
|
+
Tr8n::Logger.error("Failed to fetch #{user_class_name} name: #{ex.to_s}")
|
457
|
+
"unknown"
|
447
458
|
end
|
448
459
|
|
449
460
|
def self.user_mugshot(user)
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
end
|
461
|
+
return silhouette_image unless user
|
462
|
+
user.send(site_user_info[:methods][:mugshot])
|
463
|
+
rescue Exception => ex
|
464
|
+
Tr8n::Logger.error("Failed to fetch #{user_class_name} image: #{ex.to_s}")
|
465
|
+
silhouette_image
|
456
466
|
end
|
457
467
|
|
458
468
|
def self.user_link(user)
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
end
|
469
|
+
return "/tr8n" unless user
|
470
|
+
user.send(site_user_info[:methods][:link])
|
471
|
+
rescue Exception => ex
|
472
|
+
Tr8n::Logger.error("Failed to fetch #{user_class_name} link: #{ex.to_s}")
|
473
|
+
"/tr8n"
|
465
474
|
end
|
466
475
|
|
467
476
|
def self.user_locale(user)
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
end
|
477
|
+
return default_locale unless user
|
478
|
+
user.send(site_user_info[:methods][:locale])
|
479
|
+
rescue Exception => ex
|
480
|
+
Tr8n::Logger.error("Failed to fetch #{user_class_name} locale: #{ex.to_s}")
|
481
|
+
default_locale
|
474
482
|
end
|
475
483
|
|
476
|
-
def self.admin_user?(user = current_user)
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
end
|
484
|
+
def self.admin_user?(user = Tr8n::Config.current_user)
|
485
|
+
return false unless user
|
486
|
+
user.send(site_user_info[:methods][:admin])
|
487
|
+
rescue Exception => ex
|
488
|
+
Tr8n::Logger.error("Failed to fetch #{user_class_name} admin flag: #{ex.to_s}")
|
489
|
+
false
|
483
490
|
end
|
484
491
|
|
485
492
|
def self.current_user_is_admin?
|
486
493
|
admin_user?
|
487
494
|
end
|
488
495
|
|
489
|
-
def self.guest_user?(user = current_user)
|
496
|
+
def self.guest_user?(user = Tr8n::Config.current_user)
|
490
497
|
return true unless user
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
return true
|
496
|
-
end
|
498
|
+
user.send(site_user_info[:methods][:guest])
|
499
|
+
rescue Exception => ex
|
500
|
+
Tr8n::Logger.error("Failed to fetch #{user_class_name} guest flag: #{ex.to_s}")
|
501
|
+
true
|
497
502
|
end
|
498
503
|
|
499
504
|
def self.current_user_is_guest?
|
@@ -503,6 +508,10 @@ module Tr8n
|
|
503
508
|
def self.silhouette_image
|
504
509
|
"/assets/tr8n/photo_silhouette.gif"
|
505
510
|
end
|
511
|
+
|
512
|
+
def self.system_image
|
513
|
+
"/assets/tr8n/photo_system.gif"
|
514
|
+
end
|
506
515
|
|
507
516
|
#########################################################
|
508
517
|
# rules engine
|
@@ -623,8 +632,8 @@ module Tr8n
|
|
623
632
|
load_default_rules("value", locale)
|
624
633
|
end
|
625
634
|
|
626
|
-
def self.
|
627
|
-
@default_cases ||= load_yml("/config/tr8n/rules/
|
635
|
+
def self.default_language_cases_for(locale = default_locale)
|
636
|
+
@default_cases ||= load_yml("/config/tr8n/rules/default_language_cases.yml", nil)
|
628
637
|
return [] unless @default_cases[locale.to_s]
|
629
638
|
@default_cases[locale.to_s].values
|
630
639
|
end
|
@@ -702,6 +711,14 @@ module Tr8n
|
|
702
711
|
10000
|
703
712
|
end
|
704
713
|
|
714
|
+
def self.application_level
|
715
|
+
100000
|
716
|
+
end
|
717
|
+
|
718
|
+
def self.system_level
|
719
|
+
1000000
|
720
|
+
end
|
721
|
+
|
705
722
|
def self.default_translation_key_level
|
706
723
|
config[:default_translation_key_level] || 0
|
707
724
|
end
|
@@ -716,6 +733,32 @@ module Tr8n
|
|
716
733
|
def self.enable_client_sdk?
|
717
734
|
config[:enable_client_sdk]
|
718
735
|
end
|
719
|
-
|
736
|
+
|
737
|
+
#########################################################
|
738
|
+
# Sync Process
|
739
|
+
#########################################################
|
740
|
+
def self.synchronization_batch_size
|
741
|
+
synchronization[:batch_size]
|
742
|
+
end
|
743
|
+
|
744
|
+
def self.synchronization_server
|
745
|
+
synchronization[:server]
|
746
|
+
end
|
747
|
+
|
748
|
+
def self.synchronization_key
|
749
|
+
synchronization[:key]
|
750
|
+
end
|
751
|
+
|
752
|
+
def self.synchronization_secret
|
753
|
+
synchronization[:secret]
|
754
|
+
end
|
755
|
+
|
756
|
+
def self.synchronization_create_rules?
|
757
|
+
synchronization[:create_rules]
|
758
|
+
end
|
759
|
+
|
760
|
+
def self.synchronization_all_languages?
|
761
|
+
synchronization[:all_languages]
|
762
|
+
end
|
720
763
|
end
|
721
764
|
end
|
@@ -324,34 +324,6 @@ module Tr8n
|
|
324
324
|
end
|
325
325
|
end
|
326
326
|
|
327
|
-
def tr8n_will_paginate(collection = nil, options = {})
|
328
|
-
will_paginate(collection, options.merge(:previous_label => tr("« Previous", "Previous entries in a list", {}, options),
|
329
|
-
:next_label => tr("Next »", "Next entries in a list", {}, options))).html_safe
|
330
|
-
end
|
331
|
-
|
332
|
-
def tr8n_page_entries_info(collection, options = {})
|
333
|
-
entry_name = options[:entry_name] || (collection.empty? ? 'entry' : collection.first.class.name.underscore.sub('_', ' '))
|
334
|
-
|
335
|
-
if collection.total_pages < 2
|
336
|
-
case collection.size
|
337
|
-
when 0
|
338
|
-
tr("None found", "Paginator no entries message", {}, options)
|
339
|
-
when 1
|
340
|
-
tr("Displaying [bold: 1] #{entry_name}", "Paginator one page message", {}, options)
|
341
|
-
else
|
342
|
-
tr("Displaying [bold: all {count}] #{entry_name.pluralize}", "Paginator all entries message", {:count => collection.size}, options)
|
343
|
-
end
|
344
|
-
else
|
345
|
-
tr("Displaying #{entry_name.pluralize} [bold: {start_num} - {end_num}] of [bold: {total_count}] in total",
|
346
|
-
"Paginator custom message", {
|
347
|
-
:start_num => collection.offset + 1,
|
348
|
-
:end_num => collection.offset + collection.length,
|
349
|
-
:total_count => collection.total_entries
|
350
|
-
}, options
|
351
|
-
)
|
352
|
-
end
|
353
|
-
end
|
354
|
-
|
355
327
|
def tr8n_select_month(date, options = {}, html_options = {})
|
356
328
|
month_names = options[:use_short_month] ? Tr8n::Config.default_abbr_month_names : Tr8n::Config.default_month_names
|
357
329
|
select_month(date, options.merge(
|
@@ -372,6 +344,10 @@ module Tr8n
|
|
372
344
|
link_to_function("<span>#{label}</span>".html_safe, function, :class => "tr8n_grey_button tr8n_pcb")
|
373
345
|
end
|
374
346
|
|
347
|
+
def tr8n_paginator_tag(collection, options)
|
348
|
+
render :partial => "/tr8n/common/paginator", :locals => {:collection => collection, :options => options}
|
349
|
+
end
|
350
|
+
|
375
351
|
private
|
376
352
|
|
377
353
|
def generate_sitemap(sections, options = {})
|