question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can I redirect translated url to the same page

See original GitHub issue

I want to translate url, but have an issue in ssr loading.
here is my configuration `

// nuxt.config.js
module.exports = {
...
modules: [
   [
      'nuxt-i18n',
      {
        seo: true,
        lazy: true,
        detectBrowserLanguage: {
          useCookie: true,
          cookieKey: 'i18n_redirected',
          alwaysRedirect: false,
          fallbackLocale: 'hy'
        },
        locales: [
          {
            name: 'English',
            code: 'en',
            iso: 'en-US',
            file: 'en.json'
          },
          {
            name: 'Հայերեն',
            code: 'hy',
            iso: 'hy-AM',
            file: 'hy.json'
          }
        ],
        langDir: 'locales/',
        defaultLocale: 'hy',
        parsePages: false,
         pages: {
           about: {
             en: '/about',
             hy: '/մեր֊մասին'
           },
       }
   ]
}

it works in client side when i link to localePath(‘about’) . but when i refresh my page it cant find http://localhost:4000/մեր֊մասին

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
rchlcommented, Mar 25, 2021

The removal of encodePaths is almost a year old.

At the time the removal made sense as VueRouter didn’t expect encoded paths.

If you have an issue now because VueRouter and Nuxt made changes then feel free to report an issue about it with proper reproduction steps and it will be fixed.

1reaction
rchlcommented, May 25, 2020

Paths encoding was fixing issue #7 but that one doesn’t reproduce in latest Nuxt anymore so I’m even more confident in getting rid of encodePaths option.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best practices for language redirection - Weglot
When it comes to enhancing your localization strategy, language redirection is definitely something that you might want to consider.
Read more >
php - Getting page language and redirecting to same ...
So I need to find a way to get if the current link if /fr or /en and redirect to the page in...
Read more >
Articles - Website Builder - Redirecting from old website pages
Click Advanced Settings · Click Redirects · Click + Add Redirects · Under Old Page enter the path of the previous webpage. ·...
Read more >
24122 (Redirect to translated url after setting language)
When user change language using set_language view, we can redirect him either to url from 'next' post value or 'HTTP_REFERER' header.
Read more >
How to Redirect a Page or URL in WordPress
Go to Tools > Redirection and scroll down to the Add new redirection section. WordPress Redirect Tutorial add new redirect. In the Source...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found