Skip to content

Commit ff3e4a6

Browse files
committed
Merge fragmented gettext calls into single msgid per sentence
Short context-dependent fragments like "Set to", "to disable", and "instead of" risked breaking translations when the same msgid would get reused in a different template context. Unify each sentence into one _() call with inline HTML embedded in the msgid.
1 parent de96f0d commit ff3e4a6

File tree

5 files changed

+17
-51
lines changed

5 files changed

+17
-51
lines changed

changedetectionio/blueprint/settings/templates/settings.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
{{ render_field(form.application.form.filter_failure_notification_threshold_attempts, class="filter_failure_notification_threshold_attempts") }}
5757
<span class="pure-form-message-inline">{{ _('After this many consecutive times that the CSS/xPath filter is missing, send a notification') }}
5858
<br>
59-
{{ _('Set to') }} <strong>0</strong> {{ _('to disable') }}
59+
{{ _('Set to <strong>0</strong> to disable')|safe }}
6060
</span>
6161
</div>
6262
<div class="pure-control-group">
@@ -126,7 +126,7 @@
126126
<div class="pure-form-message-inline">
127127
<strong>{{ _('If you\'re having trouble waiting for the page to be fully rendered (text missing etc), try increasing the \'wait\' time here.') }}</strong>
128128
<br>
129-
{{ _('This will wait') }} <i>n</i> {{ _('seconds before extracting the text.') }}
129+
{{ _('This will wait <i>n</i> seconds before extracting the text.')|safe }}
130130
</div>
131131
<div class="pure-control-group">
132132
{{ render_field(form.application.form.webdriver_delay) }}

changedetectionio/blueprint/tags/templates/edit-tag.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
</div>
8888

8989
<div class="tab-pane-inner" id="filters-and-triggers">
90-
<p>{{ _('These settings are') }} <strong><i>{{ _('added') }}</i></strong> {{ _('to any existing watch configurations.') }}</p>
90+
<p>{{ _('These settings are <strong><i>added</i></strong> to any existing watch configurations.')|safe }}</p>
9191
{% include "edit/include_subtract.html" %}
9292
<div class="text-filtering border-fieldset">
9393
<h3>{{ _('Text filtering') }}</h3>

changedetectionio/blueprint/ui/templates/diff.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
</div>
125125
{%- endif -%}
126126
{%- if password_enabled_and_share_is_off -%}
127-
<div class="tip">{{ _('Pro-tip: You can enable') }} <strong>{{ _('"share access when password is enabled"') }}</strong> {{ _('from settings.') }}
127+
<div class="tip">{{ _('Pro-tip: You can enable <strong>"share access when password is enabled"</strong> from settings.')|safe }}
128128
</div>
129129
{%- endif -%}
130130
<div id="text-diff-heading-area" style="user-select: none;">

changedetectionio/blueprint/ui/templates/edit.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163
<div class="pure-form-message-inline">
164164
<strong>{{ _('If you\'re having trouble waiting for the page to be fully rendered (text missing etc), try increasing the \'wait\' time here.') }}</strong>
165165
<br>
166-
{{ _('This will wait') }} <i>n</i> {{ _('seconds before extracting the text.') }}
166+
{{ _('This will wait <i>n</i> seconds before extracting the text.')|safe }}
167167
{% if using_global_webdriver_wait %}
168168
<br><strong>{{ _('Using the current global default settings') }}</strong>
169169
{% endif %}
@@ -346,7 +346,7 @@ <h3>{{ _('Text filtering') }}</h3>
346346
{{ render_checkbox_field(form.filter_text_added) }}
347347
{{ render_checkbox_field(form.filter_text_replaced) }}
348348
{{ render_checkbox_field(form.filter_text_removed) }}
349-
<span class="pure-form-message-inline">{{ _('Note: Depending on the length and similarity of the text on each line, the algorithm may consider an') }} <strong>{{ _('addition') }}</strong> {{ _('instead of') }} <strong>{{ _('replacement') }}</strong> {{ _('for example.') }}</span><br>
349+
<span class="pure-form-message-inline">{{ _('Note: Depending on the length and similarity of the text on each line, the algorithm may consider an <strong>addition</strong> instead of <strong>replacement</strong> for example.')|safe }}</span><br>
350350
<span class="pure-form-message-inline">&nbsp;{{ _('So it\'s always better to select') }} <strong>{{ _('Added') }}</strong>+<strong>{{ _('Replaced') }}</strong> {{ _('when you\'re interested in new content.') }}</span><br>
351351
<span class="pure-form-message-inline">&nbsp;{{ _('When content is merely moved in a list, it will also trigger an') }} <strong>{{ _('addition') }}</strong>, {{ _('consider enabling') }} <code><strong>{{ _('Only trigger when unique lines appear') }}</strong></code></span>
352352
</fieldset>

changedetectionio/translations/messages.pot

