Skip to content

Commit

Permalink
[FIX] use str.format() instead of %-formatting
Browse files Browse the repository at this point in the history
use str.format() instead of %-formatting for translated strings (to
satisfy oca-checks-po).
  • Loading branch information
huguesdk committed Jan 6, 2025
1 parent 49de5a8 commit a6e0a7d
Show file tree
Hide file tree
Showing 12 changed files with 87 additions and 89 deletions.
16 changes: 8 additions & 8 deletions hr_timesheet_begin_end/i18n/ca.po
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ msgstr "Les línies no es poden solapar\n"
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The beginning hour (%(html_start)s) must precede the ending hour "
"(%(html_stop)s)."
"The beginning hour ({html_start}) must precede the ending hour "
"({html_stop})."
msgstr ""
"L'hora d'inici(%(html_start)s) ha de ser anterior a l'hora de fi "
"(%(html_stop)s)."
"L'hora d'inici ({html_start}) ha de ser anterior a l'hora de fi "
"({html_stop})."

#. module: hr_timesheet_begin_end
#. odoo-python
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The duration (%(html_unit_amount)s) must be equal to the difference between "
"the hours (%(html_hours)s)."
"The duration ({html_unit_amount}) must be equal to the difference between "
"the hours ({html_hours})."
msgstr ""
"La durada (%(html_unit_amount)s) ha de ser igual a la diferencia entre les "
"hores (%(html_hours)s)."
"La durada ({html_unit_amount}) ha de ser igual a la diferencia entre les "
"hores ({html_hours})."
16 changes: 8 additions & 8 deletions hr_timesheet_begin_end/i18n/cs_CZ.po
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ msgstr "Linky se nemohou překrývat:\n"
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The beginning hour (%(html_start)s) must precede the ending hour "
"(%(html_stop)s)."
"The beginning hour ({html_start}) must precede the ending hour "
"({html_stop})."
msgstr ""
"Počáteční hodina (%(html_start)s) musí předcházet koncovou hodinu "
"(%(html_stop)s)."
"Počáteční hodina ({html_start}) musí předcházet koncovou hodinu "
"({html_stop})."

#. module: hr_timesheet_begin_end
#. odoo-python
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The duration (%(html_unit_amount)s) must be equal to the difference between "
"the hours (%(html_hours)s)."
"The duration ({html_unit_amount}) must be equal to the difference between "
"the hours ({html_hours})."
msgstr ""
"Doba trvání (%(html_unit_amount)s) musí být rovna rozdílu mezi hodinami "
"(%(html_hours)s)."
"Doba trvání ({html_unit_amount}) musí být rovna rozdílu mezi hodinami "
"({html_hours})."
14 changes: 7 additions & 7 deletions hr_timesheet_begin_end/i18n/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ msgstr "Die Zeilen dürfen sich nicht überschneiden:\n"
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The beginning hour (%(html_start)s) must precede the ending hour "
"(%(html_stop)s)."
"The beginning hour ({html_start}) must precede the ending hour "
"({html_stop})."
msgstr ""
"Die Startzeit (%(html_start)s) muss vor der Endzeit (%(html_stop)s) liegen."
"Die Startzeit ({html_start}) muss vor der Endzeit ({html_stop}) liegen."

#. module: hr_timesheet_begin_end
#. odoo-python
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The duration (%(html_unit_amount)s) must be equal to the difference between "
"the hours (%(html_hours)s)."
"The duration ({html_unit_amount}) must be equal to the difference between "
"the hours ({html_hours})."
msgstr ""
"Die Dauer (%(html_unit_amount)s) muss gleich der Differenz zwischen den "
"Stunden (%(html_hours)s) sein."
"Die Dauer ({html_unit_amount}) muss gleich der Differenz zwischen den "
"Stunden ({html_hours}) sein."
16 changes: 8 additions & 8 deletions hr_timesheet_begin_end/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ msgstr "Las líneas no pueden solaparse:\n"
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The beginning hour (%(html_start)s) must precede the ending hour "
"(%(html_stop)s)."
"The beginning hour ({html_start}) must precede the ending hour "
"({html_stop})."
msgstr ""
"La hora de inicio (%(html_start)s) debe preceder a la hora final "
"(%(html_stop)s)."
"La hora de inicio ({html_start}) debe preceder a la hora final "
"({html_stop})."

