mirror of
https://github.com/strapi/strapi.git
synced 2025-12-30 00:37:24 +00:00
Rename the script
This commit is contained in:
parent
88149c1e3b
commit
5104a57447
@ -1,11 +1,13 @@
|
||||
'use strict';
|
||||
|
||||
const fs = require('fs-extra');
|
||||
const { addMissingKeyForSingleFile } = require('../add-missing-keys-to-other-languages');
|
||||
const { addMissingKeyForSingleFile } = require('../add-missing-keys-to-other-language');
|
||||
|
||||
// Do not run this test in --watch mode.
|
||||
// Since `addMissingKeyForSingleFile` makes changes to the files (`en.json`, `vi.json`),
|
||||
// accidentally triggering this test to re-run infinite times (because of jest watch mode)
|
||||
// You can use run `yarn test:unit scripts/front/__tests__/add-missing-keys-to-other-language.test.js`
|
||||
// if you want to focus on this test.
|
||||
describe('addMissingKeyForSingleFile', () => {
|
||||
it('should add missing keys from en.json to translation file', async () => {
|
||||
const TARGET_TRANSLATION_FILE_PATH = 'scripts/front/__tests__/vi.json';
|
||||
@ -1,9 +1,9 @@
|
||||
// Add missing keys to non-english languages from `en.json`.
|
||||
// This script eases the process of translating strapi to other languages.
|
||||
// Usage:
|
||||
// node scripts/front/add-missing-keys-to-other-languages.js [language]
|
||||
// node scripts/front/add-missing-keys-to-other-language.js [language]
|
||||
// Example:
|
||||
// node scripts/front/add-missing-keys-to-other-languages.js vi
|
||||
// node scripts/front/add-missing-keys-to-other-language.js vi
|
||||
'use strict';
|
||||
|
||||
const { join, dirname } = require('path');
|
||||
@ -61,7 +61,7 @@ const addMissingKeys = async (lang) => {
|
||||
if (process.argv.length < 3) {
|
||||
console.warn(
|
||||
chalk.yellow(
|
||||
'Please provide a language. For example:\nnode scripts/front/add-missing-keys-to-other-languages.js vi'
|
||||
'Please provide a language. For example:\nnode scripts/front/add-missing-keys-to-other-language.js vi'
|
||||
)
|
||||
);
|
||||
process.exit(1);
|
||||
Loading…
x
Reference in New Issue
Block a user