Next-translate: [Question] Does next-translate works at Zeit Now?

Created on 16 Apr 2020  路  4Comments  路  Source: vinissimus/next-translate

Hi! Just a quick question, does the package works deploying at Zeit Now 2.0? I tried both versions, static and custom server, but couldn't get it working there (I was using an outdated next with next-translate v0.90). As I was outdated, I'm trying to upgrade it all to see if solves but it would be great if someone just says that it works (got a Internal server error there with the custom server deploy).

Most helpful comment

I just deployed an application at ZEIT and it worked after 10 times trial and error!!

Ensure that you have updated the Build & Development Settings for you project (all the relevant sections)

I needed to update:

_ Build command -> yarn build

  • Development command -> yarn dev

And also ensure, if you are calling any API, that you have provided a valid URL (I was calling localhost:5000 by mistake)

This library is great! 馃殌

All 4 comments

Another thing that I could ask is, do I need to rename pages to pages_ if I'd use it with custom server?

@giovannipds using a custom server you can use directly the i18nMiddleware without the need of this "build step". So you can work directly on pages. Instead of following the current README.md, there is another doc to cover the "custom server" case:

Also, you can look at the example at:

And the deploy to Zeit Now 2.0 should work in both cases (with a custom server and with static generation).

If you still have trouble in your project, can you share here your package.json and more details about your project? This will be helpful to understand what is happening.

I just deployed an application at ZEIT and it worked after 10 times trial and error!!

Ensure that you have updated the Build & Development Settings for you project (all the relevant sections)

I needed to update:

_ Build command -> yarn build

  • Development command -> yarn dev

And also ensure, if you are calling any API, that you have provided a valid URL (I was calling localhost:5000 by mistake)

This library is great! 馃殌

@Fghurayri thanks man and @aralroca, I have to admit that I tried to integrate firstly next-i18next - which was all great before reading they do not support Now or serverless - then I removed it all and came to next-translate and firstly I tried custom server deployment which lead me to an Internal server error then I tried static but I was wrongly renaming the pages to _pages instead of pages_. Went to sleep. Next day tried upgrade next to the latest version of next-translate and many other things starting breaking up on our app. Just got headaches, specially because of Now, unfortunately. I ended up reverting it all to the previous version and we're currently doing any other kind of state verification to swap our langs for now.

I'll need to update next and many other packages before going to any internationalization package again. And I'll certainly perform it all in a different branch and test it separately before putting it on our app.

If there's one thing that I really disliked is the necessity to change pages directory for static deployments but it's kind of comprehensive.

Just wanna say that I really appreciate you guys and the other package contributors for your answers. Thank you very much - unfortunately we have some other priorities at the moment but I'll probably try the package again in a near future.

Was this page helpful?
0 / 5 - 0 ratings