Skip to content

Commit

Permalink
Rm translations directory (github#33720)
Browse files Browse the repository at this point in the history
  • Loading branch information
heiskr authored Jan 3, 2023
1 parent ad961a3 commit 11dc8cc
Show file tree
Hide file tree
Showing 40,816 changed files with 4 additions and 1,813,567 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 0 additions & 5 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ Dockerfile @github/docs-engineering
package-lock.json @github/docs-engineering
package.json @github/docs-engineering

# Localization
/.github/actions-scripts/msft-create-translation-batch-pr.js @github/docs-engineering
/.github/workflows/msft-create-translation-batch-pr.yml @github/docs-engineering
/translations/ @Octomerger

# Site Policy
/content/site-policy/ @github/site-policy-admins

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ coverage/
.next
.eslintcache
*.tsbuildinfo
translations/

# blc: broken link checker
blc_output.log
Expand Down
1 change: 0 additions & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
[ -n "$CI" ] && exit 0
. "$(dirname "$0")/_/husky.sh"

node script/prevent-translation-commits.js
npx lint-staged
9 changes: 2 additions & 7 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@

const isBrowser = process.env.BROWSER
const isActions = Boolean(process.env.GITHUB_ACTIONS)
const testTranslation = Boolean(process.env.TEST_TRANSLATION)

let reporters = ['default']
const reporters = ['default']

if (testTranslation) {
// only use custom reporter if we are linting translations
// Remove this when removing translations directory B504EDD0
reporters = ['<rootDir>/tests/helpers/lint-translation-reporter.js']
} else if (isActions) {
if (isActions) {
reporters.push('jest-github-actions-reporter')
}

Expand Down
96 changes: 0 additions & 96 deletions script/i18n/lint-translation-files.js

This file was deleted.

34 changes: 0 additions & 34 deletions script/prevent-translation-commits.js

This file was deleted.

48 changes: 0 additions & 48 deletions tests/helpers/lint-translation-reporter.js

This file was deleted.

67 changes: 1 addition & 66 deletions tests/linting/lint-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { fileURLToPath } from 'url'
import path from 'path'
import slash from 'slash'
import walk from 'walk-sync'
import { zip, groupBy } from 'lodash-es'
import { zip } from 'lodash-es'
import yaml from 'js-yaml'
import revalidator from 'revalidator'
import { fromMarkdown } from 'mdast-util-from-markdown'
Expand All @@ -15,7 +15,6 @@ import releaseNotesSchema from '../helpers/schemas/release-notes-schema.js'
import learningTracksSchema from '../helpers/schemas/learning-tracks-schema.js'
import renderContent from '../../lib/render-content/index.js'
import getApplicableVersions from '../../lib/get-applicable-versions.js'
import { execSync } from 'child_process'
import { allVersions } from '../../lib/all-versions.js'
import { jest } from '@jest/globals'
import { getDiffFiles } from '../helpers/diff-files.js'
Expand Down Expand Up @@ -291,70 +290,6 @@ if (!process.env.TEST_TRANSLATION) {
ghaeReleaseNotesToLint,
learningTracksToLint
)
} else {
// Remove this `else` when removing translations directory B504EDD0
// get all translated markdown or yaml files by comparing files changed to main branch
const changedFilesRelPaths = execSync(
'git -c diff.renameLimit=10000 diff --name-only origin/main',
{ maxBuffer: 1024 * 1024 * 100 }
)
.toString()
.split('\n')
.filter((p) => p.startsWith('translations') && (p.endsWith('.md') || p.endsWith('.yml')))

// If there are no changed files, there's nothing to lint: signal a successful termination.
if (changedFilesRelPaths.length === 0) process.exit(0)

console.log(`Found ${changedFilesRelPaths.length} translated files.`)

const {
mdRelPaths = [],
ymlRelPaths = [],
ghesReleaseNotesRelPaths = [],
ghaeReleaseNotesRelPaths = [],
learningTracksRelPaths = [],
} = groupBy(changedFilesRelPaths, (path) => {
// separate the changed files to different groups
if (path.endsWith('README.md')) {
return 'throwAway'
} else if (path.endsWith('.md')) {
return 'mdRelPaths'
} else if (path.match(/\/data\/(variables|glossaries)\//i)) {
return 'ymlRelPaths'
} else if (path.match(/\/data\/release-notes\/enterprise-server/i)) {
return 'ghesReleaseNotesRelPaths'
} else if (path.match(/\/data\/release-notes\/github-ae/i)) {
return 'ghaeReleaseNotesRelPaths'
} else if (path.match(/\data\/learning-tracks/)) {
return 'learningTracksRelPaths'
} else {
// we aren't linting the rest
return 'throwAway'
}
})

const [
mdTuples,
ymlTuples,
ghesReleaseNotesTuples,
ghaeReleaseNotesTuples,
learningTracksTuples,
] = [
mdRelPaths,
ymlRelPaths,
ghesReleaseNotesRelPaths,
ghaeReleaseNotesRelPaths,
learningTracksRelPaths,
].map((relPaths) => {
const absPaths = relPaths.map((p) => path.join(rootDir, p))
return zip(relPaths, absPaths)
})

mdToLint = mdTuples
ymlToLint = ymlTuples
ghesReleaseNotesToLint = ghesReleaseNotesTuples
ghaeReleaseNotesToLint = ghaeReleaseNotesTuples
learningTracksToLint = learningTracksTuples
}

function formatLinkError(message, links) {
Expand Down
7 changes: 0 additions & 7 deletions translations/README.md

This file was deleted.

1 change: 0 additions & 1 deletion translations/de-DE/Placeholder.txt

This file was deleted.

50 changes: 0 additions & 50 deletions translations/de-DE/content/account-and-profile/index.md

This file was deleted.

Loading

0 comments on commit 11dc8cc

Please sign in to comment.