StringId.h header
#include <ew/core/StringId.h>
Namespace ew::core
StringId struct
struct ew::core::StringId
The address of one translatable string inside a project: which object holds it, and which of that object's fields it is.
Anchored to the object's UUID, never to its name. A translated chapter must survive the writer renaming that chapter, and the audit that opened this run (A3) established that the tree is id-based precisely so references outlive display text. An address keyed on a title would silently orphan every translation the first time somebody edited it.
ownerId is a bare QUuid rather than a ContentId or a CategoryId because an address is a LOCATOR, not a reference: the strings worth translating live on content objects (a document's title, an entity's field value) and on taxonomy categories (a field's label), which are two distinct id types by deliberate design. A UUID is globally unique, so naming one is unambiguous without claiming which registry owns it – and nothing here can be mistaken for a typed id and assigned back into the wrong one.
fieldPath is the field within that object, in a form that stays stable across edits:
title,body,synopsis– a named fieldvalues/<key>– an entity property, keyed by the schema key (stable; the label is not)footnotes/<id>– keyed by the footnote's own stable id
It deliberately never contains a positional index. aliases/2 would mean a different alias the moment the set reordered, and Entity::aliases() is a std::set with no per-item identity at all.
Members
QUuid ew::core::localization::StringId::ownerId
The UUID of the object holding the string.
QString ew::core::localization::StringId::fieldPath
The field within that object. See the class note for the accepted forms.
bool ew::core::localization::StringId::operator<(const StringId &other) const
Orders addresses so they can key a map, and so a serialized catalogue has a stable, diff-friendly order rather than one that changes with insertion history.
bool ew::core::localization::StringId::operator==(const StringId &other) const
Whether two addresses name the same string.
QString ew::core::localization::StringId::toKey() const
The canonical <uuid>/<fieldPath> text form, used as the on-disk key.
static StringId ew::core::localization::StringId::fromKey(QStringView key)
Parses toKey's form. Splits on the FIRST slash only, because a field path may itself contain slashes (values/height) while a UUID never does. Returns an address with a null ownerId if key has no slash or its first segment is not a UUID.