18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-02 09:36:48 +01:00

feat(editor): the messages of the model of the track geometry and of its norms told in the language of the editor

The first part of E4b (editor-tracks-domain.md §8; E4a left the messages of the model in English): what the model refuses a command for,
and what the norms warn of, reach the user through the catalogue of the editor, the model staying as it is, English and pure.

- The editor layer formats them: a message of the model is matched against the forms it's made by (a BLOCK limit along a line, a finding
  of the norms with its value, limit and paragraph, a rule of a turnout, a line or a vertex which can't be laid, the solver of the
  connections and its proposal...), the form of the catalogue (STR) filled with its numbers and names, the parts which are messages
  of their own (the name of a parameter of the norms, what a line or a turnout is refused for) shown so in turn; a whole message the
  catalogue has, as it is. One with no form stays English.
- The editing on the model keeps both: what the model told, English, for the log and the self-tests, and what the user reads, in the
  route design, the lay tool and the panels of E4b. The window of the application is split off editormodemodel.cpp into
  editormodemodel.h, shared by the files of E4b.

Self-test: expect modelmessage holds or lacks the text in either of them, so the cases run in any language.

lang/editor_pl.po: the Polish of the forms and of the names of the parameters of the norms the editor hadn't yet.
This commit is contained in:
maj00r
2026-11-23 17:57:23 +01:00
parent c0e6a70f5f
commit dce6f9d11c
5 changed files with 361 additions and 50 deletions
+9
View File
@@ -3424,6 +3424,15 @@ class editor_mode : public application_mode, private editor_track::observer, pri
void track_rename(TTrack &Track, std::string const &Name);
void render_model_windows();
std::string model_label(TTrack const *Track) const;
layout::network const &model_network() const;
// what the last command came to as the user reads it: the reasons and the notes of the norms in the language of the editor
std::string model_shown() const;
// a message of the model or of the norms, English as they make it, in the language of the editor
static std::string model_tr(std::string const &Text);
// the reasons of a refusal as the user reads them, the BLOCK limits of the norms of them formatted here
static std::string model_reasons_shown(layout::outcome const &Outcome);
static std::string model_notice_shown(layout::notice const &Notice);
bool m_model_delete_confirmed{false}; // the old delete let through, the scenarios looked through
selftest_result selftest_dispatch(std::string const &command, std::istringstream &words);
void selftest_step();