Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aliases with i18n support #1298

Closed
rickthepick opened this issue Sep 22, 2021 · 7 comments
Closed

aliases with i18n support #1298

rickthepick opened this issue Sep 22, 2021 · 7 comments

Comments

@rickthepick
Copy link

hello. how do i do this using i18n?
(feature from https://github.com/nuxt-community/router-extras-module)

<router>
 {
    path: '/posts',
    alias: [
      '/articles',
      '/blog'
    ]
 }
</router>

i want to be able to configure their i18n routes:

  "posts": {
     pt: "/posts-pt"
     ...
  },
  "articles": {
    pt: "/articles-pt"
    ...
  },
  "blog": {
    pt: "/blog-pt"
    ...
  },
@rchl
Copy link
Collaborator

rchl commented Sep 22, 2021

@rickthepick
Copy link
Author

rickthepick commented Sep 23, 2021

Thanks. This is different because aliases allow several different names for the same page.

Aliases are actually generated using i18n, but you don't have any control over them. For example, if the page 'main.vue' contains:

<router>
 {
    path: '/posts',
    alias: [
      '/articles',
      '/blog'
    ]
 }
</router>

then /posts, /articles, /blog will all be generated with the main.vue page content, but unfortunately you do not have control over i18n, e.g.,

  "blog": {
    pt: "/blog-pt"
    ...
  },

is ignored even though /blog is generated for all the locales.

@rickthepick
Copy link
Author

rickthepick commented Sep 23, 2021

What I really need is this:

"blog": {
  en: "/blog",
  pt: false,
  ko: false
}

@hacknug
Copy link

hacknug commented Sep 28, 2021

I think my proposed change in #1281 would allow for such functionality. I'm using it in production for a couple sites I needed to be able to define the routes manually since the module didn't knew how to handle those cases.

We would need to make sure my changes don't break core functionality (pretty sure I didn't account for all scenarios this module handles) but I wanna say it wouldn't be too hard to also add support for this?

@stale
Copy link

stale bot commented Jan 8, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 8, 2022
@hacknug
Copy link

hacknug commented Jan 11, 2022

not stale

@stale stale bot removed the stale label Jan 11, 2022
@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 16, 2022
@stale stale bot closed this as completed Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants