Console: Extend framework with intended recipient and content type metainformation

==================================================================================

Limitations of the current framework:
- Codes the translated state only for TranslatedNotification as part of the type.
- Does not code the intended recipient (user, developer, ...)

Problems:
- Some errors are intended for developers, some errors may only be intended for users,
if, for example, there is another developer error which already contains all the information.
The current framework may lead to information duplication or to showing to the user developer
information, which is perceived as annoying.
- Logs shall be in English (report view), while every message to the user (UI) shall be translated.
The current framework can only differentiate where to report based on subscription (legacy logs do not
subscribe to notifications), and for notifications, whether it is translated or not depends on the type.
It is not possible to code errors or warnings that are already translated.

Solution:
- To extend the ILogger interface with additional metainformation, indicating the intended recipient
(User, Developer, All), and the content of the message (translated, untranslated, untranslatable). The latter
is useful for dynamic strings that won't find a match in the translation framework.

Bonus:
- This extended version allows to do away with translatednotification, as now any message can be independently
marked as translated or untranslated or untraslatable.
- It is now possible to provide the right icon of severity (error, warning, info), even when it is only user intended
and already translated.
This commit is contained in:
Abdullah Tahiri
2023-05-20 21:11:45 +02:00
committed by abdullahtahiriyo
parent dc07897a29
commit e3702ac2d8
15 changed files with 115 additions and 47 deletions

View File

@@ -2252,9 +2252,12 @@ void StatusBarObserver::OnChange(Base::Subject<const char*> &rCaller, const char
}
}
void StatusBarObserver::SendLog(const std::string& notifiername, const std::string& msg, Base::LogStyle level)
void StatusBarObserver::SendLog(const std::string& notifiername, const std::string& msg, Base::LogStyle level,
Base::IntendedRecipient recipient, Base::ContentType content)
{
(void) notifiername;
(void) recipient;
(void) content;
int messageType = -1;
switch(level){