Skip to content

feat(seo-plugin): i18n support for UI components and fix favicon infinite loop (#299, #300)#301

Open
khuepm wants to merge 4 commits intodirectus-labs:mainfrom
khuepm:main
Open

feat(seo-plugin): i18n support for UI components and fix favicon infinite loop (#299, #300)#301
khuepm wants to merge 4 commits intodirectus-labs:mainfrom
khuepm:main

Conversation

@khuepm
Copy link

@khuepm khuepm commented Feb 24, 2026

Description

This PR introduces two major enhancements and fixes for the seo-plugin extension, addressing both UI localization capability and a performance bug during search preview rendering.

Resolves #299
Resolves #300

Changes Made

1. Multi-language (i18n) Support

  • Replaced hardcoded English string literals with the $t() translation method across all Vue components (tabs, labels, field titles, placeholders, hints, and error notices).
  • Added core translation keys systematically using the seo_plugin. prefix.
  • Created structured YAML language files en-US.yaml and vi-VN to handle these translation pairs.
  • Injected mergeLocaleMessage() directly into the main Vue bundle via src/lang/index.ts to ensure translations work seamlessly within the Directus Extension bundle constraints.
  • Transformed static Dropdown options in fields.ts (e.g. Change Frequency, Priority) into dynamic translated options on render.

2. SearchPreview Favicon Infinite Loop Fix

  • Fixed an issue in SearchPreview.vue where a broken favicon URL caused an infinite window.location.origin loop query due to missing error boundaries.
  • Added an @error event handler (handleFaviconError) to correctly capture image load failures.
  • Implemented a fallback mechanism to hide the favicon gracefully (showFavicon = false) instead of continually fetching.

Verification

  • Validated that the SearchPreview component successfully catches image errors without looping.
  • Tested the seo-plugin interface actively changing between English and Vietnamese interface modes within a local Directus environment.
  • Verified that a full npm run build succeeds correctly with the translations bundled within app.js and api.js.

Checklist

  • Tested changes locally.
  • Rebuilt dist/ elements.
  • Code follows the extension's existing structure and coding standards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: Add Multi-language (i18n) Support for UI Components Fallback favicon in seo-plugin extension being called infinitely

1 participant