m1k1o / neko

A self hosted virtual browser that runs in docker and uses WebRTC.
https://neko.m1k1o.net/
Apache License 2.0
5.96k stars 449 forks source link

lang url parameter #296

Closed mbattista closed 1 year ago

mbattista commented 1 year ago

closes #295

Added lang parameter to the URL for default lang. Should probably edit the README or the docs to reflect the change.

m1k1o commented 1 year ago

That looks like a good solution, although its not permanent and controlled by user.

I think adding env NEKO_LANG=de would be prefered way if your audience expect certain language. Though we don't have any way how to pass env variables to the frontend especially before login. Therefore I don't think its worth the effort and your solution is elegant. People could even add this parameter to their reverse proxy and that way enforce it for everyone.

mbattista commented 1 year ago

My first thought also was to add it to the env variables. Like add a replace line into the i18n.ts and replace it before the static FileServer gets started.

But I thought, that a clear cut between client and server should be keepd, so I added it as a URL parameter, which also has the advantage that you can send links in the language you want.