Skip to content

Integrate localized strings into web and desktop app#2730

Merged
skapur12 merged 27 commits intomainfrom
dpwatrous/fake-localizer
Aug 1, 2023
Merged

Integrate localized strings into web and desktop app#2730
skapur12 merged 27 commits intomainfrom
dpwatrous/fake-localizer

Conversation

@skapur12
Copy link
Member

@skapur12 skapur12 commented May 9, 2023

  • Add localization support to web package
  • Add a 'Merge Translations' node script to merge the shared libraries with web and desktop-specific translations and place them in web and desktop folders, respectively. It runs on every build
  • Switch Electron app to use new localized strings
  • Rename StandardLocalizer to BrowserLocalizer, and add error handling to BrowserLocalizer to fetch the appropriate file based on the locale in the user's browser
  • Add global build-translations command to package.json
  • Update README with instructions on setting up localization environment on dev box

@skapur12 skapur12 force-pushed the dpwatrous/fake-localizer branch 2 times, most recently from d12b0e8 to 0a964cd Compare May 9, 2023 23:27
@codecov
Copy link

codecov bot commented May 10, 2023

Codecov Report

Merging #2730 (8b77e9c) into main (5621efd) will increase coverage by 0.00%.
The diff coverage is 75.92%.

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

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2730   +/-   ##
=======================================
  Coverage   66.41%   66.42%           
=======================================
  Files        1200     1201    +1     
  Lines       33430    33463   +33     
  Branches     6153     6161    +8     
=======================================
+ Hits        22202    22227   +25     
- Misses      11092    11101    +9     
+ Partials      136      135    -1     
Files Changed Coverage Δ
...eact/src/ui-react/account/create-account-action.ts 92.72% <ø> (ø)
...react/src/ui-react/components/form/action-form.tsx 72.91% <ø> (ø)
...ommon/src/ui-common/localization/http-localizer.ts 68.96% <68.96%> (ø)
...ommon/src/ui-common/localization/fake-localizer.ts 73.33% <73.33%> (ø)
...re/i18n/client-translations-loader.service.spec.ts 100.00% <100.00%> (ø)
...nt/core/i18n/client-translations-loader.service.ts 85.71% <100.00%> (-0.40%) ⬇️
...mmon/src/ui-common/environment/mock-environment.ts 96.55% <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 5621efd...cc8f35d. Read the comment docs.

@skapur12 skapur12 force-pushed the dpwatrous/fake-localizer branch 2 times, most recently from ce5b397 to dbdd483 Compare May 17, 2023 18:38
@skapur12 skapur12 force-pushed the dpwatrous/fake-localizer branch 2 times, most recently from b916476 to e292e0d Compare May 23, 2023 17:49
@skapur12 skapur12 force-pushed the dpwatrous/fake-localizer branch 3 times, most recently from 30b4245 to fbb8786 Compare June 4, 2023 22:45
@skapur12 skapur12 requested a review from wanghoppe as a code owner June 20, 2023 11:32
@skapur12 skapur12 force-pushed the dpwatrous/fake-localizer branch from 8044495 to c40c07b Compare June 20, 2023 16:55
@skapur12 skapur12 force-pushed the dpwatrous/fake-localizer branch from 9ebe7ca to 23cfc1e Compare June 30, 2023 13:31
@skapur12 skapur12 force-pushed the dpwatrous/fake-localizer branch from 23cfc1e to c8823c8 Compare July 17, 2023 06:26
@dpwatrous dpwatrous self-requested a review July 31, 2023 20:20
Copy link
Member

@dpwatrous dpwatrous left a comment

Choose a reason for hiding this comment

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

The changes look good to me. I'm just going to block this until we've got a portal PR ready since it contains breaking changes.

@skapur12 skapur12 force-pushed the dpwatrous/fake-localizer branch from 265821e to cc8f35d Compare July 31, 2023 20:35
@dpwatrous dpwatrous self-requested a review August 1, 2023 13:01
@skapur12 skapur12 merged commit 1aecc3b into main Aug 1, 2023
@skapur12 skapur12 deleted the dpwatrous/fake-localizer branch August 1, 2023 16:49
gingi pushed a commit that referenced this pull request Nov 9, 2023
* Added fake localizer

* Switch desktop app to use new translations

* Add script to combine translated files by language

* Add global build-translations command

* Update comments and docs accordingly with changes

* Run merge-translations script on Azure DevOps path

* Add localization for Batch Explorer web version

* Generate translations for Create Account buttons

* Add basic i18n support for web package

* Rename StandardLocalizer to BrowserLocalizer

* Add merge translations script for web and desktop

* Remove powershell merge translations script

* Add localization support for desktop app

* Copy translations to web too and not just desktop

* Add translations for playground buttons

* Gitignore generated localization files

* Update localization docs with setup instructions

* Add package translations to mergeTranslations

* Optimize package file creation and fix unit test

* Update Electron app localization unit tests

* Address all feedback on PR

* Fix desktop localizer, translation function, tests

* Fix Prettier issue with account yml file

* Update client translations unit test accordingly

* Add http-localizer unit test and minor fixes

* Remove CustomGlobal and simplify navigator object

* Add getLocale function to each localizer

---------

Co-authored-by: David Watrous <[email protected]>
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