SetTranslationsCommand.h header
#include <ew/core/SetTranslationsCommand.h>
Namespace ew::core
SetTranslationsCommand class
class ew::core::SetTranslationsCommand
Command that replaces the project's translation catalogues. Undo restores the previous set.
Whole-set rather than per-entry because the operation a writer actually performs is an IMPORT: a translator returns a file holding hundreds of strings, and undoing that has to put the project back as it was in one step rather than leave the writer pressing Ctrl+Z four hundred times.
It exists at all because a project-level setter without a command is silently un-undoable – the shape of the shipped defect where Version-History Restore wrote through a direct setter and undo lost the only copy of the draft (CL 3233). tools/ci/check-project-commands.ps1 enforces it.
Members
ew::core::localization::SetTranslationsCommand::SetTranslationsCommand(ew::core::project::Project &project, std::vector< TranslationCatalog > catalogs)
Creates a command that sets the catalogues to catalogs when applied.
ew::core::localization::SetTranslationsCommand::~SetTranslationsCommand() override
Destroys the command.
void ew::core::localization::SetTranslationsCommand::apply() override
Records the current catalogues and applies the new set.
void ew::core::localization::SetTranslationsCommand::undo() override
Restores the previous catalogues.
QString ew::core::localization::SetTranslationsCommand::description() const override
Returns a short description for the undo/redo UI.
ew::core::foundation::OperationSubject ew::core::localization::SetTranslationsCommand::subject() const override
Returns the subject this command changes. See Command::subject().