#. module: hr_timesheet_begin_end
#. odoo-python
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The duration (%(html_unit_amount)s) must be equal to the difference between "
"the hours (%(html_hours)s)."
"The duration ({html_unit_amount}) must be equal to the difference between "
"the hours ({html_hours})."
msgstr ""
"La duración (%(html_unit_amount)s) debe ser igual a la diferencia entre las "
"horas (%(html_hours)s)."
"La duración ({html_unit_amount}) debe ser igual a la diferencia entre las "
"horas ({html_hours})."
16 changes: 8 additions & 8 deletions hr_timesheet_begin_end/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ msgstr "Les lignes ne peuvent pas se chevaucher :\n"
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The beginning hour (%(html_start)s) must precede the ending hour "
"(%(html_stop)s)."
"The beginning hour ({html_start}) must precede the ending hour "
"({html_stop})."
msgstr ""
"L'heure de début (%(html_start)s) doit précéder l'heure de fin "
"(%(html_stop)s)."
"L'heure de début ({html_start}) doit précéder l'heure de fin "
"({html_stop})."

#. module: hr_timesheet_begin_end
#. odoo-python
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The duration (%(html_unit_amount)s) must be equal to the difference between "
"the hours (%(html_hours)s)."
"The duration ({html_unit_amount}) must be equal to the difference between "
"the hours ({html_hours})."
msgstr ""
"La durée (%(html_unit_amount)s) doit être égale à la différence entre les "
"heures (%(html_hours)s)."
"La durée ({html_unit_amount}) doit être égale à la différence entre les "
"heures ({html_hours})."
8 changes: 4 additions & 4 deletions hr_timesheet_begin_end/i18n/hr_timesheet_begin_end.pot
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ msgstr ""
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The beginning hour (%(html_start)s) must precede the ending hour "
"(%(html_stop)s)."
"The beginning hour ({html_start}) must precede the ending hour "
"({html_stop})."
msgstr ""

#. module: hr_timesheet_begin_end
#. odoo-python
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The duration (%(html_unit_amount)s) must be equal to the difference between "
"the hours (%(html_hours)s)."
"The duration ({html_unit_amount}) must be equal to the difference between "
"the hours ({html_hours})."
msgstr ""
16 changes: 8 additions & 8 deletions hr_timesheet_begin_end/i18n/it.po
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,22 @@ msgstr "Le righe non possono sovrapporsi:\n"
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The beginning hour (%(html_start)s) must precede the ending hour "
"(%(html_stop)s)."
"The beginning hour ({html_start}) must precede the ending hour "
"({html_stop})."
msgstr ""
"L'ora di inizio (%(html_start)s) deve essere antecedente all'ora di fine "
"(%(html_stop)s)."
"L'ora di inizio ({html_start}) deve essere antecedente all'ora di fine "
"({html_stop})."

#. module: hr_timesheet_begin_end
#. odoo-python
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The duration (%(html_unit_amount)s) must be equal to the difference between "
"the hours (%(html_hours)s)."
"The duration ({html_unit_amount}) must be equal to the difference between "
"the hours ({html_hours})."
msgstr ""
"La durata (%(html_unit_amount)s) deve essere uguale alla differenza tra gli "
"orari (%(html_hours)s)."
"La durata ({html_unit_amount}) deve essere uguale alla differenza tra gli "
"orari ({html_hours})."

#~ msgid "Display Name"
#~ msgstr "Nome visualizzato"
Expand Down
16 changes: 8 additions & 8 deletions hr_timesheet_begin_end/i18n/nl_NL.po
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ msgstr "Regels kunnen elkaar niet overlappen.\n"
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The beginning hour (%(html_start)s) must precede the ending hour "
"(%(html_stop)s)."
"The beginning hour ({html_start}) must precede the ending hour "
"({html_stop})."
msgstr ""
"De begintijd (%(html_start)s) moet vooraf gaan aan de eindtijd "
"(%(html_stop)s)."
"De begintijd ({html_start}) moet vooraf gaan aan de eindtijd "
"({html_stop})."

#. module: hr_timesheet_begin_end
#. odoo-python
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The duration (%(html_unit_amount)s) must be equal to the difference between "
"the hours (%(html_hours)s)."
"The duration ({html_unit_amount}) must be equal to the difference between "
"the hours ({html_hours})."
msgstr ""
"De duur (%(html_unit_amount)s) moet gelijk zijn aan het verschil tussen "
"tijden (%(html_hours)s)."
"De duur ({html_unit_amount}) moet gelijk zijn aan het verschil tussen "
"tijden ({html_hours})."
14 changes: 7 additions & 7 deletions hr_timesheet_begin_end/i18n/pt_BR.po
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ msgstr "As linhas não podem se sobrepor:\n"
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The beginning hour (%(html_start)s) must precede the ending hour "
"(%(html_stop)s)."
"The beginning hour ({html_start}) must precede the ending hour "
"({html_stop})."
msgstr ""
"A hora inicial (%(html_start)s) deve preceder a hora final (%(html_stop)s)."
"A hora inicial ({html_start}) deve preceder a hora final ({html_stop})."

#. module: hr_timesheet_begin_end
#. odoo-python
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The duration (%(html_unit_amount)s) must be equal to the difference between "
"the hours (%(html_hours)s)."
"The duration ({html_unit_amount}) must be equal to the difference between "
"the hours ({html_hours})."
msgstr ""
"A duração (%(html_unit_amount)s) deve ser igual à diferença entre as horas "
"(%(html_hours)s)."
"A duração ({html_unit_amount}) deve ser igual à diferença entre as horas "
"({html_hours})."
14 changes: 7 additions & 7 deletions hr_timesheet_begin_end/i18n/sv.po
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,20 @@ msgstr "Rader får inte överlappa varandra:\n"
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The beginning hour (%(html_start)s) must precede the ending hour "
"(%(html_stop)s)."
msgstr "Starttiden (%(html_start)s) måste föregå sluttimmen (%(html_stop)s)."
"The beginning hour ({html_start}) must precede the ending hour "
"({html_stop})."
msgstr "Starttiden ({html_start}) måste föregå sluttimmen ({html_stop})."

#. module: hr_timesheet_begin_end
#. odoo-python
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The duration (%(html_unit_amount)s) must be equal to the difference between "
"the hours (%(html_hours)s)."
"The duration ({html_unit_amount}) must be equal to the difference between "
"the hours ({html_hours})."
msgstr ""
"Varaktigheten (%(html_unit_amount)s) måste vara lika med skillnaden mellan "
"tiderna (%(html_hours)s)."
"Varaktigheten ({html_unit_amount}) måste vara lika med skillnaden mellan "
"tiderna ({html_hours})."

#~ msgid "Display Name"
#~ msgstr "Visningsnamn"
Expand Down
8 changes: 4 additions & 4 deletions hr_timesheet_begin_end/i18n/sv_SE.po
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ msgstr ""
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The beginning hour (%(html_start)s) must precede the ending hour "
"(%(html_stop)s)."
"The beginning hour ({html_start}) must precede the ending hour "
"({html_stop})."
msgstr ""

#. module: hr_timesheet_begin_end
#. odoo-python
#: code:addons/hr_timesheet_begin_end/models/account_analytic_line.py:0
#, python-format
msgid ""
"The duration (%(html_unit_amount)s) must be equal to the difference between "
"the hours (%(html_hours)s)."
"The duration ({html_unit_amount}) must be equal to the difference between "
"the hours ({html_hours})."
msgstr ""
22 changes: 10 additions & 12 deletions hr_timesheet_begin_end/models/account_analytic_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,12 @@ def _validate_start_before_stop(self):
if line.time_stop < line.time_start:
raise exceptions.ValidationError(
_(
"The beginning hour (%(html_start)s) must "
"precede the ending hour (%(html_stop)s)."
"The beginning hour ({html_start}) must "
"precede the ending hour ({html_stop})."
).format(
html_start=value_to_html(line.time_start, None),
html_stop=value_to_html(line.time_stop, None),
)
% {
"html_start": value_to_html(line.time_start, None),
"html_stop": value_to_html(line.time_stop, None),
}
)

def _validate_unit_amount_equal_to_time_diff(self):
Expand All @@ -59,13 +58,12 @@ def _validate_unit_amount_equal_to_time_diff(self):
):
raise exceptions.ValidationError(
_(
"The duration (%(html_unit_amount)s) must be equal to the difference "
"between the hours (%(html_hours)s)."
"The duration ({html_unit_amount}) must be equal to the difference "
"between the hours ({html_hours})."
).format(
html_unit_amount=value_to_html(line.unit_amount, None),
html_hours=value_to_html(hours, None),
)
% {
"html_unit_amount": value_to_html(line.unit_amount, None),
"html_hours": value_to_html(hours, None),
}
)

def _overlap_domain(self):
Expand Down

0 comments on commit a6e0a7d

Please sign in to comment.