openzipkin / zipkin

Zipkin is a distributed tracing system
https://zipkin.io/
Apache License 2.0
17.02k stars 3.09k forks source link

Fixed language selector. #3725

Closed SamTV12345 closed 9 months ago

SamTV12345 commented 9 months ago

This pull request fixes the language selector. Unfortunately the po files don't work with react-i18next so I had to convert them into json files.

Closes #3723

codefromthecrypt commented 9 months ago

Thanks! are we able to delete the other translation files now, or do we need to duplicate the content?

codefromthecrypt commented 9 months ago

TODO: delete the files the new ones were derived from and see if anything breaks ;)

SamTV12345 commented 9 months ago

TODO: delete the files the new ones were derived from and see if anything breaks ;)

Done :D

codefromthecrypt commented 9 months ago

thanks I'll double-check locally things seem to work. Also did you check on default locale (e.g. browser locale is china, so chinese is the default lang?)

codefromthecrypt commented 9 months ago

@SamTV12345 so good news is the language translations work without the old files. I think there's a problem in defaulting locale, as I checked a couple browsers, and I get chinese default ;) mind having a look?

SamTV12345 commented 9 months ago

I'll have a look at it.

SamTV12345 commented 9 months ago

@SamTV12345 so good news is the language translations work without the old files. I think there's a problem in defaulting locale, as I checked a couple browsers, and I get chinese default ;) mind having a look?

I couldn't unfortunately recreate the issue. If you find some time could you please try my version and open the browser devtools and paste the output?

codefromthecrypt commented 9 months ago

checking now, thanks

codefromthecrypt commented 9 months ago

are you only testing via npm run start? I think maybe this could be why are you not seeing the issue. Can you try building the server with the instructions at the end of zipkin-server/README.md and see if you also have an issue with language selection? At the end of the day, this is how the UI is served, so the ultimate test.

codefromthecrypt commented 9 months ago

as this PR was raised from master, I can't help adjust it (rebase etc). Try to get into the habit of raising changes from a branch besides master so easier to collaborate (e.g. git checkout -b fix-i18n; do stuff; git push origin fix-i18n)

here's the change to get sourcemap in the prod build which may help lead to identification of the cause. Locally, dev mode (npm run start) I get english, but in prod same browser ends up chinese but only for the lens ui

diff --git a/zipkin-lens/vite.config.ts b/zipkin-lens/vite.config.ts
index 90eacd181..28fc661cc 100644
--- a/zipkin-lens/vite.config.ts
+++ b/zipkin-lens/vite.config.ts
@@ -66,6 +66,7 @@ export default defineConfig(() => {
           entryFileNames: `static/js/[name].[hash].js`,
         },
       },
+      sourcemap: true,
     },
   }
 })
codefromthecrypt commented 9 months ago

so actually there is progress. Now, in a private window I default to english. There must be some cookie being interpreted as chinese default somewhere. I'll try to track it down. Meanwhile, @SamTV12345 can you fix the tests?

codefromthecrypt commented 9 months ago

not entirely sure why, but updating to latest versions works. I'll raise another PR and pick your changes in, to close this. Thanks!

codefromthecrypt commented 9 months ago

https://github.com/openzipkin/zipkin/pull/3727 takes over