Skip to content

Localized search placeholders don't appear even when config'd #2132

Open
@adamlui

Description

Bug Report

When filling localized info in placeholder, noData & pathNamespaces of window.$docsify.search in index.html, only English appears even on non-English pages

Steps to reproduce

  1. Fill window.$docsify.search in index.html with localized info such as:
    search: {
        paths: 'auto',
        placeholder: { '/': 'Search',
            '/zh-cn/': '搜索', '/ja/': '찾다', '/ko/': '検索', '/hi/': 'खोज', '/de/': 'Suchen', '/es/': 'Buscar',
            '/fr/': 'Recherche', '/it/': 'Ricerca', '/pt/': 'Procurar' },
        noData: { '/': 'No results!',
            '/zh-cn/': '没有结果!', '/ja/': '結果がありません!', '/ko/': '결과가 없습니다!', '/hi/': 'कोई परिणाम नहीं!',
            '/de/': 'Keine Ergebnisse!', '/es/': '¡No hay resultados!', '/fr/': 'Aucun résultat!',
            '/it/': 'Nessun risultato!', '/pt/': 'Sem resultados!' },
        pathNamespaces: /^(\/(zh-cn|ja|ko|hi|de|es|fr|it|pt))?/
    },
  1. Visit the homepage
  2. Change languages
  3. Go to search bar and observe the placeholder is English still

What is current behaviour

Search bar displays English

What is the expected behaviour

Search bar displays localized language

Other relevant information

  • Bug does still occur when all/other plugins are disabled?

  • Your OS: Windows 10

  • Node.js version: 18.15.0

  • npm/yarn version: 9.5.0

  • Browser version: 114.0.2

  • Docsify version: 4.13.0

  • Docsify plugins: search, code-copy

Please create a reproducible sandbox

The codesandbox.io site keeps giving error when I try to upload files (https://github.com/chatgptjs/chatgpt.js/tree/main/docs)

Edit 307qqv236

Mention the docsify version in which this bug was not present (if any)

Activity

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions