Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions lib/frontmatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,20 @@ const schema = {
properties: {
title: {
type: 'string',
required: true
required: true,
translatable: true
},
shortTitle: {
type: 'string'
type: 'string',
translatable: true
},
intro: {
type: 'string'
type: 'string',
translatable: true
},
product: {
type: 'string'
type: 'string',
translatable: true
},
permissions: {
type: 'string'
Expand Down
5 changes: 4 additions & 1 deletion script/fix-translation-errors.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ const yaml = require('js-yaml')
const ghesReleaseNotesSchema = require('../lib/release-notes-schema')
const revalidator = require('revalidator')

const fixableFmProps = ['type', 'changelog', 'mapTopic', 'hidden', 'layout', 'defaultPlatform', 'showMiniToc', 'allowTitleToDifferFromFilename', 'interactive', 'beta_product']
const fixableFmProps = Object.keys(fm.schema.properties)
.filter(property => !fm.schema.properties[property].translatable)
.sort()
const fixableYmlProps = ['date']

const loadAndValidateContent = async (path, schema) => {
Expand Down Expand Up @@ -50,6 +52,7 @@ const cmd = 'git diff --name-only origin/main | egrep "^translations/.*/(content
const changedFilesRelPaths = execSync(cmd).toString().split('\n')

changedFilesRelPaths.forEach(async (relPath) => {
// Skip READMEs
if (!relPath || relPath.endsWith('README.md')) return

const localisedAbsPath = path.join(__dirname, '..', relPath)
Expand Down