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

Development: Add CI action to check that German and English translation keys are consistent #9370

Merged
merged 1 commit into from
Sep 28, 2024

Conversation

b-fein
Copy link
Contributor

@b-fein b-fein commented Sep 27, 2024

Checklist

General

CI script

Motivation and Context

As noted in #9369, there are discrepancies between the translation keys in German and English. We want to avoid this.

Description

This PR adds a helper script that runs in a CI action and checks that the translation keys defined in German and English are consistent. In detail it checks that

  • the de/ and en/ directories contain files with the same names,
  • all of such pairs of equally named files contain the same keys, and
  • there are no duplicate keys defined.

The script accepts either two directories to compare the full directory content, or two files to compare the content of two files.

Steps for Testing

You can run the script locally. It should report the missing files as noticed in #9369 and find set of translation keys that only exist in German/English.

The CI action itself will maybe not run on this branch since configuration files are taken from the default branch (?), and we do not yet make changes to the translation files here.

Review Progress

Code Review

  • Code Review 1
  • Code Review 2

Manual Tests

  • Test 1
  • Test 2

Test Coverage

n/a

@coderabbitai ignore

@b-fein b-fein changed the title Development: Add CI action to check that translation keys are defined in both German and English Development: Add CI action to check that German and English translation keys are consistent Sep 27, 2024
@b-fein b-fein marked this pull request as ready for review September 27, 2024 08:25
@b-fein b-fein requested a review from a team as a code owner September 27, 2024 08:25
@b-fein b-fein force-pushed the chore/development/check-translation-keys branch 2 times, most recently from a4d80b1 to bcc1759 Compare September 27, 2024 08:28
@ls1intum ls1intum deleted a comment from coderabbitai bot Sep 27, 2024
coderabbitai[bot]

This comment was marked as spam.

@ls1intum ls1intum deleted a comment from coderabbitai bot Sep 27, 2024
@b-fein b-fein force-pushed the chore/development/check-translation-keys branch from bcc1759 to 62db059 Compare September 27, 2024 08:39
coderabbitai[bot]

This comment was marked as outdated.

@ls1intum ls1intum deleted a comment from coderabbitai bot Sep 27, 2024
@krusche
Copy link
Member

krusche commented Sep 27, 2024

Great additional check, thank you 👍

Copy link
Contributor

@raffifasaro raffifasaro left a comment

Choose a reason for hiding this comment

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

code LGTM

@magaupp
Copy link
Contributor

magaupp commented Sep 28, 2024

Tested locally. The flattened keys in the output are always prepended with an additional dot:

Missing English translation keys:
.artemisApp.attachmentUnit.createAttachmentUnits.split.empty
.artemisApp.courseCompetency.create.averageMastery
.artemisApp.courseOverview.exerciseFilter.resetFilter
...

@b-fein
Copy link
Contributor Author

b-fein commented Sep 28, 2024

The additional dot at the start is intentional since it represents a JSON pointer that way that can be directly used with jq.

@krusche krusche added this to the 7.5.5 milestone Sep 28, 2024
@krusche krusche merged commit 85fc9b7 into develop Sep 28, 2024
18 of 22 checks passed
@krusche krusche deleted the chore/development/check-translation-keys branch September 28, 2024 11:42
@krusche krusche modified the milestones: 7.5.5, 7.5.6 Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

4 participants