diff --git a/app/assets/javascripts/templates/admin/links_dropdown.html.haml b/app/assets/javascripts/templates/admin/links_dropdown.html.haml index 6d0ba060e2..13db5f7fb2 100644 --- a/app/assets/javascripts/templates/admin/links_dropdown.html.haml +++ b/app/assets/javascripts/templates/admin/links_dropdown.html.haml @@ -1,7 +1,7 @@ .ofn-drop-down %span %i.icon-check - Actions + = t('admin.actions') %i{ 'ng-class' => "expanded && 'icon-caret-up' || !expanded && 'icon-caret-down'" } %div.menu{ 'ng-show' => "expanded" } %a.menu_item{ 'ng-repeat' => "link in links", href: '{{link.url}}', target: "{{link.target || '_self'}}", data: { method: "{{ link.method || 'get' }}", confirm: "{{link.confirm}}" } } diff --git a/app/assets/javascripts/templates/admin/modals/tag_rule_help.html.haml b/app/assets/javascripts/templates/admin/modals/tag_rule_help.html.haml index 6a0d720a5f..e4f2eda259 100644 --- a/app/assets/javascripts/templates/admin/modals/tag_rule_help.html.haml +++ b/app/assets/javascripts/templates/admin/modals/tag_rule_help.html.haml @@ -1,18 +1,19 @@ #tag-rule-help .margin-bottom-30.text-center - .text-big Tag Rules + .text-big + = t('js.admin.modals.tag_rule_help.title') .margin-bottom-30 - .text-normal Overview - %p Tag rules provide a way to describe which items are visible or otherwise to which customers. Items can be Shipping Methods, Payment Methods, Products and Order Cycles. + .text-normal= t('js.admin.modals.tag_rule_help.overview') + %p= t('js.admin.modals.tag_rule_help.overview_text') .margin-bottom-30 - .text-normal 'By Default...' Rules - %p Default rules allow you to hide items so that they are not visible by default. This behaviour can then be overriden by non-default rules for customers with particular tags. + .text-normal= t('js.admin.modals.tag_rule_help.by_default_rules') + %p= t('js.admin.modals.tag_rule_help.by_default_rules_text') .margin-bottom-30 - .text-normal 'Customers Tagged...' Rules - %p By creating rules related to a specific customer tag, you can override the default behaviour (whether it be to show or to hide items) for customers with the specified tag. + .text-normal= t('js.admin.modals.tag_rule_help.customer_tagged_rules') + %p= t('js.admin.modals.tag_rule_help.customer_tagged_rules_text') .text-center - %input.button.red.icon-plus{ type: 'button', value: 'Got it', ng: { click: 'close()' } } + %input.button.red.icon-plus{ type: 'button', value: t('js.admin.modals.got_it'), ng: { click: 'close()' } } diff --git a/app/assets/javascripts/templates/admin/new_tag_rule_dialog.html.haml b/app/assets/javascripts/templates/admin/new_tag_rule_dialog.html.haml index 653e0d175d..fc746b1335 100644 --- a/app/assets/javascripts/templates/admin/new_tag_rule_dialog.html.haml +++ b/app/assets/javascripts/templates/admin/new_tag_rule_dialog.html.haml @@ -1,6 +1,6 @@ #new-tag-rule-dialog .text-normal.margin-bottom-30.text-center - Select a rule type: + = t('js.admin.new_tag_rule_dialog.select_rule_type') .text-center.margin-bottom-30 -# %select.fullwidth{ 'select2-min-search' => 5, 'ng-model' => 'newRuleType', 'ng-options' => 'ruleType.id as ruleType.name for ruleType in availableRuleTypes' } diff --git a/app/assets/javascripts/templates/admin/panels/enterprise_package.html.haml b/app/assets/javascripts/templates/admin/panels/enterprise_package.html.haml index 7f143d1071..27e1db7365 100644 --- a/app/assets/javascripts/templates/admin/panels/enterprise_package.html.haml +++ b/app/assets/javascripts/templates/admin/panels/enterprise_package.html.haml @@ -2,130 +2,128 @@ .alpha.eight.columns %div{ ng: { if: "!enterprise.is_primary_producer", switch: "enterprise.sells" } } .info{ ng: { switch: { when: "none" } } } - %h3 Hub Profile + %h3= t('js.admin.panels.enterprise_package.hub_profile') %p - %strong COST: ALWAYS FREE + %strong= t('js.admin.panels.enterprise_package.hub_profile_cost') - %p People can find and contact you on the Open Food Network. Your enterprise will be visible on the map, and will be searchable in listings. + %p= t('js.admin.panels.enterprise_package.hub_profile_text1') - %p Having a profile, and making connections within your local food system through the Open Food Network will always be free. + %p= t('js.admin.panels.enterprise_package.hub_profile_text2') .info{ ng: { switch: { when: "any" } } } - %h3 Hub Shop + %h3= t('js.admin.panels.enterprise_package.hub_shop') %p %strong %monthly-pricing-description{ joiner: "comma" } - %p Your enterprise is the backbone of your local food system. You aggregate produce from other enterprises and can sell it through your shop on the Open Food Network. + %p= t('js.admin.panels.enterprise_package.hub_shop_text1') - %p Hubs can take many forms, whether they be a food co-op, a buying group, a veggie-box program, or a local grocery store. + %p= t('js.admin.panels.enterprise_package.hub_shop_text2') - %p If you also want to sell your own products, you will need to switch this enterprise to be a producer. + %p= t('js.admin.panels.enterprise_package.hub_shop_text3') .info{ ng: { switch: { default: true } } } %h3 - Please Choose a Package + = t('js.admin.panels.enterprise_package.choose_package') %i.icon-arrow-right %p - %strong Your enterprise will not be fully activated until a package is selected from the options on the left. + %strong= t('js.admin.panels.enterprise_package.choose_package_text1') %p - Click on an option to see more detailed information about each package, and hit the red SAVE button when you are done! - - + = t('js.admin.panels.enterprise_package.choose_package_text2') %div{ ng: { if: "enterprise.is_primary_producer", switch: "enterprise.sells" } } .info{ ng: { switch: { when: "none" } } } - %h3 Profile Only + %h3= t('js.admin.panels.enterprise_package.profile_only') %p - %strong COST: ALWAYS FREE + %strong= t('js.admin.panels.enterprise_package.profile_only_cost') - %p A profile makes you visible and contactable to others and is a way to share your story. + %p= t('js.admin.panels.enterprise_package.profile_only_text1') - %p If you prefer to focus on producing food, and want to leave the work of selling it to someone else, you won't require a shop on the Open Food Network. + %p= t('js.admin.panels.enterprise_package.profile_only_text2') - %p Add your products to Open Food Network, allowing hubs to stock your products in their stores. + %p= t('js.admin.panels.enterprise_package.profile_only_text3') .info{ ng: { switch: { when: "own" } } } - %h3 Producer Shop + %h3= t('js.admin.panels.enterprise_package.producer_shop') %p %strong %monthly-pricing-description{ joiner: "comma" } - %p Sell your products directly to customers through your very own Open Food Network shopfront. + %p= t('js.admin.panels.enterprise_package.producer_shop_text1') - %p A Producer Shop is for your produce only, if you want to sell produce grown/produced off site, please select 'Producer Hub'. + %p= t('js.admin.panels.enterprise_package.producer_shop_text2') .info{ ng: { switch: { when: "any" } } } - %h3 Producer Hub + %h3= t('js.admin.panels.enterprise_package.producer_hub') %p %strong %monthly-pricing-description{ joiner: "comma" } - %p Your enterprise is the backbone of your local food system. You can sell your own produce as well as produce aggregated from other enterprises through your shopfront on the Open Food Network. + %p= t('js.admin.panels.enterprise_package.producer_hub_text1') - %p Producer Hubs can take many forms, whether they be a CSA, a veggie-box program, or a food co-op with a rooftop garden. + %p= t('js.admin.panels.enterprise_package.producer_hub_text2') - %p The Open Food Network aims to support as many hub models as possible, so no matter your situation, we want to provide the tools you need to run your organisation or local food business. + %p= t('js.admin.panels.enterprise_package.producer_hub_text3') .info{ ng: { switch: { default: true } } } %h3 - Please Choose a Package + = t('js.admin.panels.enterprise_package.choose_package') %i.icon-arrow-right %p - %strong Your producer enterprise will not be fully activated until a package is selected from the options on the left. + %strong= t('js.admin.panels.enterprise_package.choose_package_text1') %p - Click on an option to see more detailed information about each package, and hit the red SAVE button when you are done! + = t('js.admin.panels.enterprise_package.choose_package_text2') .omega.eight.columns{ ng: { switch: "enterprise.is_primary_producer" } } %div{ ng: { switch: { when: "false" } } } %a.button.selector.hub-profile{ ng: { click: "enterprise.owned && (enterprise.sells='none')", class: "{selected: enterprise.sells=='none', disabled: !enterprise.owned}" } } .top - %h3 Profile Only - %p Get a listing - .bottom ALWAYS FREE + %h3= t('js.admin.panels.enterprise_package.profile_only') + %p= t('js.admin.panels.enterprise_package.get_listing') + .bottom= t('js.admin.panels.enterprise_package.always_free') %a.button.selector.hub{ ng: { click: "enterprise.owned && (enterprise.sells='any')", class: "{selected: enterprise.sells=='any', disabled: !enterprise.owned}" } } .top - %h3 Hub Shop - %p Sell produce from others + %h3= t('js.admin.panels.enterprise_package.hub_shop') + %p= t('js.admin.panels.enterprise_package.sell_produce_others') .bottom %monthly-pricing-description{ joiner: "newline" } %div{ ng: { switch: { when: "true" } } } %a.button.selector.producer-profile{ ng: { click: "enterprise.owned && (enterprise.sells='none')", class: "{selected: enterprise.sells=='none', disabled: !enterprise.owned}" } } .top - %h3 Profile Only - %p Get a listing - .bottom ALWAYS FREE + %h3= t('js.admin.panels.enterprise_package.profile_only') + %p= t('js.admin.panels.enterprise_package.get_listing') + .bottom= t('js.admin.panels.enterprise_package.always_free') %a.button.selector.producer-shop{ ng: { click: "enterprise.owned && (enterprise.sells='own')", class: "{selected: enterprise.sells=='own', disabled: !enterprise.owned}" } } .top - %h3 Producer Shop - %p Sell your own produce + %h3= t('js.admin.panels.enterprise_package.producer_shop') + %p= t('js.admin.panels.enterprise_package.sell_own_produce') .bottom %monthly-pricing-description{ joiner: "newline" } %a.button.selector.producer-hub{ ng: { click: "enterprise.owned && (enterprise.sells='any')", class: "{selected: enterprise.sells=='any', disabled: !enterprise.owned}" } } .top - %h3 Producer Hub - %p Sell produce from self and others + %h3= t('js.admin.panels.enterprise_package.producer_hub') + %p= t('js.admin.panels.enterprise_package.sell_both') .bottom %monthly-pricing-description{ joiner: "newline" } %a.button.update.fullwidth{ ng: { show: "enterprise.owned", class: "{disabled: saved() && !saving, saving: saving}", click: "save()" } } %span{ ng: {hide: "saved() || saving" } } - SAVE + = t('js.admin.panels.save') %i.icon-save %span{ ng: {show: "saved() && !saving" } } - SAVED + = t('js.admin.panels.saved') %i.icon-ok-sign %span{ ng: {show: "saving" } } - SAVING + = t('js.admin.panels.saving') %i.icon-refresh diff --git a/app/assets/javascripts/templates/admin/panels/enterprise_producer.html.haml b/app/assets/javascripts/templates/admin/panels/enterprise_producer.html.haml index ea8554892f..b30b15aa63 100644 --- a/app/assets/javascripts/templates/admin/panels/enterprise_producer.html.haml +++ b/app/assets/javascripts/templates/admin/panels/enterprise_producer.html.haml @@ -1,39 +1,37 @@ .row.enterprise_producer_panel{ ng: { controller: 'indexProducerPanelCtrl' } } - .alpha.eight.columns .info{ ng: { show: "enterprise.is_primary_producer==true" } } - %h3 Producer - %p Producers make yummy things to eat &/or drink. You're a producer if you grow it, raise it, brew it, bake it, ferment it, milk it or mould it. - - %p Producers can also perform other functions, such as aggregating food from other enterprises and selling it through a shop on the Open Food Network. + %h3= t('js.admin.panels.enterprise_producer.producer') + %p= t('js.admin.panels.enterprise_producer.producer_text1') + %p= t('js.admin.panels.enterprise_producer.producer_text2') .info{ ng: { show: "enterprise.is_primary_producer==false" } } - %h3 Non-Producer - %p Non-producers do not produce any food themselves, meaning that they cannot create their own products for sale through the Open Food Network. + %h3= t('js.admin.panels.enterprise_producer.non_producer') + %p= t('js.admin.panels.enterprise_producer.non_producer_text1') - %p Instead, non-producers specialise in linking producers to the end eater, whether it be by aggregating, grading, packing, selling or delivering food. + %p= t('js.admin.panels.enterprise_producer.non_producer_text2') .omega.eight.columns %a.button.selector.producer{ ng: { click: 'enterprise.owned && changeToProducer()', class: "{selected: enterprise.is_primary_producer==true, disabled: !enterprise.owned}" } } .top - %h3 PRODUCER - %p Producers of food - .bottom eg. GROWERS, BAKERS, BREWERS, MAKERS + %h3= t('js.admin.panels.enterprise_producer.producer') + %p= t('js.admin.panels.enterprise_producer.producer_desc') + .bottom= t('js.admin.panels.enterprise_producer.producer_example') %a.button.selector.non-producer{ ng: { click: 'enterprise.owned && changeToNonProducer()', class: "{selected: enterprise.is_primary_producer==false, disabled: !enterprise.owned}" } } .top - %h3 Non-Producer - %p All other food enterprises - .bottom eg. Grocery stores, Food co-ops, Buying groups + %h3= t('js.admin.panels.enterprise_producer.non_producer') + %p= t('js.admin.panels.enterprise_producer.non_producer_desc') + .bottom= t('js.admin.panels.enterprise_producer.non_producer_example') %a.button.update.fullwidth{ ng: { show: "enterprise.owned", class: "{disabled: saved() && !saving, saving: saving}", click: "save()" } } %span{ ng: {hide: "saved() || saving" } } - SAVE + = t('js.admin.panels.save') %i.icon-save %span{ ng: {show: "saved() && !saving" } } - SAVED + = t('js.admin.panels.saved') %i.icon-ok-sign %span{ ng: {show: "saving" } } - SAVING + = t('js.admin.panels.saving') %i.icon-refresh diff --git a/app/assets/javascripts/templates/admin/panels/enterprise_status.html.haml b/app/assets/javascripts/templates/admin/panels/enterprise_status.html.haml index 518122774d..305210b3ee 100644 --- a/app/assets/javascripts/templates/admin/panels/enterprise_status.html.haml +++ b/app/assets/javascripts/templates/admin/panels/enterprise_status.html.haml @@ -1,18 +1,17 @@ .row.enterprise_status_panel{ ng: { controller: 'indexStatusPanelCtrl' } } .alpha.omega.sixteen.columns - %h4.status-ok.text-center{ ng: { show: "issues.length == 0 && warnings.length == 0" } } %i.icon-ok-sign - {{ object.name }} is set up and ready to go! + = t('js.admin.panels.enterprise_status.status_title', name: '{{ object.name }}') %table{ ng: { show: "issues.length > 0 || warnings.length > 0" } } %thead %th.severity - Severity + = t('js.admin.panels.enterprise_status.severity') %th.description - Description + = t('js.admin.panels.enterprise_status.description') %th.resolve - Resolve + = t('js.admin.panels.enterprise_status.resolve') %tr{ ng: { repeat: "issue in issues"} } %td.severity %i.icon-warning-sign.issue diff --git a/app/assets/javascripts/templates/admin/show_more.html.haml b/app/assets/javascripts/templates/admin/show_more.html.haml index f9a008993c..0800710927 100644 --- a/app/assets/javascripts/templates/admin/show_more.html.haml +++ b/app/assets/javascripts/templates/admin/show_more.html.haml @@ -1,4 +1,4 @@ %div{ ng: { show: "data.length > limit" } } - %input{ type: 'button', value: 'Show More', ng: { click: 'limit = limit + increment' } } + %input{ type: 'button', value: t(:show_more), ng: { click: 'limit = limit + increment' } } or - %input{ type: 'button', value: "Show All ({{ data.length - limit }} More)", ng: { click: 'limit = data.length' } } + %input{ type: 'button', value: t(:show_more_with_more, num: '{{ data.length - limit }}'), ng: { click: 'limit = data.length' } } diff --git a/app/assets/javascripts/templates/admin/tag_autocomplete.html.haml b/app/assets/javascripts/templates/admin/tag_autocomplete.html.haml index 49ff00ff27..9a6d4e9c26 100644 --- a/app/assets/javascripts/templates/admin/tag_autocomplete.html.haml +++ b/app/assets/javascripts/templates/admin/tag_autocomplete.html.haml @@ -3,9 +3,9 @@ {{$getDisplayText()}} %span.tag-with-rules{ ng: { if: "data.rules == 1" } } — - = t 'admin.has_one_rule' + = t('admin.has_one_rule') %span.tag-with-rules{ ng: { if: "data.rules > 1" } } — - = t 'admin.has_n_rules', { num: '{{data.rules}}' } + = t('admin.has_n_rules', { num: '{{data.rules}}' }) %span{ ng: { if: "!data.rules" } } {{$getDisplayText()}} diff --git a/app/assets/javascripts/templates/out_of_stock.html.haml b/app/assets/javascripts/templates/out_of_stock.html.haml index d894583fcf..5a9662fb6b 100644 --- a/app/assets/javascripts/templates/out_of_stock.html.haml +++ b/app/assets/javascripts/templates/out_of_stock.html.haml @@ -1,13 +1,13 @@ %a.close-reveal-modal{"ng-click" => "$close()"} %i.ofn-i_009-close -%h3 Reduced stock available +%h3= t('js.out_of_stock.reduced_stock_available') -%p While you've been shopping, the stock levels for one or more of the products in your cart have reduced. Here's what's changed: +%p= t('js.out_of_stock.out_of_stock_text') %p{'ng-repeat' => "v in variants"} %em {{ v.name_to_display }} - {{ v.unit_to_display }} %span{'ng-if' => "v.count_on_hand == 0"} - is now out of stock. + = t('js.out_of_stock.now_out_of_stock') %span{'ng-if' => "v.count_on_hand > 0"} - now only has {{ v.count_on_hand }} remaining. + = t('js.out_of_stock.only_n_remainging', num: '{{ v.count_on_hand }}') diff --git a/app/views/admin/enterprises/_enterprise_user_index.html.haml b/app/views/admin/enterprises/_enterprise_user_index.html.haml index 4b777e127b..b4bc32d2ad 100644 --- a/app/views/admin/enterprises/_enterprise_user_index.html.haml +++ b/app/views/admin/enterprises/_enterprise_user_index.html.haml @@ -10,10 +10,9 @@ .row{ 'ng-if' => '!loaded' } .sixteen.columns.alpha#loading %img.spinner{ src: "/assets/spinning-circles.svg" } - %h1 LOADING ENTERPRISES + %h1= t('.loading_enterprises') .row{ :class => "sixteen columns alpha", 'ng-show' => 'loaded && filteredEnterprises.length == 0'} - %h1#no_results No enterprises found. - + %h1#no_results= t('.no_enterprises_found') .row{ ng: { show: "loaded && filteredEnterprises.length > 0" } } %table.index#enterprises diff --git a/app/views/checkout/_shipping_ship_address.html.haml b/app/views/checkout/_shipping_ship_address.html.haml index fa87eef2ff..7b4db0d54c 100644 --- a/app/views/checkout/_shipping_ship_address.html.haml +++ b/app/views/checkout/_shipping_ship_address.html.haml @@ -3,26 +3,26 @@ %div.visible{"ng-if" => "!Checkout.ship_address_same_as_billing"} .row .small-6.columns - = validated_input "First Name", "order.ship_address.firstname", "ofn-focus" => "accordion['shipping']" + = validated_input t(:first_name), "order.ship_address.firstname", "ofn-focus" => "accordion['shipping']" .small-6.columns - = validated_input "Last Name", "order.ship_address.lastname" + = validated_input t(:last_name), "order.ship_address.lastname" .row .small-12.columns - = validated_input "Address", "order.ship_address.address1" + = validated_input t(:address), "order.ship_address.address1" .row .small-12.columns - = validated_input "Address (contd.)", "order.ship_address.address2", required: false + = validated_input t(:address2), "order.ship_address.address2", required: false .row .small-6.columns - = validated_input "City", "order.ship_address.city" + = validated_input t(:city), "order.ship_address.city" .small-6.columns - = validated_select "State", "order.ship_address.state_id", checkout_state_options(:shipping) + = validated_select t(:state), "order.ship_address.state_id", checkout_state_options(:shipping) .row .small-6.columns - = validated_input "Postcode", "order.ship_address.zipcode" + = validated_input t(:postcode), "order.ship_address.zipcode" .small-6.columns.right - = validated_select "Country", "order.ship_address.country_id", checkout_country_options + = validated_select t(:country), "order.ship_address.country_id", checkout_country_options .row .small-6.columns - = validated_input "Phone", "order.ship_address.phone" + = validated_input t(:phone), "order.ship_address.phone" diff --git a/app/views/spree/admin/orders/invoice.html.haml b/app/views/spree/admin/orders/invoice.html.haml index 0913ee27db..37969b96b1 100644 --- a/app/views/spree/admin/orders/invoice.html.haml +++ b/app/views/spree/admin/orders/invoice.html.haml @@ -1,6 +1,5 @@ = wicked_pdf_stylesheet_link_tag "mail/all" - %table{:width => "100%"} %tbody %tr{ valign: "top" } @@ -9,7 +8,7 @@ %tr{ valign: "top" } %td{ :align => "left" } %h4 - = "TAX INVOICE: " + = t('.tax_invoice') = "#{@order.number}" %td{width: "10%" } diff --git a/app/views/spree/admin/products/bulk_edit/_header.html.haml b/app/views/spree/admin/products/bulk_edit/_header.html.haml index 09586b3e7c..8284ada662 100644 --- a/app/views/spree/admin/products/bulk_edit/_header.html.haml +++ b/app/views/spree/admin/products/bulk_edit/_header.html.haml @@ -1,5 +1,5 @@ - content_for :page_title do - = "Bulk Edit Products" + = t('.title') - content_for :page_actions do %div{ :class => "toolbar", 'data-hook' => "toolbar" } diff --git a/app/views/spree/admin/products/bulk_edit/_indicators.html.haml b/app/views/spree/admin/products/bulk_edit/_indicators.html.haml index 4760dacaeb..bfdd104690 100644 --- a/app/views/spree/admin/products/bulk_edit/_indicators.html.haml +++ b/app/views/spree/admin/products/bulk_edit/_indicators.html.haml @@ -3,14 +3,14 @@ %div.sixteen.columns.alpha#loading{ 'ng-if' => 'loading' } %img.spinner{ src: "/assets/spinning-circles.svg" } - %h1 LOADING PRODUCTS + %h1= t('.title') %div.sixteen.columns.alpha{ 'ng-show' => '!loading && filteredProducts.length == 0 && query.length==0' } - %h1#no_results No products yet. Why don't you add some? + %h1#no_results= t('.no_products') %div.sixteen.columns.alpha{ 'ng-show' => '!loading && filteredProducts.length == 0 && query.length!=0' } - %h1#no_results - Sorry, no results match + %h1#no_results + = t('.no_results') ' {{query}} ' \ No newline at end of file diff --git a/app/views/spree/admin/variants/_autocomplete.js.erb b/app/views/spree/admin/variants/_autocomplete.js.erb index 41b0e84550..ccd93d63f7 100644 --- a/app/views/spree/admin/variants/_autocomplete.js.erb +++ b/app/views/spree/admin/variants/_autocomplete.js.erb @@ -9,11 +9,10 @@