This commit is contained in:
EmsiaetKadosh
2025-01-21 15:41:32 +08:00
parent b86053c3a7
commit edcc095979
17 changed files with 471 additions and 88 deletions
+26
View File
@@ -0,0 +1,26 @@
//
// Created by EmsiaetKadosh on 25-1-18.
//
#include "IText.h"
#include "def.h"
const String& TranslatableText::getText() const noexcept {
refreshText();
return target->getText();
}
const RenderableString& TranslatableText::getRenderableString() const noexcept {
refreshText();
return target->getRenderableString();
}
void TranslatableText::refreshText() const noexcept {
if (target == nullptr || langConfig == translator.getConfigVersion()) {
target = translator.getText(idSrc);
langConfig = translator.getConfigVersion();
}
}