-
Notifications
You must be signed in to change notification settings - Fork 6
/
translations-collect.js
34 lines (25 loc) · 1.09 KB
/
translations-collect.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* @license Copyright (c) 2020-2022, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/
'use strict';
const path = require( 'path' );
const glob = require( 'glob' );
module.exports = options => {
// Glob handles posix paths.
const sourceFilesGlob = path.join( options.cwd, 'src', '**', '*.js' ).split( /[\\/]/g ).join( '/' );
return require( '@ckeditor/ckeditor5-dev-env' ).createPotFiles( {
// An array containing absolute paths the package sources.
sourceFiles: glob.sync( sourceFilesGlob ),
// An absolute path to the package.
packagePaths: [ options.cwd ],
// A relative path to the `@ckeditor/ckeditor5-core` package where common translations are located.
corePackagePath: path.join( 'node_modules', '@ckeditor', 'ckeditor5-core' ),
// Ignore unused from the core package, as the shared context may but does not have to be used.
ignoreUnusedCorePackageContexts: true,
// Where to save translation files.
translationsDirectory: path.join( options.cwd, 'tmp', '.transifex' ),
// Skip the license header.
skipLicenseHeader: true
} );
};