Skip to content

Conversation

@eveningwater
Copy link

@eveningwater eveningwater commented Aug 14, 2025

Related Bug Reports or Discussions

add the drop-down mennu in the Header component.

Summary

Check List

  • [ x ] pnpm run fix for formatting and linting code and docs

@vercel
Copy link

vercel bot commented Aug 14, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
valtio Ready Ready Preview Comment Sep 24, 2025 0:09am

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 14, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

}, [isOpen])

return (
<div className="relative language-selector">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add some margin to the right of the selector

<div className="relative language-selector mr-6">

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's add some margin to the right of the selector

<div className="relative language-selector mr-6">

Done!

@overthemike
Copy link
Collaborator

overthemike commented Aug 14, 2025

@dai-shi We'll need to figure out valtio.dev domain stuff. Right now, I think I'm still handling the nameservers for valtio.dev and am just redirecting.

</li>
<li>
<a
href="https://valtio-xnj9.vercel.app/zh"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link will need to change to something like http://zh.valtio.dev or http://valtiio.dev/zh and then we'll need to configure the dns. Let's not change this yet until we get that sorted first though.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess an alternative would be to make sure that the english link links back to the valtio.dev domain. RIght now, clicking on the new language will just redirect to the new domain and won't redirect back on change again. I think maybe the better solution here would be to make these absolute links to a new site instead of state change.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This link will need to change to something like http://zh.valtio.dev or http://valtiio.dev/zh and then we'll need to configure the dns. Let's not change this yet until we get that sorted first though.

@overthemike
My opinion is no. We don't "host" non-English site, and it's not our responsibility. So, I prefer an external URL.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RIght now, clicking on the new language will just redirect to the new domain

I think it should open a new window.

@overthemike
Copy link
Collaborator

overthemike commented Aug 14, 2025

@dai-shi We'll need to figure out valtio.dev domain stuff. Right now, I think I'm still handling the nameservers for valtio.dev and am just redirecting.

I think probably the easiest solution would be to just have me create a zh.valtio.dev subdomain and point it to that vercel app. @eveningwater For that to work, you'll want to configure the root of the app on your repo to use the chinese translation instead of english. Then just link back to valitio.dev for english stuff.

</li>
<li>
<a
href="https://valtio-xnj9.vercel.app/zh"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess an alternative would be to make sure that the english link links back to the valtio.dev domain. RIght now, clicking on the new language will just redirect to the new domain and won't redirect back on change again. I think maybe the better solution here would be to make these absolute links to a new site instead of state change.

>
中文文档
</a>
<Link href="/">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change this to <Link href='https://valtio.dev'> This way it will link back to the main site and stay up to date.

{isOpen && (
<div className="absolute right-0 mt-2 w-48 bg-white dark:bg-gray-800 rounded-md shadow-lg py-1 z-50 border border-gray-200 dark:border-gray-700">
<a
href="https://valtio-xnj9.vercel.app/zh"
Copy link
Collaborator

@overthemike overthemike Aug 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's change the href to be "https://zh/valtio.dev" and I'll create a zh subdomain on valtio.dev to point to this domain.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eveningwater I've already created the CNAME record to point here (just need to wait for propegation), but you'll want to change the root of your app to server chinese instead of english.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

** overthemike**

Can you help me check if my latest modification meets the requirements?thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eveningwater Almost. Line 158 still needs updating to http://zh.valtio.dev I think.

On your end, you can replace all of the regular .mdx files with the .zh.mdx files and then make sure the default language there will be selected to be chinese.

Let's check back in a little while to make sure the subdomain is redirecting properly to your app while you're changing your default language on your end.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eveningwater Almost. Line 158 still needs updating to http://zh.valtio.dev I think.

On your end, you can replace all of the regular .mdx files with the .zh.mdx files and then make sure the default language there will be selected to be chinese.

Let's check back in a little while to make sure the subdomain is redirecting properly to your app while you're changing your default language on your end.

Does my repo not need to display English documents? Can I just keep the Chinese documents?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eveningwater That is correct. No need to store the English docs as we store them here. Your github repos as well as your website call be all chinese docs and you can just link back for english.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eveningwater That is correct. No need to store the English docs as we store them here. Your github repos as well as your website call be all chinese docs and you can just link back for english.

Got it, thanks, I'll adjust it.

@eveningwater
Copy link
Author

@overthemike I redeployed it, the link is: https://valtio-nine.vercel.app/

@overthemike
Copy link
Collaborator

@overthemike I redeployed it, the link is: https://valtio-nine.vercel.app/

ok. I updated the DNS record.

@overthemike
Copy link
Collaborator

@eveningwater Could you also add the flag svgs next to the languages? Here are the svgs for them both:

China:

<svg className="w-4 h-4 mt-1" enable-background="new -49 141 512 512" viewBox="-49 141 512 512" xmlns="http://www.w3.org/2000/svg"><circle cx="207" cy="397" fill="#d80027" r="256"></circle><g fill="#ffda44"><path d="m91.1 296.8 22.1 68h71.5l-57.8 42.1 22.1 68-57.9-42-57.9 42 22.2-68-57.9-42.1h71.5z"></path><path d="m254.5 537.5-16.9-20.8-25 9.7 14.5-22.5-16.9-20.9 25.9 6.9 14.6-22.5 1.4 26.8 26 6.9-25.1 9.6z"></path><path d="m288.1 476.5 8-25.6-21.9-15.5 26.8-.4 7.9-25.6 8.7 25.4 26.8-.3-21.5 16 8.6 25.4-21.9-15.5z"></path><path d="m333.4 328.9-11.8 24.1 19.2 18.7-26.5-3.8-11.8 24-4.6-26.4-26.6-3.8 23.8-12.5-4.6-26.5 19.2 18.7z"></path><path d="m255.2 255.9-2 26.7 24.9 10.1-26.1 6.4-1.9 26.8-14.1-22.8-26.1 6.4 17.3-20.5-14.2-22.7 24.9 10.1z"></path></g></svg>

USA:

<svg className="w-4 h-4 mt-1 z-50" xmlns="http://www.w3.org/2000/svg" id="flag-icons-us" viewBox="0 0 640 480"><path fill="#bd3d44" d="M0 0h640v480H0"/><path stroke="#fff" stroke-width="37" d="M0 55.3h640M0 129h640M0 203h640M0 277h640M0 351h640M0 425h640"/><path fill="#192f5d" d="M0 0h364.8v258.5H0"/><marker id="us-a" markerHeight="30" markerWidth="30"><path fill="#fff" d="m14 0 9 27L0 10h28L5 27z"/></marker><path fill="none" marker-mid="url(#us-a)" d="m0 0 16 11h61 61 61 61 60L47 37h61 61 60 61L16 63h61 61 61 61 60L47 89h61 61 60 61L16 115h61 61 61 61 60L47 141h61 61 60 61L16 166h61 61 61 61 60L47 192h61 61 60 61L16 218h61 61 61 61 60z"/></svg>

feat: remove the comment

Co-authored-by: Daishi Kato <[email protected]>
@dai-shi
Copy link
Member

dai-shi commented Aug 15, 2025

I don't have much preference on it. If it's intentional, it's fine.

@dai-shi
Copy link
Member

dai-shi commented Aug 15, 2025

To be honest, I'm not sure if "Language selector" is appropriate in our case. But, I'll leave it to @overthemike.

@eveningwater
Copy link
Author

Is this intentional? No "Languages" menu in this screen size.

Screen.Recording.2025-08-15.at.18.47.28.mov

Preview

You can check out the results by following this link.:https://valtio-git-fork-eveningwater-feature-branch-pmndrs.vercel.app/

截屏2025-08-15 下午5 54 31 截屏2025-08-15 下午5 54 44

@eveningwater
Copy link
Author

To be honest, I'm not sure if "Language selector" is appropriate in our case. But, I'll leave it to @overthemike.

I think language switching might be better on mobile devices, and documents in other languages may be added in the future.Please allow me to think about whether I need to adjust it.

@overthemike
Copy link
Collaborator

As far as the "Language" label, I think the most common thing to do is to do is to have the current language 2 letter code selected with the flag next to it. See Amazon for an example.

I have some ideas on some changes for it. @eveningwater I'll clone down your fork and suggest some changes.

@eveningwater
Copy link
Author

As far as the "Language" label, I think the most common thing to do is to do is to have the current language 2 letter code selected with the flag next to it. See Amazon for an example.

I have some ideas on some changes for it. @eveningwater I'll clone down your fork and suggest some changes.

ok,thanks.

@dai-shi
Copy link
Member

dai-shi commented Sep 4, 2025

@eveningwater Please check CI errors.

@eveningwater
Copy link
Author

@eveningwater Please check CI errors.

ok.

@eveningwater
Copy link
Author

  • Vercel — Deployment has failed

Vercel Deployment has failed,I can't view the details to get the error,Shouldn't I check this?

@eveningwater
Copy link
Author

  • Vercel — Deployment has failed

Vercel Deployment has failed,I can't view the details to get the error,Shouldn't I check this?
@dai-shi

@dai-shi
Copy link
Member

dai-shi commented Sep 4, 2025

Vercel Deployment has failed,I can't view the details to get the error,Shouldn't I check this?

I can't see it either. If it's not temporarily, there might be something wrong. You might want to test building it on your end.

- 格式化 Header.tsx 文件以符合 Prettier 规范
- 更新 .prettierignore 文件,忽略 .next、node_modules 和 build 目录
- 确保 pnpm run test:format 命令能够成功通过
@dai-shi
Copy link
Member

dai-shi commented Sep 5, 2025

I can't see it either. If it's not temporarily, there might be something wrong. You might want to test building it on your end.

Sorry, it wasn't your fault.

@dai-shi
Copy link
Member

dai-shi commented Sep 5, 2025

Is this ready for @overthemike for another review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants