Skip to content

Feature: Add Multi-language (i18n) Support for UI Components #300

@khuepm

Description

@khuepm

Extension

SEO Plugin

Describe the Improvement

Description

Currently, the seo-plugin extension already has a src/lang/translations directory with some specific translation contents. However, these translations do not cover the UI elements (labels, buttons, tags, tabs, tooltips, etc.). The UI strings in the seo-interface and seo-display components are still hardcoded in English.

To make the SEO plugin fully accessible to a broader audience, we need to implement comprehensive multi-language (i18n) support across the entire extension's UI.

This includes translating:

  1. Interface options and properties in index.ts files.
  2. UI components, labels, buttons, tags, tabs, and tooltips in .vue files.

Expected Behavior

  • Users should see the SEO extension's UI in their preferred language (based on their Directus user settings).
  • All hardcoded English text in the UI should be extracted into translation keys.
  • Existing language files (like en-US.yaml and vi-VN.yaml) should be updated to include all the missing UI translation keys.

Technical Implementation Steps

  • Translation Files: Update the existing translation dictionaries in src/lang/translations/ (e.g., en-US.yaml, vi-VN.yaml) to include new keys for all missing UI elements (buttons, labels, tags, etc.).
  • Extension Configs: Refactor hardcoded name and note fields in src/seo-interface/index.ts and src/seo-display/index.ts to use Directus translation keys (e.g., name: '$t:seo_plugin.feature_name').
  • Vue Components: Inject useI18n() from vue-i18n into all .vue files (interface.vue, display.vue, etc.) and replace hardcoded text template strings with $t('seo_plugin.key_name').
  • Testing: Verify that switching the user language in the Directus app correctly updates the SEO plugin UI without requiring a hard refresh.

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions