Thanks to visit codestin.com
Credit goes to github.com

Skip to content

variables and references contaminate translated text with special characters #951

@urhpbofyYL

Description

@urhpbofyYL

Describe the bug

just created my account to post the issue.

I found that translated texts contain invisible special characters. These characters appear at the positions where variables or references exist.

<template>
  <span>{{ $t('bar', { baz: 'baz' }) }}</span>
</template>

<fluent locale="ja">
foo = foo
bar = foo{foo}bar{$baz}baz
</fluent>

<script setup lang="ts"></script>

copy "foo⁨foo⁩bar⁨baz⁩baz" and you can see it is actually "foo<U+2068>foo<U+2069>bar<U+2068>baz<U+2069>baz" by pasting on somewhere shows unicode special characters

thanks in advance and thank you for this great project! this saved my life when I was overwhelmed by vue-i18n

Reproduction

  1. https://stackblitz.com/edit/fluent-vue-examples-pt5ujbab?file=src%2FApp.vue
  2. copy "Hello, World" under the "$t method"
  3. paste it on WebStorm or something that shows special characters
  4. see symbols of First Strong Isolate(U+2068) and Pop Directional Isolate(U+2069)

System Info

System:
  OS: Linux 6.8 Ubuntu 24.04.2 LTS 24.04.2 LTS (Noble Numbat)
  CPU: (12) x64 11th Gen Intel(R) Core(TM) i5-11400H @ 2.70GHz
  Memory: 11.32 GB / 31.13 GB
  Container: Yes
  Shell: 5.2.21 - /bin/bash
Binaries:
  Node: 22.12.0 - ~/.nvm/versions/node/v22.12.0/bin/node
  npm: 10.9.0 - ~/.nvm/versions/node/v22.12.0/bin/npm
npmPackages:
  fluent-vue: ^3.6.0 => 3.7.1 
  unplugin-fluent-vue: ^1.3.2 => 1.4.0 
  vue: ^3.5.12 => 3.5.14

Validations

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