Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add check on language files and add missing translations for en and es files #999

Merged
merged 2 commits into from
Jun 25, 2024

Conversation

Ldoppea
Copy link
Member

@Ldoppea Ldoppea commented Nov 6, 2023

Some languages files were missing translations and also extra languages were not in sync with each other in white labels

Those new checks should ensure that all langages files contain the same keys and that all extra language override the same keys

@Ldoppea
Copy link
Member Author

Ldoppea commented Nov 6, 2023

@KillianCourvoisier can you review the new Spanish translations?


const areExtraFrEquivalent = areExtraLanguagesEquivalent('en')
const areExtraEnEquivalent = areExtraLanguagesEquivalent('en')
const areExtraEsEquivalent = areExtraLanguagesEquivalent('fr')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

en en fr where as it should be fr en es? Or I did not understand?

Copy link
Contributor

@zatteo zatteo Nov 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const extraLanguages = ['fr', 'en', 'es']
const areExtraLangagesOk = extraLanguages.every(extraLanguage => areExtraLanguagesEquivalent(extraLanguage))

seems just as clear and less prone to error for me

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, i fixed it here

Some considerations:

  • I applied your suggestion also for areLanguagesEquivalent calls
  • This implies that there will be a useless call to areLanguagesEquivalent('en', 'en'), comparing english to itself
    • I consider this not a problem as the result will be always be true and this is fast enough to not be perceived. Is is acceptable considering the improvement in code readibility
  • I could have put areLanguagesEquivalent and areExtraLanguagesEquivalent in the same loop, but I prefer it this way so the console prints will be grouped by file type (languages, then extra-languages)

Some languages files were missing translations and also extra languages
were not in sync with each other in white labels

Those new checks should ensure that all langages files contain the same
keys and that all extra language override the same keys
Copy link
Contributor

@KillianCourvoisier KillianCourvoisier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@zatteo zatteo merged commit a42efee into master Jun 25, 2024
1 check passed
@zatteo zatteo deleted the fix/es_translations branch June 25, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants