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

feat: Make translation system key based and add annotation type to gutter icon aria labels #5524

Merged
merged 11 commits into from Apr 3, 2024

Conversation

akoreman
Copy link
Contributor

@akoreman akoreman commented Mar 29, 2024

Issue #, if available: #5499

Description of changes: Changing the API we have for UI string translations from being based on the default value of the string to a more abstract key. Aim was to do this in a way that doesn't break users who currently use translations for the default value of the strings.

Changes:

  • Changes main translation identifier to a more abstract key
    • Falls back to old behavior if key is missing from provided translation file
  • Updates the nls step in the build accordingly
  • Updates existing translation files accordingly

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Pull Request Checklist:

@akoreman akoreman marked this pull request as ready for review April 2, 2024 08:22
Copy link

codecov bot commented Apr 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.61%. Comparing base (507ae2f) to head (66a88a7).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5524   +/-   ##
=======================================
  Coverage   86.60%   86.61%           
=======================================
  Files         590      591    +1     
  Lines       42705    42732   +27     
  Branches     7096     7102    +6     
=======================================
+ Hits        36985    37012   +27     
  Misses       5720     5720           
Flag Coverage Δ
unittests 86.61% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

nls(key, defaultString, params) {
if (!messages[key]) {
warn("No message found for the key '" + key + "' in the provided messages, trying to find a translation for the default string '" + defaultString + "'.");
if (!messages[defaultString]) {
Copy link
Contributor

Choose a reason for hiding this comment

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

are we keeping this default string logic for backwards compatibility reasons?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I kept this so that Ace users who currently have translations set-up don't get those broken by this change (well that's the goal at least 😄)

@akoreman akoreman requested a review from oykuyilmaz April 3, 2024 12:59
@akoreman akoreman merged commit bb8256d into ajaxorg:master Apr 3, 2024
3 checks passed
@akoreman akoreman deleted the gutter_annotation_aria-label branch April 3, 2024 14:43
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.

None yet

2 participants