Skip to content

Commit

Permalink
fix: ugly index strategy warning msg - using path.sep for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
gustaveWPM committed Feb 28, 2024
1 parent 0373744 commit c5cf8ab
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/prebuilder/src/config/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ import {
FLAGS
} from '.';

// https://github.com/vitest-dev/vitest/discussions/2484
const path = require('path');

const KNOWN_OPTIONS = Object.values(FLAGS).join(', ');
export const INDEX_TOKEN = 'index';

Expand Down Expand Up @@ -210,8 +213,8 @@ const DEFAULT_TRANSLATION = {
=1 {Ugly index strategy detected!}
other {{count} ugly index strategies detected!}
}`,
uglyIndexStrategyWarningMsg: `[${capitalize(VOCAB_TOKENS.en.N_SINGULAR.WARNING)}] ''{file}'' should be renamed '${INDEX_TOKEN}${PAGE_FILE_EXT}' and moved into {folder}/`,
uglyIndexStrategyWarningJustMoveMsg: `[${capitalize(VOCAB_TOKENS.en.N_SINGULAR.WARNING)}] ''{file}'' should be moved into {folder}/`
uglyIndexStrategyWarningMsg: `[${capitalize(VOCAB_TOKENS.en.N_SINGULAR.WARNING)}] ''{file}'' should be renamed '${INDEX_TOKEN}${PAGE_FILE_EXT}' and moved into {folder}${path.sep}`,
uglyIndexStrategyWarningJustMoveMsg: `[${capitalize(VOCAB_TOKENS.en.N_SINGULAR.WARNING)}] ''{file}'' should be moved into {folder}${path.sep}`
} as const;
/* eslint-enable perfectionist/sort-objects */

Expand Down Expand Up @@ -335,8 +338,8 @@ const translations = {
=1 {Mauvaise stratégie d'index détectée !}
other {{count} mauvaises stratégies d'index détectées !}
}`,
uglyIndexStrategyWarningMsg: `[${capitalize(VOCAB_TOKENS.fr.N_SINGULAR.WARNING)}] ''{file}'' devrait être renommé '${INDEX_TOKEN}${PAGE_FILE_EXT}' et déplacé dans {folder}/`,
uglyIndexStrategyWarningJustMoveMsg: `[${capitalize(VOCAB_TOKENS.en.N_SINGULAR.WARNING)}] ''{file}'' devrait être déplacé dans {folder}/`
uglyIndexStrategyWarningMsg: `[${capitalize(VOCAB_TOKENS.fr.N_SINGULAR.WARNING)}] ''{file}'' devrait être renommé '${INDEX_TOKEN}${PAGE_FILE_EXT}' et déplacé dans {folder}${path.sep}`,
uglyIndexStrategyWarningJustMoveMsg: `[${capitalize(VOCAB_TOKENS.en.N_SINGULAR.WARNING)}] ''{file}'' devrait être déplacé dans {folder}${path.sep}`
},

[DEFAULT_LOCALE]: DEFAULT_TRANSLATION
Expand Down

0 comments on commit c5cf8ab

Please sign in to comment.