Skip to content

Commit

Permalink
move l10n helper to danger
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfauquette committed Apr 5, 2023
1 parent 8303746 commit dceb808
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 43 deletions.
43 changes: 0 additions & 43 deletions .github/workflows/help-l10n-contributors.yml

This file was deleted.

28 changes: 28 additions & 0 deletions dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,36 @@ ${
`);
}

function addL10nHelpMessage() {
const isAddingLocale = danger.git.created_files.some((file) => file.includes('/src/locales/'));
const isUpdatingLocale = danger.git.modified_files.some((file) => file.includes('/src/locales/'));

if (!isAddingLocale && !isUpdatingLocale) {
return;
}
markdown(
[
'Seems you are updating localization :earth_africa: files.',
'',
'Thank you for contributing to the localization! :tada: To make your PR perfect, here is a list of elements to check: :heavy_check_mark:',
'- [ ] Verify if the PR title respects the release format. Here are two examples (depending if you update or add a locale file)',
' > [l10n] Improve Swedish (sv-SE) locale',
' > [l10n] Add Danish (da-DK) locale',
'- [ ] Update the documentation of supported locales by running `yarn l10n`',
...(isAddingLocale
? [
'- [ ] Verify that you have added an export line in `src/locales/index.ts` for the new locale.',
'- [ ] Run `yarn docs:api` which should add your new translation to the list of exported interfaces.',
]
: []),
'- [ ] Clean files with `yarn prettier`.',
].join('\n'),
);
}

async function run() {
addDeployPreviewUrls();
addL10nHelpMessage();

switch (dangerCommand) {
case 'reportPerformance':
Expand Down

0 comments on commit dceb808

Please sign in to comment.