new translate filter and updated specs for js translations

This commit is contained in:
Maikel Linke
2015-10-07 15:47:51 +11:00
parent 91fae79be4
commit 8b40d094ee
5 changed files with 21 additions and 13 deletions

View File

@@ -0,0 +1,7 @@
Darkswarm.filter "translate", ->
(key) ->
t(key)
Darkswarm.filter "t", ->
(key) ->
t(key)

View File

@@ -47,7 +47,7 @@ Darkswarm.factory "EnterpriseRegistrationService", ($http, RegistrationService,
RegistrationService.select(step)
).error((data) ->
Loading.clear()
alert(t('failed_to_create_enterprise_unknown'))
alert(t('failed_to_update_enterprise_unknown'))
)
prepare: =>

View File

@@ -4,35 +4,35 @@
.collapsed{"ng-show" => "!expanded"}
%price-percentage{percentage: 'variant.basePricePercentage'}
%a{"ng-click" => "expanded = !expanded"}
{{t('price_breakdown')}}
%span{"bo-text" => "'price_breakdown' | t"}
%i.ofn-i_005-caret-down
.expanded{"ng-show" => "expanded"}
%ul
%li.cost
.right {{ variant.price | localizeCurrency }}
{{t('item_cost')}}
%span{"bo-text" => "'item_cost' | t"}
%li.admin-fee{"bo-if" => "variant.fees.admin"}
.right {{ variant.fees.admin | localizeCurrency }}
{{t('admin_fee')}}
%span{"bo-text" => "'admin_fee' | t"}
%li.sales-fee{"bo-if" => "variant.fees.sales"}
.right {{ variant.fees.sales | localizeCurrency }}
{{t('sales_fee')}}
%span{"bo-text" => "'sales_fee' | t"}
%li.packing-fee{"bo-if" => "variant.fees.packing"}
.right {{ variant.fees.packing | localizeCurrency }}
{{t('packing_fee')}}
%span{"bo-text" => "'packing_fee' | t"}
%li.transport-fee{"bo-if" => "variant.fees.transport"}
.right {{ variant.fees.transport | localizeCurrency }}
{{t('transport_fee')}}
%span{"bo-text" => "'transport_fee' | t"}
%li.fundraising-fee{"bo-if" => "variant.fees.fundraising"}
.right {{ variant.fees.fundraising | localizeCurrency }}
{{t('fundraising_fee')}}
%span{"bo-text" => "'fundraising_fee' | t"}
%li.total
%strong
.right = {{ variant.price_with_fees | localizeCurrency }}
 
%a{"ng-click" => "expanded = !expanded"}
{{t('price_graph')}}
%span{"bo-text" => "'price_graph' | t"}
%i.ofn-i_006-caret-up

View File

@@ -465,6 +465,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using
updating: Updating
failed_to_create_enterprise: "Failed to create your enterprise."
failed_to_create_enterprise_unknown: "Failed to create your enterprise.\nPlease ensure all fields are completely filled out."
failed_to_update_enterprise_unknown: "Failed to update your enterprise.\nPlease ensure all fields are completely filled out."
order_not_saved_yet: "Your order hasn't been saved yet. Give us a few seconds to finish!"
filter_by: "Filter by"
hide_filters: "Hide filters"

View File

@@ -11,7 +11,7 @@ feature "Registration", js: true do
expect(URI.parse(current_url).path).to eq registration_auth_path
page.has_selector? "dd", text: "Log in"
page.has_selector? "dd", text: "Login"
switch_to_login_tab
# Enter Login details
@@ -102,8 +102,8 @@ feature "Registration", js: true do
# Link appears to be unresponsive for a while, so keep clicking it until it works
using_wait_time 0.5 do
10.times do
click_link "Log in"
break if page.has_selector? "dd.active", text: "Log in"
click_link "Login"
break if page.has_selector? "dd.active", text: "Login"
end
end
end
@@ -112,7 +112,7 @@ feature "Registration", js: true do
# Buttons appear to be unresponsive for a while, so keep clicking them until content appears
using_wait_time 1 do
3.times do
click_button "Log in"
click_button "Login"
break if page.has_selector? "div#loading", text: "Hold on a moment, we're logging you in"
end
end