diff --git a/lib/Controller/PageController.php b/lib/Controller/PageController.php index 0823f592..e3e12888 100644 --- a/lib/Controller/PageController.php +++ b/lib/Controller/PageController.php @@ -88,6 +88,12 @@ class PageController extends Controller // Common state self::provideCommonInitialState($this->initialState); + // Extra translations + if (\OCA\Memories\Util::recognizeIsEnabled($this->appManager)) { + // Auto translation for tags + Util::addTranslations('recognize'); + } + $response = new TemplateResponse($this->appName, 'main'); $response->setContentSecurityPolicy(self::getCSP()); $response->cacheFor(0); diff --git a/src/components/frame/Tag.vue b/src/components/frame/Tag.vue index 3e03c9bb..a67a5037 100644 --- a/src/components/frame/Tag.vue +++ b/src/components/frame/Tag.vue @@ -10,7 +10,7 @@ {{ data.count }}
- {{ data.name }} + {{ title }} {{ subtitle }}
@@ -75,6 +75,14 @@ export default defineComponent({ return API.TAG_PREVIEW(this.data.name); }, + title() { + if (this.tag) { + return this.t("recognize", this.tag.name); + } + + return this.data.name; + }, + subtitle() { if (this.album && this.album.user !== getCurrentUser()?.uid) { return `(${this.album.user})`; @@ -83,6 +91,10 @@ export default defineComponent({ return ""; }, + tag() { + return !this.face && !this.place && !this.album ? this.data : null; + }, + face() { return this.data.flag & constants.c.FLAG_IS_FACE_RECOGNIZE || this.data.flag & constants.c.FLAG_IS_FACE_RECOGNITION