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

Add type safety to shared libraries localization #2777

Merged
merged 3 commits into from
Aug 18, 2023

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.

.gitignore Outdated Show resolved Hide resolved
packages/common/package.json Outdated Show resolved Hide resolved
desktop/electron-builder.yml Outdated Show resolved Hide resolved
@skapur12 skapur12 merged commit d1da941 into main Aug 18, 2023
6 checks passed
@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.

None yet

2 participants