spree 0.10.2 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of spree might be problematic. Click here for more details.
- data/CHANGELOG +81 -4
- data/CONTRIBUTORS +18 -10
- data/Rakefile +5 -4
- data/app/controllers/admin/adjustments_controller.rb +17 -3
- data/app/controllers/admin/base_controller.rb +2 -2
- data/app/controllers/admin/checkouts_controller.rb +43 -34
- data/app/controllers/admin/line_items_controller.rb +32 -18
- data/app/controllers/admin/option_types_controller.rb +1 -1
- data/app/controllers/admin/orders_controller.rb +28 -7
- data/app/controllers/admin/payments_controller.rb +7 -7
- data/app/controllers/admin/products_controller.rb +12 -23
- data/app/controllers/admin/reports_controller.rb +19 -7
- data/app/controllers/admin/return_authorizations_controller.rb +1 -1
- data/app/controllers/admin/shipments_controller.rb +9 -9
- data/app/controllers/admin/users_controller.rb +3 -1
- data/app/controllers/admin/variants_controller.rb +2 -2
- data/app/controllers/checkouts_controller.rb +29 -18
- data/app/controllers/content_controller.rb +1 -1
- data/{vendor/extensions/localization/app → app}/controllers/locale_controller.rb +1 -1
- data/app/controllers/orders_controller.rb +33 -30
- data/app/controllers/password_resets_controller.rb +4 -4
- data/app/controllers/products_controller.rb +0 -6
- data/app/controllers/spree/base_controller.rb +9 -2
- data/app/controllers/user_sessions_controller.rb +18 -18
- data/app/controllers/users_controller.rb +2 -2
- data/app/helpers/admin/base_helper.rb +5 -2
- data/app/helpers/admin/navigation_helper.rb +1 -1
- data/app/helpers/admin/orders_helper.rb +0 -13
- data/app/helpers/admin/products_helper.rb +0 -8
- data/app/helpers/checkouts_helper.rb +5 -5
- data/app/helpers/products_helper.rb +0 -12
- data/app/helpers/spree/base_helper.rb +10 -39
- data/app/helpers/taxons_helper.rb +1 -0
- data/app/models/address.rb +6 -1
- data/app/models/app_configuration.rb +15 -14
- data/app/models/calculator/flexi_rate.rb +2 -1
- data/app/models/calculator/vat.rb +1 -1
- data/app/models/checkout.rb +1 -1
- data/app/models/creditcard.rb +26 -20
- data/app/models/inventory_unit.rb +70 -21
- data/app/models/line_item.rb +25 -11
- data/app/models/order.rb +16 -10
- data/app/models/payment.rb +4 -1
- data/app/models/payment_method.rb +14 -5
- data/app/models/product.rb +12 -4
- data/app/models/role.rb +2 -2
- data/app/models/shipment.rb +21 -2
- data/app/models/tax_category.rb +8 -0
- data/app/models/taxon.rb +8 -0
- data/app/models/user.rb +2 -3
- data/app/models/variant.rb +18 -13
- data/config/boot.rb +1 -5
- data/config/cucumber.yml +7 -0
- data/config/database.yml +20 -37
- data/config/database.yml.example +5 -6
- data/config/environment.rb +6 -5
- data/config/environments/cucumber.rb +30 -0
- data/config/environments/production.rb +1 -4
- data/config/environments/staging.rb +3 -0
- data/config/environments/test.rb +1 -1
- data/config/initializers/cookie_verification_secret.rb +7 -0
- data/config/initializers/locales.rb +4 -2
- data/config/initializers/new_rails_defaults.rb +2 -0
- data/config/initializers/spree.rb +1 -0
- data/config/initializers/workarounds_for_ruby19.rb +0 -25
- data/config/locales/{en-US.yml → en_spree.yml} +18 -4
- data/config/routes.rb +2 -1
- data/db/migrate/20100317120946_add_alt_text_to_images.rb +9 -0
- data/db/migrate/20100427121301_add_display_to_payment_methods.rb +9 -0
- data/db/migrate/20100504142133_add_addresses_checkouts_indexes.rb +16 -0
- data/db/migrate/20100506180619_add_icon_to_taxons.rb +18 -0
- data/db/migrate/20100506185838_add_description_to_taxons.rb +11 -0
- data/db/migrate/20100528155333_index_for_shipments_number.rb +9 -0
- data/db/migrate/20100528185820_add_index_on_users_persistence_token.rb +9 -0
- data/db/migrate/20100605152042_add_default_to_tax_categories.rb +9 -0
- data/db/sample/payment_methods.yml +8 -1
- data/db/sample/shipments.yml +2 -2
- data/db/schema.rb +54 -21
- data/features/checkout.feature +98 -0
- data/features/create_admin_user.feature +18 -0
- data/features/search.feature +35 -0
- data/features/sign_in.feature +25 -0
- data/features/sign_out.feature +12 -0
- data/features/sign_up.feature +20 -0
- data/features/step_definitions/error_steps.rb +3 -0
- data/features/step_definitions/model_steps.rb +3 -0
- data/features/step_definitions/pickle_steps.rb +73 -0
- data/features/step_definitions/role_steps.rb +8 -0
- data/features/step_definitions/session_steps.rb +14 -0
- data/features/step_definitions/user_steps.rb +67 -0
- data/features/step_definitions/web_steps.rb +197 -0
- data/features/support/create_admin_user.rb +6 -0
- data/features/support/env.rb +89 -0
- data/features/support/paths.rb +32 -0
- data/features/support/pickle.rb +24 -0
- data/features/work_with_cart.feature +41 -0
- data/lib/generators/extension_model/extension_model_generator.rb +10 -10
- data/lib/generators/instance/templates/databases/mysql.yml +11 -0
- data/lib/scopes/variant.rb +10 -0
- data/lib/spree.rb +3 -3
- data/lib/spree/extensions.rb +1 -1
- data/lib/tasks/cucumber.rake +47 -0
- data/lib/tasks/database.rake +29 -29
- data/public/images/admin/bg/spree_50.png +0 -0
- data/public/images/tile-header.png +0 -0
- data/public/images/tile-slider.png +0 -0
- data/public/javascripts/admin/checkouts/edit.js +33 -0
- data/public/javascripts/dashboard.js +2 -2
- data/public/javascripts/taxonomy.js +2 -2
- data/public/stylesheets/admin/admin-tables.css +4 -0
- data/public/stylesheets/admin/admin.css +31 -16
- data/public/stylesheets/screen.css +16 -3
- data/script/about +3 -2
- data/script/console +2 -2
- data/script/cucumber +10 -0
- data/script/dbconsole +1 -1
- data/script/destroy +2 -2
- data/script/generate +2 -2
- data/script/performance/benchmarker +1 -1
- data/script/performance/profiler +1 -1
- data/script/plugin +2 -2
- data/script/runner +2 -2
- data/script/server +2 -2
- data/test/fixtures/payment_methods.yml +12 -0
- data/test/functional/admin/checkouts_controller_test.rb +0 -2
- data/test/functional/admin/line_items_controller_test.rb +78 -39
- data/test/functional/admin/products_controller_test.rb +4 -5
- data/test/integration/checkout_test.rb +1 -0
- data/test/test_helper.rb +114 -86
- data/test/unit/creditcard_test.rb +28 -7
- data/test/unit/flexi_rate_calculator_test.rb +75 -0
- data/test/unit/helpers/products_helper_test.rb +4 -4
- data/test/unit/inventory_unit_test.rb +39 -5
- data/test/unit/line_item_test.rb +60 -1
- data/test/unit/order_state_test.rb +85 -58
- data/test/unit/order_test.rb +144 -123
- data/test/unit/product_test.rb +21 -0
- data/test/unit/return_authorization_test.rb +22 -28
- data/test/unit/shipment_test.rb +19 -7
- data/test/unit/variant_test.rb +100 -24
- data/vendor/extensions/api/api_extension.rb +2 -2
- data/vendor/extensions/api/app/controllers/api/base_controller.rb +14 -6
- data/vendor/extensions/api/app/controllers/api/countries_controller.rb +4 -0
- data/vendor/extensions/api/app/controllers/api/orders_controller.rb +4 -4
- data/vendor/extensions/api/app/controllers/api/products_controller.rb +5 -1
- data/vendor/extensions/api/app/controllers/api/shipments_controller.rb +7 -7
- data/vendor/extensions/api/app/controllers/api/states_controller.rb +5 -0
- data/vendor/extensions/api/config/locales/{en-US.yml → en.yml} +2 -2
- data/vendor/extensions/api/config/routes.rb +5 -0
- data/vendor/extensions/api/test/integration/orders_api_test.rb +4 -4
- data/vendor/extensions/overview_dashboard/app/views/admin/overview/index.html.erb +1 -1
- data/vendor/extensions/payment_gateway/app/models/gateway.rb +1 -1
- data/vendor/extensions/payment_gateway/app/models/gateway/authorize_net_cim.rb +41 -29
- data/vendor/extensions/payment_gateway/app/models/gateway/bogus.rb +3 -3
- data/vendor/extensions/payment_gateway/app/models/gateway/eway.rb +11 -0
- data/vendor/extensions/payment_gateway/app/models/gateway/sage_pay.rb +9 -0
- data/vendor/extensions/payment_gateway/config/locales/{en-US.yml → en.yml} +1 -1
- data/vendor/extensions/payment_gateway/lib/spree/payment_gateway.rb +46 -56
- data/vendor/extensions/payment_gateway/payment_gateway_extension.rb +9 -10
- data/vendor/extensions/payment_gateway/test/unit/authorize_net_cim_test.rb +7 -6
- data/vendor/extensions/theme_default/app/stylesheets/_checkout.less +10 -3
- data/vendor/extensions/theme_default/app/views/admin/adjustments/index.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/checkouts/_form.html.erb +31 -5
- data/vendor/extensions/theme_default/app/views/admin/checkouts/show.html.erb +27 -16
- data/vendor/extensions/theme_default/app/views/admin/images/_form.html.erb +4 -0
- data/vendor/extensions/theme_default/app/views/admin/images/index.html.erb +16 -13
- data/vendor/extensions/theme_default/app/views/admin/orders/_add_product.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/orders/_form.html.erb +7 -0
- data/vendor/extensions/theme_default/app/views/admin/orders/index.html.erb +5 -5
- data/vendor/extensions/theme_default/app/views/admin/payment_methods/_form.html.erb +12 -6
- data/vendor/extensions/theme_default/app/views/admin/payment_methods/index.html.erb +22 -11
- data/vendor/extensions/theme_default/app/views/admin/product_groups/update.js.erb +2 -2
- data/vendor/extensions/theme_default/app/views/admin/products/_form.html.erb +6 -4
- data/vendor/extensions/theme_default/app/views/admin/shared/_address_form.html.erb +64 -55
- data/vendor/extensions/theme_default/app/views/admin/shared/_configuration_menu.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/shared/_order_tabs.html.erb +11 -3
- data/vendor/extensions/theme_default/app/views/admin/shared/_product_tabs.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/shipments/_form.html.erb +32 -29
- data/vendor/extensions/theme_default/app/views/admin/shipments/index.html.erb +2 -1
- data/vendor/extensions/theme_default/app/views/admin/tax_categories/_form.html.erb +6 -3
- data/vendor/extensions/theme_default/app/views/admin/tax_categories/index.html.erb +4 -2
- data/vendor/extensions/theme_default/app/views/admin/taxonomies/_taxon.html.erb +2 -2
- data/vendor/extensions/theme_default/app/views/admin/taxons/_form.html.erb +11 -1
- data/vendor/extensions/theme_default/app/views/admin/taxons/edit.html.erb +2 -2
- data/vendor/extensions/theme_default/app/views/admin/users/_form.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/admin/variants/_form.html.erb +4 -2
- data/vendor/extensions/theme_default/app/views/checkouts/_confirm.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/checkouts/_delivery.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/checkouts/_summary.html.erb +6 -6
- data/vendor/extensions/theme_default/app/views/checkouts/edit.html.erb +3 -3
- data/vendor/extensions/theme_default/app/views/layouts/admin.html.erb +7 -5
- data/vendor/extensions/theme_default/app/views/layouts/spree_application.html.erb +8 -4
- data/vendor/extensions/theme_default/app/views/orders/_line_item.html.erb +1 -1
- data/vendor/extensions/theme_default/app/views/products/index.html.erb +0 -1
- data/vendor/extensions/theme_default/app/views/shared/_footer.html.erb +4 -2
- data/vendor/extensions/theme_default/app/views/shared/_products.html.erb +3 -1
- data/vendor/extensions/theme_default/app/views/shared/_user_form.html.erb +1 -1
- data/vendor/extensions/theme_default/public/images/admin/bg/spree_50.png +0 -0
- data/vendor/extensions/theme_default/public/images/tile-header.png +0 -0
- data/vendor/extensions/theme_default/public/images/tile-slider.png +0 -0
- data/vendor/extensions/theme_default/public/javascripts/admin/checkouts/edit.js +50 -0
- data/vendor/extensions/theme_default/public/javascripts/taxonomy.js +2 -2
- data/vendor/extensions/theme_default/public/stylesheets/admin/admin-tables.css +8 -0
- data/vendor/extensions/theme_default/public/stylesheets/admin/admin.css +31 -16
- data/vendor/extensions/theme_default/public/stylesheets/screen.css +16 -3
- data/vendor/plugins/attribute_fu/{tasks → lib/tasks}/attribute_fu_tasks.rake +0 -0
- data/vendor/plugins/enumerable_constants/{tasks → lib/tasks}/enumerable_constants_tasks.rake +0 -0
- data/vendor/plugins/find_by_param/lib/find_by_param.rb +9 -5
- data/vendor/plugins/find_by_param/{tasks → lib/tasks}/find_by_param_tasks.rake +0 -0
- data/vendor/plugins/jrails/{tasks → lib/tasks}/jrails.rake +0 -0
- data/vendor/plugins/jrails_auto_complete/{tasks → lib/tasks}/jrails_auto_complete_tasks.rake +0 -0
- data/vendor/plugins/mail_queue/{tasks → lib/tasks}/mailer_queue_tasks.rake +0 -0
- data/vendor/plugins/open_id_authentication/{tasks → lib/tasks}/open_id_authentication_tasks.rake +0 -0
- data/vendor/plugins/resource_controller/lib/resource_controller/helpers/internal.rb +2 -2
- data/vendor/plugins/ssl_requirement/lib/ssl_requirement.rb +7 -7
- data/vendor/plugins/unobtrusive_date_picker/{tasks → lib/tasks}/datepicker_tasks.rake +0 -0
- metadata +82 -342
- data/app/helpers/admin/adjustments_helper.rb +0 -2
- data/app/helpers/admin/checkouts_helper.rb +0 -2
- data/app/helpers/admin/line_items_helper.rb +0 -2
- data/app/helpers/admin/properties_helper.rb +0 -9
- data/app/helpers/admin/prototypes_helper.rb +0 -18
- data/app/helpers/admin/return_authorizations_helper.rb +0 -2
- data/config/locales/cs-CZ.yml +0 -924
- data/config/locales/cs-CZ_rails.yml +0 -202
- data/config/locales/da.yml +0 -924
- data/config/locales/da_rails.yml +0 -197
- data/config/locales/de-CH.yml +0 -924
- data/config/locales/de-CH_rails.yml +0 -142
- data/config/locales/de.yml +0 -924
- data/config/locales/de_rails.yml +0 -140
- data/config/locales/en-AU.yml +0 -924
- data/config/locales/en-AU_rails.yml +0 -202
- data/config/locales/en-GB.yml +0 -924
- data/config/locales/en-GB_rails.yml +0 -196
- data/config/locales/en-US_rails.yml +0 -200
- data/config/locales/es.yml +0 -924
- data/config/locales/es_rails.yml +0 -173
- data/config/locales/fi.yml +0 -924
- data/config/locales/fi_rails.yml +0 -143
- data/config/locales/fr-FR.yml +0 -924
- data/config/locales/fr-FR_rails.yml +0 -123
- data/config/locales/il.yml +0 -924
- data/config/locales/il_rails.yml +0 -103
- data/config/locales/it.yml +0 -924
- data/config/locales/it_rails.yml +0 -146
- data/config/locales/jp.yml +0 -924
- data/config/locales/jp_rails.yml +0 -135
- data/config/locales/mx.yml +0 -924
- data/config/locales/mx_rails.yml +0 -181
- data/config/locales/nb-NO.yml +0 -924
- data/config/locales/nb-NO_rails.yml +0 -105
- data/config/locales/nl-BE.yml +0 -924
- data/config/locales/nl-BE_rails.yml +0 -155
- data/config/locales/nl-NL.yml +0 -924
- data/config/locales/nl-NL_rails.yml +0 -172
- data/config/locales/pl.yml +0 -924
- data/config/locales/pl_rails.yml +0 -118
- data/config/locales/pt-BR.yml +0 -924
- data/config/locales/pt-BR_rails.yml +0 -138
- data/config/locales/pt-PT.yml +0 -924
- data/config/locales/pt-PT_rails.yml +0 -133
- data/config/locales/ru-RU.yml +0 -924
- data/config/locales/ru-RU_rails.yml +0 -206
- data/config/locales/th.yml +0 -924
- data/config/locales/th_rails.yml +0 -195
- data/config/locales/vn.yml +0 -924
- data/config/locales/vn_rails.yml +0 -202
- data/lib/tasks/translation.rake +0 -102
- data/vendor/extensions/localization/README.rdoc +0 -5
- data/vendor/extensions/localization/Rakefile +0 -120
- data/vendor/extensions/localization/app/controllers/admin/localization_controller.rb +0 -2
- data/vendor/extensions/localization/app/helpers/locale_helper.rb +0 -2
- data/vendor/extensions/localization/app/helpers/localization_helper.rb +0 -2
- data/vendor/extensions/localization/app/views/shared/_language_bar.html.erb +0 -8
- data/vendor/extensions/localization/config/routes.rb +0 -4
- data/vendor/extensions/localization/lib/localization/user_preferences.rb +0 -9
- data/vendor/extensions/localization/lib/tasks/localization_extension_tasks.rake +0 -17
- data/vendor/extensions/localization/localization_extension.rb +0 -21
- data/vendor/extensions/localization/public/images/flags/ad.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ae.png +0 -0
- data/vendor/extensions/localization/public/images/flags/af.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ag.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ai.png +0 -0
- data/vendor/extensions/localization/public/images/flags/al.png +0 -0
- data/vendor/extensions/localization/public/images/flags/am.png +0 -0
- data/vendor/extensions/localization/public/images/flags/an.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ao.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ar.png +0 -0
- data/vendor/extensions/localization/public/images/flags/as.png +0 -0
- data/vendor/extensions/localization/public/images/flags/at.png +0 -0
- data/vendor/extensions/localization/public/images/flags/au.png +0 -0
- data/vendor/extensions/localization/public/images/flags/aw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ax.png +0 -0
- data/vendor/extensions/localization/public/images/flags/az.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ba.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bb.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bd.png +0 -0
- data/vendor/extensions/localization/public/images/flags/be.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bh.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bi.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bj.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bo.png +0 -0
- data/vendor/extensions/localization/public/images/flags/br.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bs.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bv.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/by.png +0 -0
- data/vendor/extensions/localization/public/images/flags/bz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ca.png +0 -0
- data/vendor/extensions/localization/public/images/flags/catalonia.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cd.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ch.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ci.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ck.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cl.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/co.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cs.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cv.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cx.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cy.png +0 -0
- data/vendor/extensions/localization/public/images/flags/cz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/da.png +0 -0
- data/vendor/extensions/localization/public/images/flags/de.png +0 -0
- data/vendor/extensions/localization/public/images/flags/de_CH.png +0 -0
- data/vendor/extensions/localization/public/images/flags/dj.png +0 -0
- data/vendor/extensions/localization/public/images/flags/dm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/do.png +0 -0
- data/vendor/extensions/localization/public/images/flags/dz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ec.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ee.png +0 -0
- data/vendor/extensions/localization/public/images/flags/eg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/eh.png +0 -0
- data/vendor/extensions/localization/public/images/flags/england.png +0 -0
- data/vendor/extensions/localization/public/images/flags/er.png +0 -0
- data/vendor/extensions/localization/public/images/flags/es.png +0 -0
- data/vendor/extensions/localization/public/images/flags/et.png +0 -0
- data/vendor/extensions/localization/public/images/flags/europeanunion.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fam.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fi.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fj.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fo.png +0 -0
- data/vendor/extensions/localization/public/images/flags/fr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ga.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gb.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gd.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ge.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gh.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gi.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gl.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gp.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gq.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gs.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/gy.png +0 -0
- data/vendor/extensions/localization/public/images/flags/hk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/hm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/hn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/hr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ht.png +0 -0
- data/vendor/extensions/localization/public/images/flags/hu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/id.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ie.png +0 -0
- data/vendor/extensions/localization/public/images/flags/il.png +0 -0
- data/vendor/extensions/localization/public/images/flags/in.png +0 -0
- data/vendor/extensions/localization/public/images/flags/io.png +0 -0
- data/vendor/extensions/localization/public/images/flags/iq.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ir.png +0 -0
- data/vendor/extensions/localization/public/images/flags/is.png +0 -0
- data/vendor/extensions/localization/public/images/flags/it.png +0 -0
- data/vendor/extensions/localization/public/images/flags/jm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/jo.png +0 -0
- data/vendor/extensions/localization/public/images/flags/jp.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ke.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kh.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ki.png +0 -0
- data/vendor/extensions/localization/public/images/flags/km.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kp.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ky.png +0 -0
- data/vendor/extensions/localization/public/images/flags/kz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/la.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lb.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/li.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ls.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/lv.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ly.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ma.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/md.png +0 -0
- data/vendor/extensions/localization/public/images/flags/me.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mh.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ml.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mo.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mp.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mq.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ms.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mv.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mx.png +0 -0
- data/vendor/extensions/localization/public/images/flags/my.png +0 -0
- data/vendor/extensions/localization/public/images/flags/mz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/na.png +0 -0
- data/vendor/extensions/localization/public/images/flags/nc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ne.png +0 -0
- data/vendor/extensions/localization/public/images/flags/nf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ng.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ni.png +0 -0
- data/vendor/extensions/localization/public/images/flags/nl.png +0 -0
- data/vendor/extensions/localization/public/images/flags/no.png +0 -0
- data/vendor/extensions/localization/public/images/flags/np.png +0 -0
- data/vendor/extensions/localization/public/images/flags/nr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/nu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/nz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/om.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pa.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pe.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ph.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pl.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ps.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/pw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/py.png +0 -0
- data/vendor/extensions/localization/public/images/flags/qa.png +0 -0
- data/vendor/extensions/localization/public/images/flags/re.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ro.png +0 -0
- data/vendor/extensions/localization/public/images/flags/rs.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ru.png +0 -0
- data/vendor/extensions/localization/public/images/flags/rw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sa.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sb.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/scotland.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sd.png +0 -0
- data/vendor/extensions/localization/public/images/flags/se.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sh.png +0 -0
- data/vendor/extensions/localization/public/images/flags/si.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sj.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sl.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/so.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/st.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sv.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sy.png +0 -0
- data/vendor/extensions/localization/public/images/flags/sz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/td.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/th.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tj.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tk.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tl.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/to.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tr.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tv.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tw.png +0 -0
- data/vendor/extensions/localization/public/images/flags/tz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ua.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ug.png +0 -0
- data/vendor/extensions/localization/public/images/flags/um.png +0 -0
- data/vendor/extensions/localization/public/images/flags/us.png +0 -0
- data/vendor/extensions/localization/public/images/flags/uy.png +0 -0
- data/vendor/extensions/localization/public/images/flags/uz.png +0 -0
- data/vendor/extensions/localization/public/images/flags/va.png +0 -0
- data/vendor/extensions/localization/public/images/flags/vc.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ve.png +0 -0
- data/vendor/extensions/localization/public/images/flags/vg.png +0 -0
- data/vendor/extensions/localization/public/images/flags/vi.png +0 -0
- data/vendor/extensions/localization/public/images/flags/vn.png +0 -0
- data/vendor/extensions/localization/public/images/flags/vu.png +0 -0
- data/vendor/extensions/localization/public/images/flags/wales.png +0 -0
- data/vendor/extensions/localization/public/images/flags/wf.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ws.png +0 -0
- data/vendor/extensions/localization/public/images/flags/ye.png +0 -0
- data/vendor/extensions/localization/public/images/flags/yt.png +0 -0
- data/vendor/extensions/localization/public/images/flags/za.png +0 -0
- data/vendor/extensions/localization/public/images/flags/zm.png +0 -0
- data/vendor/extensions/localization/public/images/flags/zw.png +0 -0
- data/vendor/extensions/localization/spec/controllers/admin/localization_controller_spec.rb +0 -10
- data/vendor/extensions/localization/spec/controllers/locale_controller_spec.rb +0 -35
- data/vendor/extensions/localization/spec/helpers/locale_helper_spec.rb +0 -5
- data/vendor/extensions/localization/spec/helpers/localization_helper_spec.rb +0 -5
- data/vendor/extensions/localization/spec/spec.opts +0 -6
- data/vendor/extensions/localization/spec/spec_helper.rb +0 -37
- data/vendor/extensions/payment_gateway/app/models/gateway/protx.rb +0 -9
- data/vendor/extensions/theme_default/app/views/admin/taxonomies/_manage_products.rhtml +0 -31
- data/vendor/extensions/theme_default/app/views/admin/taxonomies/_success.rhtml +0 -1
data/config/locales/vn_rails.yml
DELETED
@@ -1,202 +0,0 @@
|
|
1
|
-
vn:
|
2
|
-
date:
|
3
|
-
formats:
|
4
|
-
# Use the strftime parameters for formats.
|
5
|
-
# When no format has been given, it uses default.
|
6
|
-
# You can provide other formats here if you like!
|
7
|
-
default: "%d-%m-%Y"
|
8
|
-
short: "%d %b"
|
9
|
-
long: "%d %B, %Y"
|
10
|
-
|
11
|
-
day_names: ["Chủ nhật", "Thứ hai", "Thứ ba", "Thứ tư", "Thứ năm", "Thứ sáu", "Thứ bảy"]
|
12
|
-
abbr_day_names: ["Chủ nhật", "Thứ hai", "Thứ ba", "Thứ tư", "Thứ năm", "Thứ sáu", "Thứ bảy"]
|
13
|
-
|
14
|
-
# Don't forget the nil at the beginning; there's no such thing as a 0th month
|
15
|
-
month_names: [~, "Tháng một", "Tháng hai", "Tháng ba", "Tháng tư", "Tháng năm", "Tháng sáu", "Tháng bảy", "Tháng tám", "Tháng chín", "Tháng mười", "Tháng mười một", "Tháng mười hai"]
|
16
|
-
abbr_month_names: [~, "Tháng một", "Tháng hai", "Tháng ba", "Tháng tư", "Tháng năm", "Tháng sáu", "Tháng bảy", "Tháng tám", "Tháng chín", "Tháng mười", "Tháng mười một", "Tháng mười hai"]
|
17
|
-
# Used in date_select and datime_select.
|
18
|
-
order: [ :day, :month, :year ]
|
19
|
-
|
20
|
-
time:
|
21
|
-
formats:
|
22
|
-
default: "%a, %d %b %Y %H:%M:%S %z"
|
23
|
-
short: "%d %b %H:%M"
|
24
|
-
long: "%B %d, %Y %H:%M"
|
25
|
-
am: "am"
|
26
|
-
pm: "pm"
|
27
|
-
|
28
|
-
# Used in array.to_sentence.
|
29
|
-
support:
|
30
|
-
array:
|
31
|
-
words_connector: ", "
|
32
|
-
two_words_connector: " và "
|
33
|
-
last_word_connector: ", và "
|
34
|
-
|
35
|
-
number:
|
36
|
-
# Used in number_with_delimiter()
|
37
|
-
# These are also the defaults for 'currency', 'percentage', 'precision', and 'human'
|
38
|
-
format:
|
39
|
-
# Sets the separator between the units, for more precision (e.g. 1.0 / 2.0 == 0.5)
|
40
|
-
separator: ","
|
41
|
-
# Delimets thousands (e.g. 1,000,000 is a million) (always in groups of three)
|
42
|
-
delimiter: "."
|
43
|
-
# Number of decimals, behind the separator (the number 1 with a precision of 2 gives: 1.00)
|
44
|
-
precision: 3
|
45
|
-
|
46
|
-
# Used in number_to_currency()
|
47
|
-
currency:
|
48
|
-
format:
|
49
|
-
# Where is the currency sign? %u is the currency unit, %n the number (default: $5.00)
|
50
|
-
format: "%n %u"
|
51
|
-
unit: "₫"
|
52
|
-
# These three are to override number.format and are optional
|
53
|
-
separator: ","
|
54
|
-
delimiter: "."
|
55
|
-
precision: 2
|
56
|
-
|
57
|
-
# Used in number_to_percentage()
|
58
|
-
percentage:
|
59
|
-
format:
|
60
|
-
# These three are to override number.format and are optional
|
61
|
-
# separator:
|
62
|
-
delimiter: ""
|
63
|
-
# precision:
|
64
|
-
|
65
|
-
# Used in number_to_precision()
|
66
|
-
precision:
|
67
|
-
format:
|
68
|
-
# These three are to override number.format and are optional
|
69
|
-
# separator:
|
70
|
-
delimiter: ""
|
71
|
-
# precision:
|
72
|
-
|
73
|
-
# Used in number_to_human_size()
|
74
|
-
human:
|
75
|
-
format:
|
76
|
-
# These three are to override number.format and are optional
|
77
|
-
# separator:
|
78
|
-
delimiter: ""
|
79
|
-
precision: 1
|
80
|
-
storage_units:
|
81
|
-
# Storage units output formatting.
|
82
|
-
# %u is the storage unit, %n is the number (default: 2 MB)
|
83
|
-
format: "%n %u"
|
84
|
-
units:
|
85
|
-
byte:
|
86
|
-
one: "Byte"
|
87
|
-
other: "Bytes"
|
88
|
-
kb: "KB"
|
89
|
-
mb: "MB"
|
90
|
-
gb: "GB"
|
91
|
-
tb: "TB"
|
92
|
-
|
93
|
-
# Used in distance_of_time_in_words(), distance_of_time_in_words_to_now(), time_ago_in_words()
|
94
|
-
datetime:
|
95
|
-
distance_in_words:
|
96
|
-
half_a_minute: "30 giây"
|
97
|
-
less_than_x_seconds:
|
98
|
-
one: "chưa tới 1 giây"
|
99
|
-
other: "chưa tới {{count}} giây"
|
100
|
-
x_seconds:
|
101
|
-
one: "1 giây"
|
102
|
-
other: "{{count}} giây"
|
103
|
-
less_than_x_minutes:
|
104
|
-
one: "chưa tới 1 phút"
|
105
|
-
other: "chưa tới {{count}} phút"
|
106
|
-
x_minutes:
|
107
|
-
one: "1 phút"
|
108
|
-
other: "{{count}} phút"
|
109
|
-
about_x_hours:
|
110
|
-
one: "khoảng 1 giờ"
|
111
|
-
other: "khoảng {{count}} giờ"
|
112
|
-
x_days:
|
113
|
-
one: "1 ngày"
|
114
|
-
other: "{{count}} ngày"
|
115
|
-
about_x_months:
|
116
|
-
one: "khoảng 1 tháng"
|
117
|
-
other: "khoảng {{count}} tháng"
|
118
|
-
x_months:
|
119
|
-
one: "1 tháng"
|
120
|
-
other: "{{count}} tháng"
|
121
|
-
about_x_years:
|
122
|
-
one: "khoảng 1 năm"
|
123
|
-
other: "khoảng {{count}} năm"
|
124
|
-
over_x_years:
|
125
|
-
one: "hơn 1 năm"
|
126
|
-
other: "hơn {{count}} năm"
|
127
|
-
prompts:
|
128
|
-
year: "Năm"
|
129
|
-
month: "Tháng"
|
130
|
-
day: "Ngày"
|
131
|
-
hour: "Giờ"
|
132
|
-
minute: "Phút"
|
133
|
-
second: "Giây"
|
134
|
-
|
135
|
-
support:
|
136
|
-
select:
|
137
|
-
# default value for :prompt => true in FormOptionsHelper
|
138
|
-
prompt: "Xin chọn"
|
139
|
-
|
140
|
-
activerecord:
|
141
|
-
errors:
|
142
|
-
template:
|
143
|
-
header:
|
144
|
-
one: "1 lỗi ngăn không cho lưu {{model}} này"
|
145
|
-
other: "{{count}} lỗi ngăn không cho lưu {{model}} này"
|
146
|
-
# The variable :count is also available
|
147
|
-
body: "Có lỗi với các mục sau:"
|
148
|
-
|
149
|
-
# The values :model, :attribute and :value are always available for interpolation
|
150
|
-
# The value :count is available when applicable. Can be used for pluralization.
|
151
|
-
messages:
|
152
|
-
inclusion: "không có trong danh sách"
|
153
|
-
exclusion: "đã được giành trước"
|
154
|
-
invalid: "không hợp lệ"
|
155
|
-
confirmation: "không khớp với xác nhận"
|
156
|
-
accepted: "phải được đồng ý"
|
157
|
-
empty: "không thể rỗng"
|
158
|
-
blank: "không thể để trắng"
|
159
|
-
too_long: "quá dài (tối đa {{count}} ký tự)"
|
160
|
-
too_short: "quá ngắn (tối thiểu {{count}} ký tự)"
|
161
|
-
wrong_length: "độ dài không đúng (phải là {{count}} ký tự)"
|
162
|
-
taken: "đã có"
|
163
|
-
not_a_number: "không phải là số"
|
164
|
-
greater_than: "phải lớn hơn {{count}}"
|
165
|
-
greater_than_or_equal_to: "phải lớn hơn hoặc bằng {{count}}"
|
166
|
-
equal_to: "phải bằng {{count}}"
|
167
|
-
less_than: "phải nhỏ hơn {{count}}"
|
168
|
-
less_than_or_equal_to: "phải nhỏ hơn hoặc bằng {{count}}"
|
169
|
-
odd: "phải là số lẻ"
|
170
|
-
even: "phải là số chẵn"
|
171
|
-
record_invalid: "Lỗi chứng nhận: {{errors}}"
|
172
|
-
# Append your own errors here or at the model/attributes scope.
|
173
|
-
|
174
|
-
full_messages:
|
175
|
-
format: "{{attribute}} {{message}}"
|
176
|
-
|
177
|
-
# You can define own errors for models or model attributes.
|
178
|
-
# The values :model, :attribute and :value are always available for interpolation.
|
179
|
-
#
|
180
|
-
# For example,
|
181
|
-
# models:
|
182
|
-
# user:
|
183
|
-
# blank: "This is a custom blank message for {{model}}: {{attribute}}"
|
184
|
-
# attributes:
|
185
|
-
# login:
|
186
|
-
# blank: "This is a custom blank message for User login"
|
187
|
-
# Will define custom blank validation message for User model and
|
188
|
-
# custom blank validation message for login attribute of User model.
|
189
|
-
#models:
|
190
|
-
|
191
|
-
# Translate model names. Used in Model.human_name().
|
192
|
-
#models:
|
193
|
-
# For example,
|
194
|
-
# user: "Dude"
|
195
|
-
# will translate User model name to "Dude"
|
196
|
-
|
197
|
-
# Translate model attribute names. Used in Model.human_attribute_name(attribute).
|
198
|
-
#attributes:
|
199
|
-
# For example,
|
200
|
-
# user:
|
201
|
-
# login: "Handle"
|
202
|
-
# will translate User attribute "login" as "Handle"
|
data/lib/tasks/translation.rake
DELETED
@@ -1,102 +0,0 @@
|
|
1
|
-
namespace :spree do
|
2
|
-
namespace :i18n do
|
3
|
-
#Define locales root
|
4
|
-
language_root = "#{SPREE_ROOT}/config/locales/"
|
5
|
-
|
6
|
-
desc "Syncronize translation files with latest en-US"
|
7
|
-
task :sync => :environment do
|
8
|
-
words = get_translation_keys(language_root)
|
9
|
-
Dir["#{language_root}*.yml"].each do |filename|
|
10
|
-
next if filename.match('_rails')
|
11
|
-
basename = File.basename(filename, '.yml')
|
12
|
-
(comments, other) = read_file(filename, basename)
|
13
|
-
words.each { |k,v| other[k] ||= words[k] } #Initializing hash variable as empty if it does not exist
|
14
|
-
other.delete_if { |k,v| !words[k] } #Remove if not defined in en-US.yml
|
15
|
-
write_file(filename, basename, comments, other)
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
desc "Create a new translation file based on en-US"
|
20
|
-
task :new => :environment do
|
21
|
-
if !ENV['LOCALE'] || ENV['LOCALE'] == ''
|
22
|
-
print "You must provide a valid LOCALE value, for example:\nrake spree:i18:new LOCALE=pt-PT\n"
|
23
|
-
exit
|
24
|
-
end
|
25
|
-
write_file("#{language_root}/#{ENV['LOCALE']}.yml", "#{ENV['LOCALE']}", '---', get_translation_keys(language_root))
|
26
|
-
print "Also, download the rails translation from: http://github.com/svenfuchs/rails-i18n/tree/master/rails/locale\n"
|
27
|
-
end
|
28
|
-
|
29
|
-
desc "Show translation status for all supported languages, except dialects of English."
|
30
|
-
task :stats => :environment do
|
31
|
-
words = get_translation_keys(language_root)
|
32
|
-
results = ActiveSupport::OrderedHash.new
|
33
|
-
locale = ENV['LOCALE'] || ''
|
34
|
-
Dir["#{language_root}*.yml"].each do |filename|
|
35
|
-
next if filename.match('_rails')
|
36
|
-
basename = File.basename(filename, '.yml')
|
37
|
-
next if basename.starts_with?('en')
|
38
|
-
(comments, other) = read_file(filename, basename)
|
39
|
-
words.each { |k,v| other[k] ||= words[k] } #Initializing hash variable as empty if it does not exist
|
40
|
-
other.delete_if { |k,v| !words[k] } #Remove if not defined in en-US.yml
|
41
|
-
|
42
|
-
untranslated_values = (other.values & words.values).delete_if {|v| !v.match(/\w+/)}
|
43
|
-
translation_status = 100*(1 - untranslated_values.size / words.values.size.to_f)
|
44
|
-
results[basename] = translation_status
|
45
|
-
if locale == basename
|
46
|
-
puts "Following phrases need to be translated into #{locale}:"
|
47
|
-
untranslated_values.each { |v| puts v }
|
48
|
-
puts
|
49
|
-
end
|
50
|
-
end
|
51
|
-
puts "Translation status:"
|
52
|
-
results.sort.each do |basename, translation_status|
|
53
|
-
puts basename + "\t- #{translation_status.round(1)}%"
|
54
|
-
end
|
55
|
-
puts
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
60
|
-
#Retrieve US word set
|
61
|
-
def get_translation_keys(language_root)
|
62
|
-
(dummy_comments, words) = read_file("#{language_root}en-US.yml", 'en-US')
|
63
|
-
words
|
64
|
-
end
|
65
|
-
|
66
|
-
#Retrieve comments, translation data in hash form
|
67
|
-
def read_file(filename, basename)
|
68
|
-
(comments, data) = IO.read(filename).split(/\n#{basename}:\s*\n/) #Add error checking for failed file read?
|
69
|
-
return comments, create_hash(data, basename)
|
70
|
-
end
|
71
|
-
|
72
|
-
#Creates hash of translation data
|
73
|
-
def create_hash(data, basename)
|
74
|
-
words = Hash.new
|
75
|
-
return words if !data
|
76
|
-
parent = Array.new
|
77
|
-
previous_key = 'base'
|
78
|
-
data.split("\n").each do |w|
|
79
|
-
next if w.strip.blank?
|
80
|
-
(key, value) = w.split(':', 2)
|
81
|
-
value ||= ''
|
82
|
-
shift = (key =~ /\w/)/2 - parent.size #Determine level of current key in comparison to parent array
|
83
|
-
key = key.sub(/^\s+/,'')
|
84
|
-
parent << previous_key if shift > 0 #If key is child of previous key, add previous key as parent
|
85
|
-
(shift*-1).times { parent.pop } if shift < 0 #If key is not related to previous key, remove parent keys
|
86
|
-
previous_key = key #Track key in case next key is child of this key
|
87
|
-
words[parent.join(':')+':'+key] = value
|
88
|
-
end
|
89
|
-
words
|
90
|
-
end
|
91
|
-
|
92
|
-
#Writes to file from translation data hash structure
|
93
|
-
def write_file(filename,basename,comments,words)
|
94
|
-
File.open(filename, "w") do |log|
|
95
|
-
log.puts(comments+"\n"+basename+": \n")
|
96
|
-
words.sort.each do |k,v|
|
97
|
-
keys = k.split(':')
|
98
|
-
(keys.size-1).times { keys[keys.size-1] = ' ' + keys[keys.size-1] } #Add indentation for children keys
|
99
|
-
log.puts(keys[keys.size-1]+':'+v+"\n")
|
100
|
-
end
|
101
|
-
end
|
102
|
-
end
|
@@ -1,5 +0,0 @@
|
|
1
|
-
= Localization
|
2
|
-
|
3
|
-
We have temporarily disabled the request header check for the locale since it was doubling the request time when examined with a request profiler. Users can still select their own language via a link (like the flag links on the demo site or through a user account preference.)
|
4
|
-
|
5
|
-
Of course the default language for the entire site can also be specified to whatever locale you choose.
|
@@ -1,120 +0,0 @@
|
|
1
|
-
# I think this is the one that should be moved to the extension Rakefile template
|
2
|
-
|
3
|
-
# In rails 1.2, plugins aren't available in the path until they're loaded.
|
4
|
-
# Check to see if the rspec plugin is installed first and require
|
5
|
-
# it if it is. If not, use the gem version.
|
6
|
-
|
7
|
-
# Determine where the RSpec plugin is by loading the boot
|
8
|
-
unless defined? SPREE_ROOT
|
9
|
-
ENV["RAILS_ENV"] = "test"
|
10
|
-
case
|
11
|
-
when ENV["SPREE_ENV_FILE"]
|
12
|
-
require File.dirname(ENV["SPREE_ENV_FILE"]) + "/boot"
|
13
|
-
when File.dirname(__FILE__) =~ %r{vendor/SPREE/vendor/extensions}
|
14
|
-
require "#{File.expand_path(File.dirname(__FILE__) + "/../../../../../")}/config/boot"
|
15
|
-
else
|
16
|
-
require "#{File.expand_path(File.dirname(__FILE__) + "/../../../")}/config/boot"
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
require 'rake'
|
21
|
-
require 'rake/rdoctask'
|
22
|
-
require 'rake/testtask'
|
23
|
-
|
24
|
-
rspec_base = File.expand_path(SPREE_ROOT + '/vendor/plugins/rspec/lib')
|
25
|
-
$LOAD_PATH.unshift(rspec_base) if File.exist?(rspec_base)
|
26
|
-
require 'spec/rake/spectask'
|
27
|
-
# require 'spec/translator'
|
28
|
-
|
29
|
-
# Cleanup the SPREE_ROOT constant so specs will load the environment
|
30
|
-
Object.send(:remove_const, :SPREE_ROOT)
|
31
|
-
|
32
|
-
extension_root = File.expand_path(File.dirname(__FILE__))
|
33
|
-
|
34
|
-
task :default => :spec
|
35
|
-
task :stats => "spec:statsetup"
|
36
|
-
|
37
|
-
desc "Run all specs in spec directory"
|
38
|
-
Spec::Rake::SpecTask.new(:spec) do |t|
|
39
|
-
t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
|
40
|
-
t.spec_files = FileList['spec/**/*_spec.rb']
|
41
|
-
end
|
42
|
-
|
43
|
-
namespace :spec do
|
44
|
-
desc "Run all specs in spec directory with RCov"
|
45
|
-
Spec::Rake::SpecTask.new(:rcov) do |t|
|
46
|
-
t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
|
47
|
-
t.spec_files = FileList['spec/**/*_spec.rb']
|
48
|
-
t.rcov = true
|
49
|
-
t.rcov_opts = ['--exclude', 'spec', '--rails']
|
50
|
-
end
|
51
|
-
|
52
|
-
desc "Print Specdoc for all specs"
|
53
|
-
Spec::Rake::SpecTask.new(:doc) do |t|
|
54
|
-
t.spec_opts = ["--format", "specdoc", "--dry-run"]
|
55
|
-
t.spec_files = FileList['spec/**/*_spec.rb']
|
56
|
-
end
|
57
|
-
|
58
|
-
[:models, :controllers, :views, :helpers].each do |sub|
|
59
|
-
desc "Run the specs under spec/#{sub}"
|
60
|
-
Spec::Rake::SpecTask.new(sub) do |t|
|
61
|
-
t.spec_opts = ['--options', "\"#{extension_root}/spec/spec.opts\""]
|
62
|
-
t.spec_files = FileList["spec/#{sub}/**/*_spec.rb"]
|
63
|
-
end
|
64
|
-
end
|
65
|
-
|
66
|
-
# Hopefully no one has written their extensions in pre-0.9 style
|
67
|
-
# desc "Translate specs from pre-0.9 to 0.9 style"
|
68
|
-
# task :translate do
|
69
|
-
# translator = ::Spec::Translator.new
|
70
|
-
# dir = RAILS_ROOT + '/spec'
|
71
|
-
# translator.translate(dir, dir)
|
72
|
-
# end
|
73
|
-
|
74
|
-
# Setup specs for stats
|
75
|
-
task :statsetup do
|
76
|
-
require 'code_statistics'
|
77
|
-
::STATS_DIRECTORIES << %w(Model\ specs spec/models)
|
78
|
-
::STATS_DIRECTORIES << %w(View\ specs spec/views)
|
79
|
-
::STATS_DIRECTORIES << %w(Controller\ specs spec/controllers)
|
80
|
-
::STATS_DIRECTORIES << %w(Helper\ specs spec/views)
|
81
|
-
::CodeStatistics::TEST_TYPES << "Model specs"
|
82
|
-
::CodeStatistics::TEST_TYPES << "View specs"
|
83
|
-
::CodeStatistics::TEST_TYPES << "Controller specs"
|
84
|
-
::CodeStatistics::TEST_TYPES << "Helper specs"
|
85
|
-
::STATS_DIRECTORIES.delete_if {|a| a[0] =~ /test/}
|
86
|
-
end
|
87
|
-
|
88
|
-
namespace :db do
|
89
|
-
namespace :fixtures do
|
90
|
-
desc "Load fixtures (from spec/fixtures) into the current environment's database. Load specific fixtures using FIXTURES=x,y"
|
91
|
-
task :load => :environment do
|
92
|
-
require 'active_record/fixtures'
|
93
|
-
ActiveRecord::Base.establish_connection(RAILS_ENV.to_sym)
|
94
|
-
(ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(RAILS_ROOT, 'spec', 'fixtures', '*.{yml,csv}'))).each do |fixture_file|
|
95
|
-
Fixtures.create_fixtures('spec/fixtures', File.basename(fixture_file, '.*'))
|
96
|
-
end
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
desc 'Generate documentation for the localization extension.'
|
103
|
-
Rake::RDocTask.new(:rdoc) do |rdoc|
|
104
|
-
rdoc.rdoc_dir = 'rdoc'
|
105
|
-
rdoc.title = 'LocalizationExtension'
|
106
|
-
rdoc.options << '--line-numbers' << '--inline-source'
|
107
|
-
rdoc.rdoc_files.include('README')
|
108
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
109
|
-
end
|
110
|
-
|
111
|
-
# For extensions that are in transition
|
112
|
-
desc 'Test the localization extension.'
|
113
|
-
Rake::TestTask.new(:test) do |t|
|
114
|
-
t.libs << 'lib'
|
115
|
-
t.pattern = 'test/**/*_test.rb'
|
116
|
-
t.verbose = true
|
117
|
-
end
|
118
|
-
|
119
|
-
# Load any custom rakefiles for extension
|
120
|
-
Dir[File.dirname(__FILE__) + '/tasks/*.rake'].sort.each { |f| require f }
|
@@ -1,8 +0,0 @@
|
|
1
|
-
<ul id="language-bar">
|
2
|
-
<li><strong><%= t('change_language') %></strong></li>
|
3
|
-
<% AVAILABLE_LOCALES.each do |locale| -%>
|
4
|
-
<li>
|
5
|
-
<%=link_to(image_tag("flags/#{flag_image(locale[0])}",{:alt => locale[1], :title => locale[1]}), set_locale_path(:locale => locale[0])) %>
|
6
|
-
</li>
|
7
|
-
<% end -%>
|
8
|
-
</ul>
|