Lines changed: 11 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: changedetection.io 0.54.9\n"
1010
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
11-
"POT-Creation-Date: 2026-04-15 10:58+0900\n"
11+
"POT-Creation-Date: 2026-04-15 15:58+0900\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -431,11 +431,7 @@ msgid "After this many consecutive times that the CSS/xPath filter is missing, s
431431
msgstr ""
432432

433433
#: changedetectionio/blueprint/settings/templates/settings.html
434-
msgid "Set to"
435-
msgstr ""
436-
437-
#: changedetectionio/blueprint/settings/templates/settings.html
438-
msgid "to disable"
434+
msgid "Set to <strong>0</strong> to disable"
439435
msgstr ""
440436

441437
#: changedetectionio/blueprint/settings/templates/settings.html changedetectionio/blueprint/ui/templates/edit.html
@@ -513,11 +509,7 @@ msgid ""
513509
msgstr ""
514510

515511
#: changedetectionio/blueprint/settings/templates/settings.html changedetectionio/blueprint/ui/templates/edit.html
516-
msgid "This will wait"
517-
msgstr ""
518-
519-
#: changedetectionio/blueprint/settings/templates/settings.html changedetectionio/blueprint/ui/templates/edit.html
520-
msgid "seconds before extracting the text."
512+
msgid "This will wait <i>n</i> seconds before extracting the text."
521513
msgstr ""
522514

523515
#: changedetectionio/blueprint/settings/templates/settings.html
@@ -871,15 +863,7 @@ msgid "Leave unchecked to use the auto-generated colour based on the tag name."
871863
msgstr ""
872864

873865
#: changedetectionio/blueprint/tags/templates/edit-tag.html
874-
msgid "These settings are"
875-
msgstr ""
876-
877-
#: changedetectionio/blueprint/tags/templates/edit-tag.html
878-
msgid "added"
879-
msgstr ""
880-
881-
#: changedetectionio/blueprint/tags/templates/edit-tag.html
882-
msgid "to any existing watch configurations."
866+
msgid "These settings are <strong><i>added</i></strong> to any existing watch configurations."
883867
msgstr ""
884868

885869
#: changedetectionio/blueprint/tags/templates/edit-tag.html changedetectionio/blueprint/ui/templates/edit.html
@@ -1323,15 +1307,7 @@ msgid "Current error-ing screenshot from most recent request"
13231307
msgstr ""
13241308

13251309
#: changedetectionio/blueprint/ui/templates/diff.html
1326-
msgid "Pro-tip: You can enable"
1327-
msgstr ""
1328-
1329-
#: changedetectionio/blueprint/ui/templates/diff.html
1330-
msgid "\"share access when password is enabled\""
1331-
msgstr ""
1332-
1333-
#: changedetectionio/blueprint/ui/templates/diff.html
1334-
msgid "from settings."
1310+
msgid "Pro-tip: You can enable <strong>\"share access when password is enabled\"</strong> from settings."
13351311
msgstr ""
13361312

13371313
#: changedetectionio/blueprint/ui/templates/diff.html
@@ -1551,37 +1527,27 @@ msgid "Limit trigger/ignore/block/extract to;"
15511527
msgstr ""
15521528

15531529
#: changedetectionio/blueprint/ui/templates/edit.html
1554-
msgid "Note: Depending on the length and similarity of the text on each line, the algorithm may consider an"
1530+
msgid ""
1531+
"Note: Depending on the length and similarity of the text on each line, the algorithm may consider an "
1532+
"<strong>addition</strong> instead of <strong>replacement</strong> for example."
15551533
msgstr ""
15561534

15571535
#: changedetectionio/blueprint/ui/templates/edit.html
1558-
msgid "instead of"
1536+
msgid "So it's always better to select"
15591537
msgstr ""
15601538

15611539
#: changedetectionio/blueprint/ui/templates/edit.html
1562-
msgid "replacement"
1540+
msgid "when you're interested in new content."
15631541
msgstr ""
15641542

15651543
#: changedetectionio/blueprint/ui/templates/edit.html
1566-
msgid "for example."
1544+
msgid "When content is merely moved in a list, it will also trigger an"
15671545
msgstr ""
15681546

15691547
#: changedetectionio/blueprint/ui/templates/edit.html
15701548
msgid "addition"
15711549
msgstr ""
15721550

1573-
#: changedetectionio/blueprint/ui/templates/edit.html
1574-
msgid "So it's always better to select"
1575-
msgstr ""
1576-
1577-
#: changedetectionio/blueprint/ui/templates/edit.html
1578-
msgid "when you're interested in new content."
1579-
msgstr ""
1580-
1581-
#: changedetectionio/blueprint/ui/templates/edit.html
1582-
msgid "When content is merely moved in a list, it will also trigger an"
1583-
msgstr ""
1584-
15851551
#: changedetectionio/blueprint/ui/templates/edit.html
15861552
msgid "consider enabling"
15871553
msgstr ""

0 commit comments

Comments
 (0)