-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat - create page by action to verify status - (TEST) #1586
Open
carlosstenzel
wants to merge
31
commits into
expressjs:gh-pages
Choose a base branch
from
carlosstenzel:feat/create-status-page
base: gh-pages
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
8aa1746
feat - create page by action to verify status
carlosstenzel 917818c
feat - create file to re-write
carlosstenzel 0015734
fix - adjust path
carlosstenzel 570d5a5
feat - change actions
carlosstenzel d66f270
fix - try run direct script
carlosstenzel f0633ca
feat - migrete for run script
carlosstenzel 1875a9e
fix - force create and commit file
carlosstenzel a67b098
fix - test commit in PR
carlosstenzel 2d9acdf
fix - add command to check branch
carlosstenzel 7e1098c
fix - add git status
carlosstenzel 7e8070c
fix - change commit method
carlosstenzel 90348cc
fix - change ref to branch
carlosstenzel 1e47e27
fix - add ref in action
carlosstenzel 22179c0
fix - remove command
carlosstenzel 40aa526
fix - set set name
carlosstenzel 7c1c685
fix - test force checkout
carlosstenzel ac87df2
fix - comment command
carlosstenzel 39a47ca
fix - change ref in ckeckout
carlosstenzel caa46a5
fix - change version
carlosstenzel 2c17089
feat - run manual script
carlosstenzel c4074fa
Merge branch 'expressjs:gh-pages' into feat/create-status-page
carlosstenzel 7a069cd
fix - adjust layout
carlosstenzel c22e9e6
Merge branch 'feat/create-status-page' of https://github.com/carlosst…
carlosstenzel c5fae64
fix - change script
carlosstenzel b3878e4
fix - try change version
carlosstenzel 3c5a8a1
fix - try new ref
carlosstenzel dab4e70
fix - remove fetch-depth
carlosstenzel dbb1fba
fix - remove fix
carlosstenzel b947150
fix - try add permission
carlosstenzel cc0bc69
fix - remove npm i in action
carlosstenzel 7dd9444
fix - add ref for pull request
carlosstenzel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: status-translation | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- gh-pages | ||
paths: | ||
- 'en/**' | ||
- 'de/**' | ||
- 'es/**' | ||
- 'fr/**' | ||
- 'it/**' | ||
- 'ja/**' | ||
- 'ko/**' | ||
- 'pt-br/**' | ||
- 'ru/**' | ||
- 'sk/**' | ||
- 'th/**' | ||
- 'tr/**' | ||
- 'uk/**' | ||
- 'uz/**' | ||
- 'zh-cn/**' | ||
- 'zh-tw/**' | ||
|
||
jobs: | ||
verify-translation: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '20' | ||
- run: | | ||
|
||
npm run verify-translation | ||
|
||
git branch --show-current | ||
|
||
git config --global user.name 'GitHub Actions Bot' | ||
git config --global user.email "[email protected]" | ||
git add . | ||
git status | ||
git commit -m "generated" | ||
git push | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
layout: page | ||
title: Status Translate | ||
menu: resources | ||
lang: en | ||
redirect_from: "/resources/status-translate.html" | ||
--- | ||
|
||
# Status Translate | ||
|
||
This page shows the status of the translation of the documentation into different languages. | ||
|
||
| en | pt-br | es | de | fr | it | ja | ko | ru | tr | th | sk | uz | zh-cn | zh-tw | | ||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| | ||
| guide/behind-proxies.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| guide/database-integration.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| guide/debugging.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| guide/error-handling.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| guide/migrating-4.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| guide/migrating-5.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | | ||
| guide/overriding-express-api.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | | ||
| guide/routing.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| guide/using-middleware.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| guide/using-template-engines.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| guide/writing-middleware.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | | ||
| resources/community.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| resources/contributing.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | | ||
| resources/glossary.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| resources/middleware.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| resources/status-translate.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | | ||
| resources/utils.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | | ||
| resources/middleware/body-parser.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | | ||
| resources/middleware/compression.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | | ||
| resources/middleware/connect-rid.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | | ||
| resources/middleware/cookie-parser.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | | ||
| resources/middleware/cookie-session.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | | ||
| resources/middleware/cors.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | | ||
| resources/middleware/errorhandler.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | | ||
| resources/middleware/method-override.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | | ||
| resources/middleware/morgan.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | | ||
| resources/middleware/multer.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | | ||
| resources/middleware/response-time.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | | ||
| resources/middleware/serve-favicon.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | | ||
| resources/middleware/serve-index.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | | ||
| resources/middleware/serve-static.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | | ||
| resources/middleware/session.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | | ||
| resources/middleware/timeout.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | | ||
| resources/middleware/vhost.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | | ||
| starter/basic-routing.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| starter/examples.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | | ||
| starter/faq.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| starter/generator.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| starter/hello-world.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| starter/installing.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| starter/static-files.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| advanced/best-practice-performance.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | | ||
| advanced/best-practice-security.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ❌ | ✅ | ✅ | | ||
| advanced/developing-template-engines.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| advanced/healthcheck-graceful-shutdown.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | | ||
| advanced/security-updates.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| 3x/api.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| 4x/api.md | ✅ | ✅ | 🔄 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ | | ||
| 5x/api.md | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
const fs = require('node:fs') | ||
|
||
const contentBase = `--- | ||
layout: page | ||
title: Status Translate | ||
menu: resources | ||
lang: en | ||
redirect_from: "/resources/status-translate.html" | ||
--- | ||
|
||
# Status Translate | ||
|
||
This page shows the status of the translation of the documentation into different languages. | ||
|
||
| en |` | ||
|
||
let content = contentBase | ||
|
||
const languageBase = 'en' | ||
const verifyLanguage = ['pt-br', 'es', 'de', 'fr', 'it', 'ja', 'ko', 'ru', 'tr', 'th', 'sk', 'uz', 'zh-cn', 'zh-tw'] | ||
|
||
const statusTranslate = [] | ||
statusTranslate[`${languageBase}`] = [] | ||
|
||
verifyLanguage.forEach((language) => { | ||
content = content + ` ${language} |` | ||
statusTranslate[`${language}`] = [] | ||
}) | ||
|
||
content = content + '\n |---|' | ||
|
||
verifyLanguage.forEach(() => { | ||
content = content + '---|' | ||
}) | ||
|
||
content = content + '\n' | ||
|
||
const ignoreFiles = ['resources/status-translate'] | ||
|
||
const languageBaseFiles = ['guide', 'resources', 'resources/middleware', 'starter', 'advanced', '3x', '4x', '5x'] | ||
|
||
languageBaseFiles.forEach((pathVerify) => { | ||
const files = fs.readdirSync(`./${languageBase}/${pathVerify}`) | ||
const filesFiltered = files.filter((file) => file.includes('.md')) | ||
|
||
verifyLanguage.forEach((language) => { | ||
const verifyPath = fs.existsSync(`./${language}/${pathVerify}`) | ||
|
||
let filesCompare = [] | ||
let filesFilteredCompare = [] | ||
|
||
if (verifyPath) { | ||
filesCompare = fs.readdirSync(`./${language}/${pathVerify}`) | ||
filesFilteredCompare = filesCompare.filter((file) => file.includes('.md')) | ||
} | ||
|
||
filesFiltered.forEach((file) => { | ||
const getFileName = file | ||
|
||
if (ignoreFiles.includes(getFileName)) return | ||
|
||
statusTranslate[languageBase][`${pathVerify}/${getFileName}`] = `${pathVerify}/${getFileName}` | ||
|
||
const getDateModified = fs.statSync(`./${languageBase}/${pathVerify}/${file}`).mtime | ||
const dateFile = new Date(getDateModified) | ||
|
||
if (filesFilteredCompare.includes(file)) { | ||
const verifyFileToCompare = fs.existsSync(`./${language}/${pathVerify}/${file}`) | ||
|
||
if (!verifyFileToCompare) { | ||
statusTranslate[language][`${pathVerify}/${getFileName}`] = '❌' | ||
return | ||
} | ||
|
||
const getDateModifiedCompare = fs.statSync(`./${language}/${pathVerify}/${file}`).mtime | ||
const dateCompare = new Date(getDateModifiedCompare) | ||
|
||
if (dateFile.getTime() <= dateCompare.getTime()) { | ||
statusTranslate[language][`${pathVerify}/${getFileName}`] = '✅' | ||
} else { | ||
statusTranslate[language][`${pathVerify}/${getFileName}`] = '🔄' | ||
} | ||
} else { | ||
statusTranslate[language][`${pathVerify}/${getFileName}`] = '❌' | ||
} | ||
}) | ||
}) | ||
}) | ||
|
||
let createTable = '' | ||
|
||
Object.keys(statusTranslate[languageBase]).forEach((key) => { | ||
createTable = createTable + `| ${key} | ` | ||
verifyLanguage.forEach((language) => { | ||
createTable = createTable + `${statusTranslate[language][key]} | ` | ||
}) | ||
createTable = createTable + '\n' | ||
}) | ||
|
||
content = content + `${createTable}` | ||
|
||
fs.writeFile('./en/resources/status-translate.md', content, (err) => { | ||
if (err) { | ||
console.error(err) | ||
} else { | ||
// file written successfully | ||
console.log('Status Translate file created') | ||
} | ||
}) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not necessary to keep checking if the API versions are translated, and I don't think it will be necessary to keep looking at 'resources/middleware' either, as it is an external resource that is extracted by running a script.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the language (th) there are translated 'resources/middleware'
https://deploy-preview-1586--expressjscom-preview.netlify.app/en/resources/status-translate
the API page has been translated into other languages