create-t3-app icon indicating copy to clipboard operation
create-t3-app copied to clipboard

feat(docs): left sidebar language

Open c-ehrlich opened this issue 2 years ago • 7 comments

Resolves https://github.com/t3-oss/create-t3-app/issues/821

✅ Checklist

  • [x] I have followed every step in the contributing guide (updated 2022-10-06).
  • [x] The PR title follows the convention we established conventional-commit
  • [x] I performed a functional test on my final commit

Changelog

Some more preparations for getting translations online

Uses the active language in the left sidebar and shows the table of contents for that language. Also makes the links in the sidebar link to pages of that language (manually for now, maybe there is an elegant way to this automatic...)

Tested this on @Yevhenii-Bakhmat 's RU branch (forgot to take screenshot, so made a new screenshot with a fake translated page), but should work on any translation branch/language.

Translators will also need to update the sidebar in their language in www/src/config.ts, for the in progress translations I put a note about this in the first list item.


Screenshots

image

💯

c-ehrlich avatar Nov 21 '22 11:11 c-ehrlich

⚠️ No Changeset found

Latest commit: 281ad69f731b91f3f6bd7e2f54d3b7436d132c00

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Nov 21 '22 11:11 changeset-bot[bot]

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated
create-t3-app ⬜️ Ignored (Inspect) Dec 2, 2022 at 0:28AM (UTC)

vercel[bot] avatar Nov 21 '22 11:11 vercel[bot]

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟢 Performance 100
🟢 Accessibility 100
🟢 Best practices 100
🟠 SEO 86
🟠 PWA 54

Lighthouse ran on https://create-t3-app-git-left-sidebar-language-t3-oss.vercel.app/

github-actions[bot] avatar Nov 21 '22 11:11 github-actions[bot]

Could have just continued on my PR :(

juliusmarminge avatar Nov 21 '22 11:11 juliusmarminge

Could have just continued on my PR :(

oh yeah my bad :/

feel free to merge this into your pr and close

c-ehrlich avatar Nov 21 '22 11:11 c-ehrlich

I think parsing a titles from tanslation pages would be better then using constant with paths and labels

JohnBakhmat avatar Nov 21 '22 11:11 JohnBakhmat

I think parsing a titles from tanslation pages would be better then using constant with paths and labels

i agree this would be better, but can't think of an easy way to do it currently. only way i can think of is to import every article in each language in config.ts and get frontmatter from all of them, which is a lot. maybe there's something to help us in astro docs, can check tonight.

c-ehrlich avatar Nov 21 '22 12:11 c-ehrlich

What's the status here?

juliusmarminge avatar Nov 24 '22 21:11 juliusmarminge

What's the status here?

Need to resolve conflicts tomorrow, other than that ready to review/merge.

c-ehrlich avatar Nov 24 '22 23:11 c-ehrlich

ready for review now @juliusmarminge

c-ehrlich avatar Nov 25 '22 19:11 c-ehrlich

toc disappears https://share.cleanshot.com/502Vvd

juliusmarminge avatar Nov 27 '22 12:11 juliusmarminge

This banner also looks a bit weird, but honestly im not sure how it should look so can't say CleanShot 2022-11-27 at 13 23 57@2x

juliusmarminge avatar Nov 27 '22 12:11 juliusmarminge

This banner also looks a bit weird, but honestly im not sure how it should look so can't say CleanShot 2022-11-27 at 13 23 57@2x

There are two options for this

  1. Always display it in English, then it should be ltr
  2. Translate this banner for other languages (seems to make sense), then it should be rtl as it is now. if we decide to start translating not just .md files, we'll probably want https://www.npmjs.com/package/astro-i18next

Re: ToC - will check what's going on tomorrow

c-ehrlich avatar Nov 27 '22 23:11 c-ehrlich

Always display it in English, then it should be ltr

This for now maybe? Can always change later

juliusmarminge avatar Nov 28 '22 09:11 juliusmarminge

image something weird going on with the external link icons in rtl

c-ehrlich avatar Nov 28 '22 20:11 c-ehrlich

image

c-ehrlich avatar Nov 28 '22 21:11 c-ehrlich

also dont merge before arabic is removed from the list of known languages, otherwise we're deploying two fake arabic pages

c-ehrlich avatar Nov 28 '22 22:11 c-ehrlich

@juliusmarminge lmk when you're ready to merge and i'll remove the arabic placeholder stuff (or feel free to remove it yourself)

c-ehrlich avatar Nov 30 '22 20:11 c-ehrlich