Search code examples
vue-routernuxt.jsvue-i18nnuxt-i18n

Russian characters are not getting decoded when accessing url directly


The nuxt-link works fine, but when I reload, it can't find the route. The translated routes are informed like this:

nuxtI18n: { paths: { en: "/for-sale/", es: "/en-venta/", ru: "/для-продажи/", } }

I have observed that if I go directly to the encoded path, it will work, but if I use the russian characters it won't. So if I go to http://localhost:3000/ru/для-продажи won't work, but going to http://localhost:3000/ru/%D0%B4%D0%BB%D1%8F-%D0%BF%D1%80%D0%BE%D0%B4%D0%B0%D0%B6%D0%B8 will.

How can I make it so it will encode russian characters when looking for route?


Solution

  • My problem disappeared by adding

    // nuxt.config.js
    
    ['nuxt-i18n', {
      encodePaths: false
    }]