Skip to content

Commit 591213a

Browse files
committed
Added newsletter localization
Signed-off-by: George Araujo <[email protected]>
1 parent 26c97e5 commit 591213a

File tree

4 files changed

+24
-8
lines changed

4 files changed

+24
-8
lines changed

_data/en-us/strings.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ months:
9494
november: Nov
9595
december: Dec
9696
news: news
97+
newsletter:
98+
back: Back
99+
error: "Oops! Something went wrong, please try again."
100+
subscribe: subscribe
101+
subscribed: "You have successfully subscribed to the newsletter."
102+
subscribe_to_receive: "Subscribe to be notified of future articles:"
103+
too_many_signups: "Too many signups, please try again in a little while"
104+
wait: "Please wait..."
97105
no_news: No news so far...
98106
pagination:
99107
newer: Newer

_data/pt-br/strings.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,14 @@ months:
9494
november: Nov
9595
december: Dez
9696
news: novidades
97+
newsletter:
98+
back: Voltar
99+
error: "Oops! Algo deu errado, por favor tente novamente."
100+
subscribe: inscrever-se
101+
subscribed: "Você se inscreveu com sucesso na newsletter."
102+
subscribe_to_receive: "Inscreva-se para ser notificado de futuros artigos:"
103+
too_many_signups: "Muitas inscrições, por favor tente novamente em breve"
104+
wait: "Por favor, aguarde..."
97105
no_news: Nenhuma novidade no momento...
98106
pagination:
99107
newer: Recentes

_includes/related_posts.liquid

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
</li>
1818
{% endfor %}
1919
{% if site.newsletter.enabled and site.footer_fixed %}
20-
<p class="mb-2" style="margin-top: 1.5rem !important">Subscribe to be notified of future articles:</p>
20+
<p class="mb-2" style="margin-top: 1.5rem !important">{{ site.data[site.active_lang].strings.newsletter.subscribe_to_receive }}</p>
2121
{% include scripts/newsletter.liquid left=true %}
2222
{% endif %}

_includes/scripts/newsletter.liquid

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,30 +23,30 @@
2323
class="newsletter-form-button"
2424
style="justify-content: {% if include.left %}flex-start{% elsif include.right %}flex-end{% else %}center{% endif %}"
2525
>
26-
subscribe
26+
{{ site.data[site.active_lang].strings.newsletter.subscribe }}
2727
</button>
2828

2929
<button
3030
type="button"
3131
class="newsletter-loading-button"
3232
style="justify-content: {% if include.left %}flex-start{% elsif include.right %}flex-end{% else %}center{% endif %}"
3333
>
34-
Please wait...
34+
{{ site.data[site.active_lang].strings.newsletter.wait }}
3535
</button>
3636
</form>
3737

3838
<div
3939
class="newsletter-success"
4040
style="justify-content: {% if include.left %}flex-start{% elsif include.right %}flex-end{% else %}center{% endif %}"
4141
>
42-
<p class="newsletter-success-message">You're subscribed!</p>
42+
<p class="newsletter-success-message">{{ site.data[site.active_lang].strings.newsletter.subscribed }}</p>
4343
</div>
4444

4545
<div
4646
class="newsletter-error"
4747
style="justify-content: {% if include.left %}flex-start{% elsif include.right %}flex-end{% else %}center{% endif %}"
4848
>
49-
<p class="newsletter-error-message">Oops! Something went wrong, please try again</p>
49+
<p class="newsletter-error-message">{{ site.data[site.active_lang].strings.newsletter.error }}</p>
5050
</div>
5151

5252
<button
@@ -55,7 +55,7 @@
5555
onmouseout='this.style.textDecoration="none"'
5656
onmouseover='this.style.textDecoration="underline"'
5757
>
58-
&larr; Back
58+
&larr; {{ site.data[site.active_lang].strings.newsletter.back }}
5959
</button>
6060
</div>
6161

@@ -74,7 +74,7 @@
7474
7575
const rateLimit = () => {
7676
errorContainer.style.display = 'flex';
77-
errorMessage.innerText = 'Too many signups, please try again in a little while';
77+
errorMessage.innerText = '{{ site.data[site.active_lang].strings.newsletter.too_many_signups }}';
7878
submitButton.style.display = 'none';
7979
formInput.style.display = 'none';
8080
backButton.style.display = 'block';
@@ -149,7 +149,7 @@
149149
150150
success.style.display = 'none';
151151
errorContainer.style.display = 'none';
152-
errorMessage.innerText = 'Oops! Something went wrong, please try again';
152+
errorMessage.innerText = '{{ site.data[site.active_lang].strings.newsletter.error }}';
153153
backButton.style.display = 'none';
154154
formInput.style.display = 'flex';
155155
submitButton.style.display = 'flex';

0 commit comments

Comments
 (0)