Internationalization
CodeMirror shows its own UI text: the search and replace panel, folding markers, the lint panel, screen reader announcements, and so on. Pass a translation table to the phrases prop to localize it. The keys are the original English strings. For the full list, see the CodeMirror translation example.
Translation table
This example uses vue-codemirror6 as a Markdown editor with the UI translated into Japanese. Keys are grouped by the package that uses them; you only need to include the keys you want to translate.
$ in a key such as replaced $ matches is a placeholder that CodeMirror replaces with a number. Keep it in the translated text.
Switching languages with vue-i18n
phrases is reactive. Changing it reconfigures the editor without recreating it, so you can follow the current vue-i18n locale with a computed:
Keys missing from the table fall back to CodeMirror’s English text, so a partial table is fine.