Skip to content

Commit

Permalink
Update set_top_level_cookie UI and use I18n helper for strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Francine Navarro committed Aug 15, 2018
1 parent 24290cd commit b77ae63
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 15 deletions.
20 changes: 5 additions & 15 deletions app/views/shopify_app/sessions/set_top_level_cookie.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -28,40 +28,30 @@
<%= javascript_include_tag('shopify_app/itp_polyfill', crossorigin: 'anonymous', integrity: true) %>
</head>
<body>
<!-- Questions:
- Getting the link to an app's cookie policy?
- Rendering a custom view provided by the app developer?
-->
<main id="CookiePartitionPrompt">
<div class="Polaris-Page">
<div class="Polaris-Page__Content">
<div class="Polaris-Layout">
<div class="Polaris-Layout__Section">
<span class="Polaris-VisuallyHidden"><h1>Authorize cookies from <%= ShopifyApp.configuration.application_name %></h1></span>
<div class="Polaris-Stack Polaris-Stack--vertical">
<div class="Polaris-Stack__Item">
<div class="Polaris-Card">
<div class="Polaris-Card__Header">
<h2 class="Polaris-Heading">Allow cookies from <%= ShopifyApp.configuration.application_name %>?</h2>
<h1 class="Polaris-Heading"><%= I18n.t('enable_cookies_heading', app: ShopifyApp.configuration.application_name) %></h1>
</div>
<div class="Polaris-Card__Section">
<p>Allowing cookies lets you use <%= ShopifyApp.configuration.application_name %> while you’re signed in to Shopify by temporarily storing your personal information and preferences. Cookies are required for the app to work properly.</p>
<p><%= I18n.t('enable_cookies_body', app: ShopifyApp.configuration.application_name) %></p>
</div>
<div class="Polaris-Card__Section Polaris-Card__Section--subdued">
<p>Cookies expire after 30 days of use in your current web browser. <a class="Polaris-Link" href="#">Read <%= ShopifyApp.configuration.application_name %>’s cookie policy</a>.</p>
<p><%= I18n.t('enable_cookies_footer') %></p>
</div>
</div>
</div>
<div class="Polaris-Stack__Item">
<div class="Polaris-Stack Polaris-Stack--distributionEqualSpacing">
<div class="Polaris-Stack__Item">
<button type="button" class="Polaris-Button">
<span class="Polaris-Button__Content"><span>Decline</span></span>
</button>
</div>
<div class="Polaris-Stack Polaris-Stack--distributionTrailing">
<div class="Polaris-Stack__Item">
<button type="button" class="Polaris-Button Polaris-Button--primary" id="AcceptCookies">
<span class="Polaris-Button__Content"><span>Allow cookies</span></span>
<span class="Polaris-Button__Content"><span><%= I18n.t('enable_cookies_action') %></span></span>
</button>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions config/locales/de.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
de:
logged_out: 'Erfolgreich ausgelogt'
could_not_log_in: 'Shopify Store Login fehlgeschlagen'
enable_cookies_heading: "Enable cookies from %{app}"
enable_cookies_body: "You must manually enable cookies in this browser in order to use %{app} within Shopify."
enable_cookies_footer: 'Cookies let the app authenticate you by temporarily storing your preferences and personal information. They expire after 30 days.'
enable_cookies_action: 'Enable cookies'
4 changes: 4 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ en:
logged_out: 'Successfully logged out'
could_not_log_in: 'Could not log in to Shopify store'
invalid_shop_url: 'Invalid shop domain'
enable_cookies_heading: "Enable cookies from %{app}"
enable_cookies_body: "You must manually enable cookies in this browser in order to use %{app} within Shopify."
enable_cookies_footer: 'Cookies let the app authenticate you by temporarily storing your preferences and personal information. They expire after 30 days.'
enable_cookies_action: 'Enable cookies'
4 changes: 4 additions & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
es:
logged_out: 'Cerrar sesión'
could_not_log_in: 'No se pudo iniciar sesión en tu tienda de Shopify'
enable_cookies_heading: "Enable cookies from %{app}"
enable_cookies_body: "You must manually enable cookies in this browser in order to use %{app} within Shopify."
enable_cookies_footer: 'Cookies let the app authenticate you by temporarily storing your preferences and personal information. They expire after 30 days.'
enable_cookies_action: 'Enable cookies'
4 changes: 4 additions & 0 deletions config/locales/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@ fr:
logged_out: 'Vous êtes déconnecté(e)'
could_not_log_in: 'Impossible de se connecter à la boutique Shopify'
invalid_shop_url: 'Url invalide'
enable_cookies_heading: "Enable cookies from %{app}"
enable_cookies_body: "You must manually enable cookies in this browser in order to use %{app} within Shopify."
enable_cookies_footer: 'Cookies let the app authenticate you by temporarily storing your preferences and personal information. They expire after 30 days.'
enable_cookies_action: 'Enable cookies'
4 changes: 4 additions & 0 deletions config/locales/ja.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
ja:
logged_out: 'ログインに成功しました'
could_not_log_in: 'Shopifyストアにログインできませんでした'
enable_cookies_heading: "Enable cookies from %{app}"
enable_cookies_body: "You must manually enable cookies in this browser in order to use %{app} within Shopify."
enable_cookies_footer: 'Cookies let the app authenticate you by temporarily storing your preferences and personal information. They expire after 30 days.'
enable_cookies_action: 'Enable cookies'

0 comments on commit b77ae63

Please sign in to comment.