Giter VIP home page Giter VIP logo

Comments (17)

lucasboh avatar lucasboh commented on June 17, 2024 49

For me the following config solved the issue:

export default defineNuxtConfig({
  i18n: {
    compilation: {
      strictMessage: false,
    },
  },
})

The right config key is compilation and not precompile -> https://v8.i18n.nuxtjs.org/options/misc

from bundle-tools.

ExEr7um avatar ExEr7um commented on June 17, 2024 10

Thank you for your reporting!

You need to configure strictMessage: false. Please see the option at here: https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n#strictmessage

I should mention that if you're using nuxt-i18n then you should add this to i18n option in nuxt.config.ts:

precompile: {
  strictMessage: false,
}

from bundle-tools.

kazupon avatar kazupon commented on June 17, 2024 8

Thank you for your reporting!

You need to configure strictMessage: false.
Please see the option at here:
https://github.com/intlify/bundle-tools/tree/main/packages/unplugin-vue-i18n#strictmessage

from bundle-tools.

ExEr7um avatar ExEr7um commented on June 17, 2024 4

I add strictMessage: false in createI18n and in my nuxt.config.ts but in both cases I get same error

I use vue-i18n and nuxt 3.4.1

So you have it like this, right?

export default defineNuxtConfig({
  i18n: {
    precompile: {
      strictMessage: false,
    },
  },
})

from bundle-tools.

belfortf avatar belfortf commented on June 17, 2024 4

I'm using the latest version of the tool and nuxt 3.6.5 and if I have:

compilation: {
	strictMessage: false,
},

I don't see anymore the error message, but the HTML tag gets printed ( all I want to do is to add a "<br>" tag for formatting my text, I actually see "<br>" printed out ). What's the solution here ?

escapeHtml: true or false simply changes how the tag is printed out to screen.

from bundle-tools.

palachX avatar palachX commented on June 17, 2024 3

I added it a little differently, but I did it now the way you wrote, unfortunately the same error in html.

Following the logical path that you suggested, I added it like this and it works)
p.s. this is setting add in nuxt.config.ts

image

code:

vite: {
        plugins: [
            VueI18nVitePlugin({
                strictMessage: false,
                include: [
                    resolve(dirname(fileURLToPath(import.meta.url)), './locales/*.json')
                ]
            })
        ],
 },

from bundle-tools.

pratik149 avatar pratik149 commented on June 17, 2024 1

As per official nuxt/i18n docs:

If strictMessage is disabled by setting it to false, we recommend enabling escapeHtml option.

Therefore, now it would be...

export default defineNuxtConfig({
  i18n: {
    compilation: {
      strictMessage: false,
      escapeHtml: true,
    },
  },
})

from bundle-tools.

palachX avatar palachX commented on June 17, 2024

I add
strictMessage: false in createI18n
and in my nuxt.config.ts
but in both cases I get same error

I use vue-i18n and nuxt 3.4.1

from bundle-tools.

palachX avatar palachX commented on June 17, 2024

uh, I did it, you can close the error, I hope we helped the same guys as me)

from bundle-tools.

lxt-ing avatar lxt-ing commented on June 17, 2024

I got the same error .
the project is with electron + vue3 + webpack enviroment . i use the @inilify/unplugin-vue-i18n/webpack, but it show error ERROR [unplugin-vue-i18n] Detected HTML in because i have html in json file. i try to add strictMessage in options ,but it show another error

9AD6A12D-ABC2-45c3-BE12-6BBCF1834DC0

config:
5E2411EB-974F-45e4-AD44-20E722C02266

from bundle-tools.

palachX avatar palachX commented on June 17, 2024

Я получил ту же ошибку. проект с электронной + vue3 + средой webpack. я использую @inilify/unplugin-vue-i18n/webpack, но он показывает ошибку ERROR [unplugin-vue-i18n] Detected HTML in, потому что у меня есть html в файле json. я пытаюсь добавить strictMessage в опции, но он показывает другую ошибку

9AD6A12D-ABC2-45c3-BE12-6BBCF1834DC0

конфигурация: 5E2411EB-974F-45e4-AD44-20E722C02266

It work for me:
i use another project:
"@intlify/unplugin-vue-i18n": "^0.10.0",
"vue": "^3.2.13",
"vite": "^4.2.2"

image

from bundle-tools.

lxt-ing avatar lxt-ing commented on June 17, 2024

from bundle-tools.

palachX avatar palachX commented on June 17, 2024

@lxt-ing
Check u include, change on array maybe

from bundle-tools.

LoccBui avatar LoccBui commented on June 17, 2024

Love you @lucasboh , work for me in nuxt "^3.6.5",

from bundle-tools.

kazupon avatar kazupon commented on June 17, 2024

Hi!

We need minmal reproduction.
vue-i18n and nuxt i18n has starter

We hope you would give us your minamal reproduction.

from bundle-tools.

LoccBui avatar LoccBui commented on June 17, 2024

I'm using the latest version of the tool and nuxt 3.6.5 and if I have:

compilation: {
	strictMessage: false,
},

I don't see anymore the error message, but the HTML tag gets printed ( all I want to do is to add a "
" tag for formatting my text, I actually see "
" printed out ). What's the solution here ?

escapeHtml: true or false simply changes how the tag is printed out to screen.

@belfortf You need to use v-html to render html element

from bundle-tools.

WebOriginals avatar WebOriginals commented on June 17, 2024

Для меня следующая конфигурация решила проблему:

export default defineNuxtConfig({
  i18n: {
    compilation: {
      strictMessage: false,
    },
  },
})

Правильный ключ конфигурации compilation и не precompile -> https://v8.i18n.nuxtjs.org/options/misc

hi, it helped me, thank you

from bundle-tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.