Skip to content

Add type safety to shared libraries localization#2777

Merged
skapur12 merged 3 commits intomainfrom
feature/loc-type-safety
Aug 18, 2023
Merged

Add type safety to shared libraries localization#2777
skapur12 merged 3 commits intomainfrom
feature/loc-type-safety

Conversation

@skapur12
Copy link
Member

@skapur12 skapur12 commented Aug 9, 2023

Add type safety to localization interface

  • Add LocalizedStrings interface to common module that is augmented across all other packages.
  • Modified build-translations to generate Typescript interface for each package containing all strings for that package
  • Switch the order of NPM commands so that build-translations now happens before Typescript compilation
  • Add clean:localization command to clean out the generated Typescript files
  • Gitignore all directories containing the Typescript files

(Note: I checked that these changes work with the portal by bux linking them and no changes need to be made to the portal- as we didn't change the localizer interface here and only the translate function, which isn't called yet in the portal ReactViews)

@codecov
Copy link

codecov bot commented Aug 9, 2023

Codecov Report

Merging #2777 (fdba36f) into main (e00e37a) will not change coverage.
The diff coverage is 100.00%.

❗ Current head fdba36f differs from pull request most recent head a818a09. Consider uploading reports for the commit a818a09 to get more accurate results

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2777   +/-   ##
=======================================
  Coverage   66.62%   66.62%           
=======================================
  Files        1209     1209           
  Lines       33751    33751           
  Branches     6218     6169   -49     
=======================================
  Hits        22486    22486           
  Misses      11126    11126           
  Partials      139      139           
Files Changed Coverage Δ
...on/src/ui-common/localization/localization-util.ts 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e00e37a...a818a09. Read the comment docs.

@skapur12 skapur12 force-pushed the feature/loc-type-safety branch from a231704 to 7dbfb09 Compare August 16, 2023 12:11
@skapur12 skapur12 force-pushed the feature/loc-type-safety branch from 7dbfb09 to 3e770b5 Compare August 18, 2023 07:42
@skapur12 skapur12 merged commit d1da941 into main Aug 18, 2023
@skapur12 skapur12 deleted the feature/loc-type-safety branch August 18, 2023 18:28
gingi pushed a commit that referenced this pull request Nov 9, 2023
* Add type safety to shared libraries localization

* Fix localization unit test

* Switch folder order of generated and localization
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.

2 participants