Skip to content
This repository has been archived by the owner on Sep 19, 2021. It is now read-only.

[WIP] Deprecate src/config/locales/i18n.js #1876

Closed
wants to merge 1 commit into from

Conversation

christopherhuii
Copy link
Contributor

@christopherhuii christopherhuii commented Sep 25, 2019

Description

This PR deprecates the homegrown implementation if i18n located in src/config/locales/i18n.js. Instead of the homegrown version, we have started replacing it with open source software. This new implementation is initialized in src/util/i18n.js.

Migrating all i18n imports to util/i18n has started, but has not fully deprecated the old method.

WIP

99% of instances have been committed, but there is still one outstanding area that needs to be visited. src/components/Form/Field/Field.jsx still uses the old i18n import. It's not as straight forward because it appears the error adds additional markup that should not be present.

The new i18n method also doesn't like the fact that there are missing keys in the locale files. If there's a missing key, it will display the unreadable i18n key. The easy, but tedious way to alleviate this is to ensure that all keys are in the locale files, but it's not sustainable in the long run. Be sure to click through the application, trigger validations/errors, in order to find all the missing keys.

It breaks snapshots and should be reviewed a little more closely before deprecating src/config/locales/i18n.js

Checklist for Reviewer

  • Review code changes
  • Review changes for Database effects
  • Verify change works in IE browser

More details about this can be found in docs/review.md

@codecov
Copy link

codecov bot commented Sep 25, 2019

Codecov Report

Merging #1876 into develop will decrease coverage by 0.05%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1876      +/-   ##
===========================================
- Coverage    86.14%   86.09%   -0.05%     
===========================================
  Files          899      899              
  Lines        20569    20569              
  Branches      3155     3157       +2     
===========================================
- Hits         17718    17708      -10     
- Misses        2173     2181       +8     
- Partials       678      680       +2
Flag Coverage Δ
#backend 83.21% <ø> (ø) ⬆️
#frontend 87.42% <100%> (-0.07%) ⬇️
Impacted Files Coverage Δ
.../Section/Legal/Associations/EngagedInTerrorism.jsx 91.67% <ø> (ø) ⬆️
src/components/Form/Location/Location.jsx 65.47% <ø> (ø) ⬆️
src/views/AccessDenied/AccessDenied.jsx 100% <ø> (ø) ⬆️
...onents/Section/Citizenship/Multiple/TravelItem.jsx 100% <ø> (ø) ⬆️
src/components/Form/EyeColor/EyeColor.jsx 100% <ø> (ø) ⬆️
...nents/Section/History/Employment/ReprimandItem.jsx 90% <ø> (ø) ⬆️
src/components/Form/Spinner/Spinner.jsx 100% <ø> (ø) ⬆️
...nents/Section/Foreign/Contacts/ForeignNational.jsx 65.71% <ø> (ø) ⬆️
.../Section/History/Employment/EmploymentActivity.jsx 100% <ø> (ø) ⬆️
...ts/Section/Legal/Investigations/ClearanceLevel.jsx 84.62% <ø> (ø) ⬆️
... and 193 more

Continue to review full report at Codecov.

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

@ryanhofdotgov
Copy link
Contributor

Replaced with PR #1886 – not quite ready to say I'll never look into this yet.

@ryanhofdotgov ryanhofdotgov deleted the ch-deprecate-old-i18n branch December 18, 2019 15:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants