Skip to content

Commit

Permalink
Fix minor styling issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Sjark authored and felixmosh committed Jun 18, 2022
1 parent 9df566e commit 0ed741d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 51 deletions.
98 changes: 48 additions & 50 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,56 +7,54 @@ import { LIB_PREFIX } from './constats';
import chalk from 'chalk';
import { syncLocales } from './index';

const options = yargs
.usage('i18next-locales-sync -p en -s de ja he -l ./path/to/locales -sp 2')
.option({
primaryLanguage: {
alias: 'p',
type: 'string',
description: 'The primary (source) language',
default: 'en',
},
secondaryLanguages: {
alias: 's',
description: 'A list of all other supported languages',
type: 'array',
default: [],
},
localesFolder: {
alias: 'l',
description: 'The locals folder path (can be relative)',
type: 'string',
normalize: true,
},
outputFolder: {
alias: 'o',
description: 'The output folder',
defaultDescription: '`localesFolder`',
type: 'string',
normalize: true,
},
config: {
alias: 'c',
description: 'A path to the config file',
type: 'string',
normalize: true,
},
useEmptyString: {
alias: 'e',
description: 'Use empty string as a value for new keys',
type: 'boolean',
normalize: true,
default: false,
defaultDescription: '`false`',
},
spaces: {
alias: 'sp',
description: 'Number of indentation spaces in json output',
type: 'number',
normalize: true,
default: 2,
},
}).argv;
const options = yargs.usage('i18next-locales-sync -p en -s de ja he -l ./path/to/locales').option({
primaryLanguage: {
alias: 'p',
type: 'string',
description: 'The primary (source) language',
default: 'en',
},
secondaryLanguages: {
alias: 's',
description: 'A list of all other supported languages',
type: 'array',
default: [],
},
localesFolder: {
alias: 'l',
description: 'The locals folder path (can be relative)',
type: 'string',
normalize: true,
},
outputFolder: {
alias: 'o',
description: 'The output folder',
defaultDescription: '`localesFolder`',
type: 'string',
normalize: true,
},
config: {
alias: 'c',
description: 'A path to the config file',
type: 'string',
normalize: true,
},
useEmptyString: {
alias: 'e',
description: 'Use empty string as a value for new keys',
type: 'boolean',
normalize: true,
default: false,
defaultDescription: '`false`',
},
spaces: {
alias: 'sp',
description: 'Number of indentation spaces in json output',
type: 'number',
normalize: true,
default: 2,
},
}).argv;

if (options.config) {
options.config = path.resolve(options.config);
Expand Down
2 changes: 1 addition & 1 deletion src/utils/writeToDisk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function writeToDisk({
) {
fs.ensureFileSync(outputFilePath);
fs.writeJSONSync(outputFilePath, otherLanguageLocaleFile.data, {
spaces: spaces,
spaces,
encoding: 'utf-8',
});
}
Expand Down

0 comments on commit 0ed741d

Please sign in to comment.