Skip to content

Commit

Permalink
adding some comments' improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
heliomar-pena committed Dec 17, 2023
1 parent 9f162e5 commit aee5364
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions controllers/generateConfigController.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ const { listFilesOnDirectory } = require("../utils/listFiles");
const { supportedLanguagesCodes } = require("../utils/supportedLanguagesUtils");

const _promptTranslationEngines = () => {
const translationEngines = [...validEngines];
const translationEnginesToUse = [];

console.log(
"Will ask you for the translation engines you want to use. You will be able to change them later in the configuration file."
);

for (translationEngine of translationEngines) {
for (translationEngine of validEngines) {
const shouldUseEngine = confirmUserAction(
`Do you want to use ${translationEngine} as translation engine? (y/n): `
);
Expand All @@ -34,7 +33,7 @@ const _promptBasePath = async () => {
do {
let hasError = false;
basePath = promptUserInput(
'Base path for the translations files: b.e "src/localizations.": '
'Base path for the translations files: e.g "src/localizations.": '
);

if (!basePath) {
Expand Down
8 changes: 4 additions & 4 deletions controllers/generateConfigController.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe("_promptBasePath", () => {

expect(promptUserInput).toHaveBeenCalledTimes(2);
expect(promptUserInput).toHaveBeenCalledWith(
'Base path for the translations files: b.e "src/localizations.": '
'Base path for the translations files: e.g "src/localizations.": '
);
expect(confirmUserAction).toHaveBeenCalledTimes(1);

Expand All @@ -125,7 +125,7 @@ describe("_promptBasePath", () => {

expect(promptUserInput).toHaveBeenCalledTimes(3);
expect(promptUserInput).toHaveBeenCalledWith(
'Base path for the translations files: b.e "src/localizations.": '
'Base path for the translations files: e.g "src/localizations.": '
);
expect(promptUserInput).toHaveBeenCalledWith(
'\nPress enter to continue...'
Expand Down Expand Up @@ -153,7 +153,7 @@ describe("_promptBasePath", () => {

expect(promptUserInput).toHaveBeenCalledTimes(3);
expect(promptUserInput).toHaveBeenCalledWith(
'Base path for the translations files: b.e "src/localizations.": '
'Base path for the translations files: e.g "src/localizations.": '
);

expect(listFilesOnDirectory).toHaveBeenCalledTimes(2);
Expand Down Expand Up @@ -183,7 +183,7 @@ describe("_promptBasePath", () => {

expect(promptUserInput).toHaveBeenCalledTimes(4);
expect(promptUserInput).toHaveBeenCalledWith(
'Base path for the translations files: b.e "src/localizations.": '
'Base path for the translations files: e.g "src/localizations.": '
);

expect(listFilesOnDirectory).toHaveBeenCalledTimes(3);
Expand Down
2 changes: 1 addition & 1 deletion utils/listFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ const listFilesOnDirectory = (directory) => {
});
};

module.exports = { listFilesOnDirectory }
module.exports = { listFilesOnDirectory }
2 changes: 1 addition & 1 deletion utils/supportedLanguagesUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const supportedLanguages = Object.keys(allLanguagesCodes).reduce((acc, language)

/**
* An array containing all the supported languages without extra data as language name or supported engines. Only the language code.
* b.e ['en', 'es', 'pt', ...]
* e.g ['en', 'es', 'pt', ...]
*/
const supportedLanguagesCodes = Object.keys(supportedLanguages);

Expand Down

0 comments on commit aee5364

Please sign in to comment.