Skip to content

Loading text remains in English regardless of configured locale #589

@kheireddinebou

Description

@kheireddinebou

Description

When initializing the React PDF Viewer with a specific locale configured via the I18n plugin (e.g., Spanish or German), the initial bootstrap messages "Initializing PDF engine..." and "Initializing plugins..." are hardcoded in English.

The viewer fails to respect the defaultLocale or provided translation markers during the critical "pre-init" phase. The UI only switches to the correct language after the engine and plugins have finished loading, which defeats the purpose of localizing the initial user experience.


Steps to Reproduce

  1. Initialize the React Viewer component.
  2. Configure the @embedpdf/plugin-i18n plugin within the viewer instance.
  3. Set the defaultLocale to a non-English language (e.g., es for Spanish)
  4. reload the page.
  5. Observe the text displayed while the engine is warming up.

Expected Behavior

The React Viewer should check the defaultLocale or the initial configuration of the i18n plugin immediately upon mounting. The loader should display the localized strings for "Initializing..." states from the very first frame of the component's lifecycle.

Actual Behavior

The viewer defaults to English hardcoded strings during the boot sequence. It ignores the i18n configurations until the plugin system is fully initialized, resulting in a "flicker" of English text before the intended language finally kicks in.


Environment Details

  • Browser: [Chrome]
  • OS: [macOS]
  • Framework: [React]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions