Skip to content

[18.0][FIX] base_substate: missing space in substate validation message - #1323

Open
bosd wants to merge 1 commit into
OCA:18.0from
bosd:18.0-fix-base_substate-msg-typo
Open

[18.0][FIX] base_substate: missing space in substate validation message#1323
bosd wants to merge 1 commit into
OCA:18.0from
bosd:18.0-fix-base_substate-msg-typo

Conversation

@bosd

@bosd bosd commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

The substate validation error currently reads:

The substate Gevalideerd is not defined forthe state Done but for Te factureren

Problem

The message is built with f-strings inside self.env._():

self.env._(
    f"The substate {rec.substate_id.name} is not defined for"
    f"the state {rec_states[rec.state]} but for "
    f"{rec_states[target_state]}"
)

Two consequences:

  • "... is not defined for" and "the state ..." are concatenated with no
    space in between → forthe;
  • the msgid contains the interpolated values, so it can never be extracted
    nor matched against a .po entry. The string is indeed absent from
    i18n/base_substate.pot, and the message is always rendered in English
    regardless of the user language.

Change

Restore the named placeholders that were used up to 17.0. This fixes the
missing space and makes the message translatable again — as a bonus the
existing es / it translations for this msgid apply once more.

The trailing space at the end of the msgid is kept deliberately: it is what
es.po / it.po already carry, so keeping it preserves those translations.

No functional change beyond the message text.

The message was built with f-strings inside self.env._(), so:

- "is not defined for" and "the state" were concatenated without a
  space, producing "... is not defined forthe state Done but for ...";
- the interpolated msgid could never be extracted nor matched against a
  .po file, so the error was always shown in English.

Restore the named placeholders used up to 17.0, which fixes the missing
space and makes the message translatable again (the existing es/it
translations for this msgid apply once more).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants