B0und / WikiSpeedrun

Wikipedia Speedrun Game
https://wikispeedrun.org
MIT License
88 stars 10 forks source link

Use correct isoCode for Sweden and fix some translations #17

Closed lanker closed 10 months ago

B0und commented 11 months ago

Thank you for your contribution!

lanker commented 11 months ago

Hey, just checking in, was the intention to merge this?

B0und commented 11 months ago

Hey, just checking in, was the intention to merge this?

If you could revert the ISO code change, i would gladly merge this. (Or i guess i could make another PR myself, but only with translations)

lanker commented 11 months ago

Are there any problems with the iso code commit? Is that the reason for the failing checks? Seems to not be possible to access the logs for the check without a vercel account.

B0und commented 11 months ago

Are there any problems with the iso code commit? Is that the reason for the failing checks? Seems to not be possible to access the logs for the check without a vercel account.

It breaks article preview

https://github.com/B0und/WikiSpeedrun/pull/17#discussion_r1413407075

lanker commented 11 months ago

Indeed it did. I guess we need to convert country code to language code and instead use that for picking the correct wikipedia. Added a commit for that.

B0und commented 10 months ago

Indeed it did. I guess we need to convert country code to language code and instead use that for picking the correct wikipedia. Added a commit for that.

i left a comment in the code with a fix, since article preview still doesnt work, if your user interface language and wiki language are different. Can you add it and test that it works? https://github.com/B0und/WikiSpeedrun/pull/17/files#diff-7c243ee1ef34e493bb8d64f1da5e2f51f393fb090f1c3c39a7612d871a648610R49

lanker commented 10 months ago

i left a comment in the code with a fix, since article preview still doesnt work, if your user interface language and wiki language are different. Can you add it and test that it works? #17 (files)

Oh, sorry, thought I tested all cases, I'll take another look. However, I don't see your comment, forgot to submit it?

B0und commented 10 months ago

i left a comment in the code with a fix, since article preview still doesnt work, if your user interface language and wiki language are different. Can you add it and test that it works? #17 (files)

Oh, sorry, thought I tested all cases, I'll take another look. However, I don't see your comment, forgot to submit it?

Oops, my bad. They should be visible now

B0und commented 10 months ago

Thanks for your help!

lanker commented 10 months ago

I noticed that it generates an exception if the interfaceLanguage setting in local storage is set to an invalid locale (sv in this case, which was changed to se in this PR), sorry for not catching that earlier. Tried to figure out a fix but I'm slightly lost in all the hooks...

Anyhow, the exception:

Uncaught (in promise) TypeError: localeTranslationLoaders[locale] is not a function
    importLocaleAsync i18n-util.async.ts:28
    loadLocaleAsync i18n-util.async.ts:31
    LocaleProvider LocaleProvider.tsx:22
B0und commented 10 months ago

I noticed that it generates an exception if the interfaceLanguage setting in local storage is set to an invalid locale (sv in this case, which was changed to se in this PR), sorry for not catching that earlier. Tried to figure out a fix but I'm slightly lost in all the hooks...

Anyhow, the exception:

Uncaught (in promise) TypeError: localeTranslationLoaders[locale] is not a function
    importLocaleAsync i18n-util.async.ts:28
    loadLocaleAsync i18n-util.async.ts:31
    LocaleProvider LocaleProvider.tsx:22

pushed a fix to prod, let me know if it helps (old user settings should be reset now)

lanker commented 10 months ago

pushed a fix to prod, let me know if it helps (old user settings should be reset now)

Yep, that did it!