Skip to content

Commit aad4b02

Browse files
talygurynneSpecc
andauthored
Localize email templates to Russian (#494)
* Localize email templates to Russian Translated all user-facing text in email templates from English to Russian, including subjects, button labels, and message bodies. Updated pluralization and formatting to use Russian language rules and improved consistency across all notification types. * Update workers/email/src/templates/emails/assignee/html.twig Co-authored-by: Peter <specc.dev@gmail.com> * Update text.twig * Update workers/email/src/templates/emails/sign-up/html.twig Co-authored-by: Peter <specc.dev@gmail.com> * Update text.twig * Update workers/email/src/templates/emails/payment-failed/html.twig Co-authored-by: Peter <specc.dev@gmail.com> * Update workers/email/src/templates/emails/payment-success/html.twig Co-authored-by: Peter <specc.dev@gmail.com> * Update text.twig * Update workers/email/src/templates/emails/events-limit-almost-reached/html.twig Co-authored-by: Peter <specc.dev@gmail.com> * Update wording in events limit notification emails Refined the message in both HTML and text templates for the 'events limit almost reached' email to clarify staying informed about all incidents. * Update assignee email templates wording Revised the message in both HTML and text email templates to clarify that the recipient is assigned as responsible for fixing a bug in the project, instead of just processing an event. * Update subject.twig * Update workers/email/src/templates/emails/days-limit-almost-reached/html.twig Co-authored-by: Peter <specc.dev@gmail.com> * Refine event email templates formatting Improved the formatting of the unsubscribe text in the HTML template by consolidating it into a single line. Updated the text template to conditionally display the event type with a colon only if it exists, enhancing clarity in event listings. * Update event-info.twig * Update workers/email/src/templates/emails/days-limit-almost-reached/html.twig Co-authored-by: Peter <specc.dev@gmail.com> * Update text.twig * Update workers/email/src/templates/emails/days-limit-almost-reached/subject.twig Co-authored-by: Peter <specc.dev@gmail.com> * Update workers/email/src/templates/emails/event/text.twig Co-authored-by: Peter <specc.dev@gmail.com> * Improve event type and title display in email templates Updated both HTML and text email templates to conditionally display the event type followed by the event title only if the type exists, improving clarity and formatting. * Update workers/email/src/templates/emails/events-limit-almost-reached/html.twig Co-authored-by: Peter <specc.dev@gmail.com> * Update text.twig * Update event email templates button and link text Changed the button label and link text from 'Просмотреть событие' to 'Просмотреть детали' in both HTML and text event email templates for improved clarity. * Update Russian email templates for events limit notice Improved the wording in both HTML and text versions of the 'events limit almost reached' email templates in Russian for better clarity and tone. * Update days-limit email templates with renewal info Added conditional messaging in both HTML and text email templates to inform users if their subscription will be auto-renewed or if they need to attach a card or pay manually, based on the presence of a subscription ID. * Update email templates branding and footer text Replaces 'Российский трекер ошибок' and 'Сделан в CodeX' with 'Мониторинг ошибок' in all email templates and layout. This unifies and simplifies the branding across all notification emails. * Fix placement of plan suspension notice in email templates Moved the warning about error monitoring suspension to appear only when appropriate in both HTML and text versions of the days-limit-almost-reached email. This ensures the message is shown in the correct context for users without an active subscription. * Unify unsubscribe text in email templates Standardized the wording of unsubscribe and notification preference instructions across all email templates for consistency and clarity. * Update Russian email templates wording and formatting Changed button labels from 'Просмотреть' to 'Смотреть' for consistency across assignee, event, and several-events templates. Improved formatting in events-limit-almost-reached and sign-up HTML templates by adding line breaks for better readability. * Prefill email in login link for sign-up email Updated the login button in the sign-up email template to include the email as a query parameter, allowing the login form to be prefilled for the user. * Update workers/email/src/templates/emails/assignee/html.twig Co-authored-by: Peter <specc.dev@gmail.com> * Prefill email in sign-up email login link Updated the login link in the sign-up email template to include the email as a query parameter, allowing the login form to be prefilled for new users. * Simplify days-limit-almost-reached email templates Removed conditional logic for subscription status in both HTML and text email templates. Now always informs the user that the subscription will be renewed in the specified number of days. * Update days-limit email templates with clearer renewal info Revised both HTML and text email templates to clarify the need to link a card for automatic renewal or pay for the next month manually. Added a warning that error monitoring will be suspended if the plan is not renewed. * Fix event type display when type is undefined in email templates Updated event email templates to use the default filter for event type, preventing display issues when the type is undefined or missing. This ensures consistent formatting in both HTML and text versions of event notification emails. * Refactor event type display in email templates Replaced inline ternary logic with Twig if statements for displaying event types in event email templates. This improves readability and consistency across HTML and text versions. * Update workspace invite subject variable name Changed the variable in the workspace invite email subject from 'name' to 'workspaceName' for improved clarity and consistency. * Remove duplicate event title block in email template Deleted a redundant table row displaying the event title and icon above the main event title block in the event email template to avoid duplicate information. * Update html.twig * fix some styles * Update backtrace.twig * Update event-info.twig * few more fixes * Update backtrace.twig * Update subject.twig * Add environment prefix to email sender name Non-production environments now include the environment name in the email sender name to help distinguish emails sent from staging or development. * Revert "Add environment prefix to email sender name" This reverts commit 29adaa6. * Add user email to sign-up email template variables Introduces an 'email' field to the sign-up template variables and updates the email template to use this value for the login button link. This ensures the correct email is prefilled in the login URL. * Update backtrace.twig * move nobr outside or pre * fix typo * remove nobr --------- Co-authored-by: Peter <specc.dev@gmail.com>
1 parent 09faddb commit aad4b02

41 files changed

Lines changed: 179 additions & 180 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

workers/email/scripts/emailOverview.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,16 @@ class EmailTestServer {
149149
period: 10,
150150
reason: 'error on the payment server side',
151151
daysAfterPayday: countDaysAfterPayday(workspace.lastChargeDate, workspace.paidUntil),
152+
daysAfterBlock: 5,
153+
daysLeft: 3,
154+
eventsCount: workspace.billingPeriodEventsCount,
155+
eventsLimit: 100000,
156+
tariffPlanId: '5f47f031ff71510040f433c1',
157+
password: '1as2eadd321a3cDf',
158+
plan: {
159+
name: 'Корпоративный'
160+
},
161+
workspaceName: workspace.name,
152162
};
153163

154164
try {

workers/email/src/templates/components/backtrace.twig

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
</div>
2020
</td>
2121
<td style="border-top-right-radius: 6px;border-top-left-radius: 0;border-bottom-right-radius: 6px;border-bottom-left-radius: 0; background-color: {{ frame.line == backtrace.line ? 'rgba(149, 61, 135, 0.3);' : 'unset' }}">
22-
<div style="padding-top: 0;padding-right: 10px;margin-left: 20px;padding-bottom: 0; overflow: auto">
23-
<font color="#969FB3"
24-
style="font-size: 12px; line-height: 1.75; color: #969FB3; white-space: pre; text-overflow: clip">{{ frame.content | escape }}</font>
25-
</div>
22+
<pre style="margin: 0;padding-top: 0;padding-right: 10px;margin-left: 20px;padding-bottom: 0; overflow: auto"><font color="#969FB3" style="font-size: 12px; line-height: 1.75; color: #969FB3; white-space: nowrap; text-overflow: clip">{{ frame.content | escape }}</font></pre>
2623
</td>
2724
</tr>
2825
{% endfor %}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<a href="{{ href }}" style="text-decoration: none">
22
<div style="padding-top: 12px;padding-right: 0;padding-left: 0;padding-bottom: 12px;background-color: #4979e4; border-radius: 4px; text-align: center">
33
<font color="#dbe6ff"
4-
style="font-size: 14.4px; font-weight: 500; color: #dbe6ff;">
5-
{{ label }}
4+
style="font-size: 14.4px; color: #dbe6ff;">
5+
<b>{{ label }}</b>
66
</font>
77
</div>
88
</a>

workers/email/src/templates/components/event-info.twig

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,31 @@
33
<div style="display: inline-block; padding: 0 9px; border-radius: 16px; background-color: #4979e4; text-align: center; margin-bottom: 5px; margin-right: 10px;">
44
<font color="#dbe6ff" style="font-size: 12px; line-height: 20px; font-weight: 500; letter-spacing: -0.09px; color: #dbe6ff;">
55
<nobr>
6-
{{ event.newCount | abbrNumber }}&nbsp;new
6+
{{ event.newCount | abbrNumber }}&nbsp;{{ pluralize_ru(event.newCount, ['новое', 'новых', 'новых']) }}
77
</nobr>
88
</font>
99
</div>
1010
{% endif %}
1111
{% if event.event.totalCount is not empty %}
1212
<font color="#969FB3" style="font-size: 12px; line-height: 20px;letter-spacing: 0.17px;text-align: center; color: #969FB3;">
1313
<nobr>
14-
{{ event.event.totalCount | abbrNumber }}&nbsp;total
14+
{{ event.event.totalCount | abbrNumber }}&nbsp;всего
1515
</nobr>
1616
</font>
1717
&nbsp;&nbsp;
1818
{% endif %}
1919
{% if event.daysRepeated is not empty %}
2020
<font color="#969FB3" style="font-size: 12px; line-height: 20px; letter-spacing: 0.17px;text-align: center; color: #969FB3;">
2121
<nobr>
22-
{{ event.daysRepeated }}&nbsp;days&nbsp;repeating
22+
{{ event.daysRepeated }}&nbsp;{{ pluralize_ru(event.daysRepeated, ['день', 'дня', 'дней']) }}
2323
</nobr>
2424
</font>
2525
&nbsp;&nbsp;
2626
{% endif %}
2727
{% if event.usersAffected %}
2828
<font color="#969FB3" style="font-size: 12px; line-height: 20px; letter-spacing: 0.17px;text-align: center; color: #969FB3;">
2929
<nobr>
30-
{{ event.usersAffected }}&nbsp;users&nbsp;affected
30+
{{ event.usersAffected }}&nbsp;{{ pluralize_ru(event.usersAffected, ['пользователь', 'пользователя', 'пользователей']) }}
3131
</nobr>
3232
</font>
3333
{% endif %}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<tr>
2-
<td style="display: block; padding-top: 20px; padding-right: 20px; padding-bottom: 20px; padding-left: 20px; margin-bottom: 60px; border-width: 1px; border-color: #494f5e; border-style: solid; border-radius: 10px; color: #dbe6ff; text-decoration: none;">
2+
<td style="display: block; padding-top: 13px; padding-right: 20px; padding-bottom: 13px; padding-left: 20px; margin-bottom: 60px; border-width: 1px; border-color: #494f5e; border-style: solid; border-radius: 10px; color: #dbe6ff; text-decoration: none;">
33
<font color="#dbe6ff" style="font-size: 15px; letter-spacing: 0.4px; pointer-events: none;">
44
<span style="display: block; padding-bottom: 15px;">
55
{{ event.payload.title | escape }}
66
</span>
77
</font>
88
{% include './event-info.twig' with {event: { daysRepeated: daysRepeated, event: {totalCount: event.totalCount}, usersAffected: event.usersAffected}} %}
99
</td>
10-
</tr>
10+
</tr>

workers/email/src/templates/components/layout.twig

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -152,17 +152,7 @@
152152
<td style="text-align: center">
153153
<font color="#969FB3"
154154
style="font-size: 13px; line-height: 1.46; letter-spacing: 0.16px; color: #969FB3;">
155-
Российский трекер ошибок
156-
</font>
157-
</td>
158-
</tr>
159-
<tr>
160-
<td style="padding-top: 30px; text-align: center">
161-
<font color="#969FB3"
162-
style="font-size: 13px; line-height: 1.46; letter-spacing: 0.16px; color: #969FB3;">
163-
Made by
164-
<a href="https://codex.so"
165-
style="color: inherit !important; text-decoration: none;">CodeX</a>
155+
Мониторинг ошибок
166156
</font>
167157
</td>
168158
</tr>

workers/email/src/templates/emails/assignee/html.twig

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
{% else %}
2020
{{ whoAssigned.email }}
2121
{% endif %}
22-
assigned you to resolve the event
22+
назначил вас ответственным за исправление ошибки
2323
</span>
2424
</font>
2525
</td>
@@ -28,7 +28,7 @@
2828
<tr>
2929
<td style="padding-right: 20px;padding-left: 20px;padding-bottom: 40px;">
3030
{% set url = host ~ '/project/' ~ project._id ~ '/event/' ~ event._id ~ '/overview' %}
31-
{% include '../../components/button.twig' with {href: url, label: 'View event'} %}
31+
{% include '../../components/button.twig' with {href: url, label: 'Смотреть событие'} %}
3232
</td>
3333
</tr>
3434

@@ -39,7 +39,5 @@
3939
{% endblock %}
4040

4141
{% block unsubscribeText %}
42-
You received this email because you are currently opted in to receive such alerts via your
43-
personal notifications settings. You may adjust your preferences at any time by clicking
44-
the link above.
42+
Вы получили это письмо, потому что подписаны на подобные уведомления. Вы можете изменить настройки, перейдя по ссылке выше.
4543
{% endblock %}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
You're assigned: ({{ project.name | escape }}) {{ event.payload.title }}
1+
Вы были назначены ответственным за фикс «{{ event.payload.title }}» — {{ project.name | escape }}
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
{% if whoAssigned.name %}{{ whoAssigned.name | escape }}{% else %}{{ whoAssigned.email }}{% endif %} assigned you to resolve the event
1+
{% if whoAssigned.name %}{{ whoAssigned.name | escape }}{% else %}{{ whoAssigned.email }}{% endif %} назначил вас ответственным за исправление ошибки в проекте «{{ project.name | escape }}»
22

33
{{ event.payload.title }}
44

5-
{{ event.totalCount }} total
6-
{{ daysRepeated }} {% if daysRepeated == 1 %}day{% else %}days{% endif %} repeating
7-
{{ event.usersAffected }} {% if event.usersAffected == 1 %}user{% else %}users{% endif %} affected
5+
{{ event.totalCount }} {{ pluralize_ru(event.totalCount, ['раз', 'раза', 'раз']) }}
6+
{{ daysRepeated }} {{ pluralize_ru(daysRepeated, ['день', 'дня', 'дней']) }} повторяется
7+
{{ event.usersAffected }} {{ pluralize_ru(event.usersAffected, ['пользователь', 'пользователя', 'пользователей']) }} затронуто
88

9-
View event: {{ host }}/project/{{ project._id }}/event/{{ event._id }}/overview
9+
Смотреть событие: {{ host }}/project/{{ project._id }}/event/{{ event._id }}/overview
1010

1111
***
1212

13-
You received this email because you are currently opted in to receive such alerts via your personal notifications settings. You may adjust your preferences at any time by clicking the link: {{ host }}/account/notifications
13+
Вы получили это письмо, потому что подписаны на подобные уведомления. Вы можете изменить настройки, перейдя по ссылке: {{ host }}/account/notifications
1414

15-
Hawk
16-
Errors tracking system
15+
***
1716

18-
Made by CodeX
17+
Хоук
18+
Мониторинг ошибок

workers/email/src/templates/emails/block-workspace/html.twig

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<td align="center" style="padding: 15px 0;">
1515
<font color="#dbe6ff" style="font-size: 15px; text-align: center; color: #dbe6ff; letter-spacing: 0.4px;">
1616
<span style="vertical-align: middle; display: inline-block;">
17-
«{{ workspace.name | escape }}» не принимает события
17+
«{{ workspace.name | escape }}» не видит новые ошибки
1818
</span>
1919
</font>
2020
</td>
@@ -33,7 +33,13 @@
3333
</tr>
3434
<tr>
3535
<td style="padding-right: 20px; padding-left: 20px; padding-bottom: 40px;">
36-
{% include '../../components/button.twig' with {href: host ~ '/workspace/' ~ workspace._id ~ '/settings/billing', label: workspace.tariffPlanId is same as('5f47f031ff71510040f433c1') ? 'Увеличить лимит от 99 ₽' : 'Открыть настройки'} %}
36+
{% set tariffPlanIdString = workspace.tariffPlanId ~ '' %}
37+
{% if tariffPlanIdString == '5f47f031ff71510040f433c1' %}
38+
{% set buttonLabel = 'Увеличить лимит от 99 ₽' %}
39+
{% else %}
40+
{% set buttonLabel = 'Открыть настройки' %}
41+
{% endif %}
42+
{% include '../../components/button.twig' with {href: host ~ '/workspace/' ~ workspace._id ~ '/settings/billing', label: buttonLabel} %}
3743
</td>
3844
</tr>
3945
{% endblock %}

0 commit comments

Comments
 (0)