mirror of
https://github.com/Ocelot-Social-Community/ocelot.social.git
synced 2025-12-13 07:46:08 +00:00
Merge branch 'master' into add-webpage-notice-and-first-crowdfunding-posts
This commit is contained in:
commit
fb966e7877
4
.github/workflows/test-build.yml
vendored
4
.github/workflows/test-build.yml
vendored
@ -10,10 +10,10 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4.1.7
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4.1.7
|
||||||
|
|
||||||
- name: Setup Node 20
|
- name: Setup Node
|
||||||
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v4.0.3
|
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v4.0.3
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version-file: '.nvmrc'
|
||||||
|
|
||||||
- name: npm-install
|
- name: npm-install
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|||||||
4
.github/workflows/test-lint.yml
vendored
4
.github/workflows/test-lint.yml
vendored
@ -10,10 +10,10 @@ jobs:
|
|||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4.1.7
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4.1.7
|
||||||
|
|
||||||
- name: Setup Node 20
|
- name: Setup Node
|
||||||
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v4.0.3
|
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v4.0.3
|
||||||
with:
|
with:
|
||||||
node-version: '20'
|
node-version-file: '.nvmrc'
|
||||||
|
|
||||||
- name: npm-install
|
- name: npm-install
|
||||||
run: npm install
|
run: npm install
|
||||||
|
|||||||
182
.github/workflows/translation-consistency-check.yml
vendored
Normal file
182
.github/workflows/translation-consistency-check.yml
vendored
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
name: Check Locale Consistency
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
issues: write
|
||||||
|
pull-requests: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-translations:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v5.0.0
|
||||||
|
|
||||||
|
- name: Detect changed locale files
|
||||||
|
id: filter
|
||||||
|
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
||||||
|
with:
|
||||||
|
list-files: json
|
||||||
|
filters: |
|
||||||
|
de:
|
||||||
|
- 'docs/de/**/*.md'
|
||||||
|
en:
|
||||||
|
- 'docs/en/**/*.md'
|
||||||
|
es:
|
||||||
|
- 'docs/es/**/*.md'
|
||||||
|
fr:
|
||||||
|
- 'docs/fr/**/*.md'
|
||||||
|
token: ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Create translation tracking issue
|
||||||
|
if: steps.filter.outputs.changes != '[]'
|
||||||
|
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const { data: prs } = await github.rest.repos.listPullRequestsAssociatedWithCommit({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
commit_sha: context.sha
|
||||||
|
})
|
||||||
|
|
||||||
|
if (prs.length === 0) {
|
||||||
|
core.setFailed('No pull request found associated with this commit. This workflow only runs for merged PRs.')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const pr = prs[0]
|
||||||
|
|
||||||
|
if (!pr.number || !pr.title) {
|
||||||
|
core.setFailed('Pull request data is incomplete. Missing required fields: number or title.')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const prNumber = pr.number
|
||||||
|
const prTitle = pr.title
|
||||||
|
|
||||||
|
const changedLocales = JSON.parse('${{ steps.filter.outputs.changes }}')
|
||||||
|
const changes = {
|
||||||
|
de: { added: [], modified: [], deleted: [] },
|
||||||
|
en: { added: [], modified: [], deleted: [] },
|
||||||
|
es: { added: [], modified: [], deleted: [] },
|
||||||
|
fr: { added: [], modified: [], deleted: [] }
|
||||||
|
}
|
||||||
|
|
||||||
|
const { data: prFiles } = await github.rest.pulls.listFiles({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
pull_number: pr.number,
|
||||||
|
per_page: 100
|
||||||
|
})
|
||||||
|
|
||||||
|
if (!prFiles || !Array.isArray(prFiles)) {
|
||||||
|
core.setFailed('Failed to retrieve PR files from GitHub API.')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const locale of changedLocales) {
|
||||||
|
const localePrefix = `docs/${locale}/`
|
||||||
|
const localeFiles = prFiles.filter(f =>
|
||||||
|
f.filename.startsWith(localePrefix) && f.filename.endsWith('.md')
|
||||||
|
)
|
||||||
|
|
||||||
|
for (const file of localeFiles) {
|
||||||
|
if (file.status === 'added') {
|
||||||
|
changes[locale].added.push(file.filename)
|
||||||
|
} else if (file.status === 'removed') {
|
||||||
|
changes[locale].deleted.push(file.filename)
|
||||||
|
} else if (file.status === 'modified' || file.status === 'changed') {
|
||||||
|
changes[locale].modified.push(file.filename)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const localeNames = {
|
||||||
|
de: 'German',
|
||||||
|
en: 'English',
|
||||||
|
es: 'Spanish',
|
||||||
|
fr: 'French'
|
||||||
|
}
|
||||||
|
|
||||||
|
const baseUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}`
|
||||||
|
const blobUrl = `${baseUrl}/blob/master`
|
||||||
|
|
||||||
|
let changesSummary = ''
|
||||||
|
for (const [locale, types] of Object.entries(changes)) {
|
||||||
|
const hasChanges = types.added.length + types.modified.length + types.deleted.length > 0
|
||||||
|
if (!hasChanges) continue
|
||||||
|
|
||||||
|
const localeName = localeNames[locale] || locale.toUpperCase()
|
||||||
|
changesSummary += `#### In ${localeName} locale \`/${locale}/\`\n\n`
|
||||||
|
|
||||||
|
if (types.modified.length > 0) {
|
||||||
|
changesSummary += '##### Modified:\n'
|
||||||
|
types.modified.forEach(f => changesSummary += `- [${f}](${blobUrl}/${f})\n`)
|
||||||
|
changesSummary += '\n'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (types.added.length > 0) {
|
||||||
|
changesSummary += '##### Added:\n'
|
||||||
|
types.added.forEach(f => changesSummary += `- [${f}](${blobUrl}/${f})\n`)
|
||||||
|
changesSummary += '\n'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (types.deleted.length > 0) {
|
||||||
|
changesSummary += '##### Deleted:\n'
|
||||||
|
types.deleted.forEach(f => changesSummary += `- [${f}](${blobUrl}/${f})\n`)
|
||||||
|
changesSummary += '\n'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!changesSummary) {
|
||||||
|
core.setFailed('No markdown file changes found in locale directories despite paths-filter detecting changes.')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const issueTitle = `🔧 [Refactor] Adapt Translations to recent Documentation Changes by #${prNumber}`
|
||||||
|
const prUrl = `${baseUrl}/pull/${prNumber}`
|
||||||
|
const commitUrl = `${baseUrl}/commit/${context.sha}`
|
||||||
|
const prTemplateUrl = `https://github.com/Ocelot-Social-Community/Ocelot-Social/blob/master/.github/PULL_REQUEST_TEMPLATE.md`
|
||||||
|
|
||||||
|
const buildIssueBody = (issueNum) => `## Translation Update Required
|
||||||
|
|
||||||
|
Pull Request **[#${prNumber} ${prTitle}](${prUrl})** has been merged with documentation changes.
|
||||||
|
|
||||||
|
### Changes
|
||||||
|
|
||||||
|
${changesSummary}
|
||||||
|
---
|
||||||
|
### TODO
|
||||||
|
- [ ] Carefully view the [changed files](${commitUrl})
|
||||||
|
- [ ] Decide whether translation actions need to be performed
|
||||||
|
- [ ] If not, close this issue with an appropriate comment
|
||||||
|
- [ ] Else, update the translations
|
||||||
|
- [ ] Use the [Pull request template](${prTemplateUrl})
|
||||||
|
- [ ] When all translation updates are completed, set this very issue to be fixed by the pull request (" - fixes #${issueNum}")`
|
||||||
|
|
||||||
|
try {
|
||||||
|
const { data: newIssue } = await github.rest.issues.create({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
title: issueTitle,
|
||||||
|
body: buildIssueBody('<issue-number>'),
|
||||||
|
labels: ['translation', 'documentation']
|
||||||
|
})
|
||||||
|
|
||||||
|
await github.rest.issues.update({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
issue_number: newIssue.number,
|
||||||
|
body: buildIssueBody(newIssue.number)
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log(`Created issue #${newIssue.number}`)
|
||||||
|
} catch (error) {
|
||||||
|
core.setFailed(`Failed to create issue: ${error.message}`)
|
||||||
|
}
|
||||||
4
.github/workflows/vuepress-deploy.yml
vendored
4
.github/workflows/vuepress-deploy.yml
vendored
@ -12,10 +12,10 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4.1.7
|
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v4.1.7
|
||||||
|
|
||||||
- name: Setup Node 20
|
- name: Setup Node
|
||||||
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v4.0.3
|
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v4.0.3
|
||||||
with:
|
with:
|
||||||
node-version: 20
|
node-version-file: '.nvmrc'
|
||||||
|
|
||||||
- name: Build Vuepress Pages
|
- name: Build Vuepress Pages
|
||||||
run: npm install && npm run build
|
run: npm install && npm run build
|
||||||
|
|||||||
@ -17,7 +17,7 @@ export default hopeTheme({
|
|||||||
center: ["Links"],
|
center: ["Links"],
|
||||||
end: ["Language", "Repo", "Outlook", "Search"],
|
end: ["Language", "Repo", "Outlook", "Search"],
|
||||||
},
|
},
|
||||||
locales:{
|
locales: {
|
||||||
// The key is the path for the locale to be nested under.
|
// The key is the path for the locale to be nested under.
|
||||||
// As a special case, the default locale can use '/' as its path.
|
// As a special case, the default locale can use '/' as its path.
|
||||||
'/de/': {
|
'/de/': {
|
||||||
@ -170,6 +170,13 @@ export default hopeTheme({
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mdEnhance: {
|
||||||
|
align: true,
|
||||||
|
demo: true,
|
||||||
|
sub: true,
|
||||||
|
sup: true,
|
||||||
|
vPre: true,
|
||||||
|
},
|
||||||
|
|
||||||
plugins: {
|
plugins: {
|
||||||
notice: [
|
notice: [
|
||||||
@ -203,17 +210,11 @@ export default hopeTheme({
|
|||||||
blog: {
|
blog: {
|
||||||
excerptLength: 0,
|
excerptLength: 0,
|
||||||
},
|
},
|
||||||
mdEnhance: {
|
|
||||||
align: true,
|
|
||||||
demo: true,
|
|
||||||
sub: true,
|
|
||||||
sup: true,
|
|
||||||
vPre: true,
|
|
||||||
},
|
|
||||||
redirect: {
|
redirect: {
|
||||||
autoLocale: true,
|
autoLocale: true,
|
||||||
defaultBehavior: 'defaultLocale',
|
defaultBehavior: 'defaultLocale',
|
||||||
defaultLocale: '/de/',
|
defaultLocale: '/de/',
|
||||||
|
|
||||||
localeConfig: {
|
localeConfig: {
|
||||||
'/de/': ['de-DE', 'de'],
|
'/de/': ['de-DE', 'de'],
|
||||||
'/en/': ['en-US', 'en'],
|
'/en/': ['en-US', 'en'],
|
||||||
@ -222,19 +223,9 @@ export default hopeTheme({
|
|||||||
},
|
},
|
||||||
localeFallback: false,
|
localeFallback: false,
|
||||||
},
|
},
|
||||||
searchPro: {
|
slimsearch: {
|
||||||
indexContent: true,
|
indexContent: true,
|
||||||
autoSuggestions: true,
|
autoSuggestions: true,
|
||||||
customFields: [
|
|
||||||
{
|
|
||||||
getter: (page) => page.frontmatter.category,
|
|
||||||
formatter: "Category: $content",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
getter: (page) => page.frontmatter.tag,
|
|
||||||
formatter: "Tag: $content",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
seo: {
|
seo: {
|
||||||
fallbackImage: '/logo.svg',
|
fallbackImage: '/logo.svg',
|
||||||
|
|||||||
4520
package-lock.json
generated
4520
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -23,7 +23,8 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@textlint-rule/textlint-rule-no-unmatched-pair": "^2.0.4",
|
"@textlint-rule/textlint-rule-no-unmatched-pair": "^2.0.4",
|
||||||
"@vuepress/bundler-vite": "^2.0.0-rc.18",
|
"@vuepress/bundler-vite": "^2.0.0-rc.18",
|
||||||
"@vuepress/plugin-redirect": "^2.0.0-rc.60",
|
"@vuepress/plugin-redirect": "2.0.0-rc.66",
|
||||||
|
"@vuepress/plugin-slimsearch": "2.0.0-rc.67",
|
||||||
"sass-embedded": "^1.91.0",
|
"sass-embedded": "^1.91.0",
|
||||||
"textlint": "^15.2.3",
|
"textlint": "^15.2.3",
|
||||||
"textlint-filter-rule-comments": "^1.2.2",
|
"textlint-filter-rule-comments": "^1.2.2",
|
||||||
@ -36,8 +37,7 @@
|
|||||||
"textlint-rule-no-start-duplicated-conjunction": "^2.0.2",
|
"textlint-rule-no-start-duplicated-conjunction": "^2.0.2",
|
||||||
"textlint-rule-no-todo": "^2.0.1",
|
"textlint-rule-no-todo": "^2.0.1",
|
||||||
"textlint-rule-no-zero-width-spaces": "^1.0.1",
|
"textlint-rule-no-zero-width-spaces": "^1.0.1",
|
||||||
"vuepress": "^2.0.0-rc.18",
|
"vuepress": "^2.0.0-rc.19",
|
||||||
"vuepress-plugin-search-pro": "^2.0.0-rc.59",
|
"vuepress-theme-hope": "2.0.0-rc.66"
|
||||||
"vuepress-theme-hope": "^2.0.0-rc.59"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user