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

Wrap all text in i18next functions #1087

Merged
merged 14 commits into from
Nov 18, 2021
Merged

Wrap all text in i18next functions #1087

merged 14 commits into from
Nov 18, 2021

Conversation

St3phy831
Copy link
Contributor

I was able to wrap all the hard-coded text using the i18next functions along with my teammates @odiaz95012 and @ramy-meng. We also added the keys to the different language json files so they can be translated.

Closes #647

@haidang666
Copy link
Collaborator

Thanks for your contributions. Since we use Crowdin for managing translation, you don't need to update keys in all language files only need to change in en.json. Can you use please remove those changes?

@odiaz95012
Copy link
Contributor

odiaz95012 commented Nov 8, 2021 via email

@nukeop
Copy link
Owner

nukeop commented Nov 8, 2021

Great, thank you, and thanks for setting this straight.

@nukeop
Copy link
Owner

nukeop commented Nov 8, 2021

All you have to do is just revert all files in i18n that are not en.json.

@odiaz95012
Copy link
Contributor

odiaz95012 commented Nov 8, 2021 via email

Deleted added keys from all language JSON files except en.json for nukeop#647
@odiaz95012
Copy link
Contributor

My team and I reverted all language JSON files back to what they were except for en.json.

@haidang666
Copy link
Collaborator

You have to update snapshot test to make the CI pass.
image

@ramy-meng
Copy link
Contributor

Hi, I am one of the members who is working on this pull request. All of us are beginner coders, could you further explain what do you mean by updating the snapshot test to make the CI pass?

@haidang666
Copy link
Collaborator

There is a test to ensure UI render as expected, it's called snapshot testing. When there is a modify in UI the test will fail cos it compares with the previous UI. About CI, one of its jobs in nuclear is checking all tests pass in PR. In short, you need to run the test with '--updateSnapshot' key.

@nukeop
Copy link
Owner

nukeop commented Nov 12, 2021

After you run npm test -- -u, you have to commit and push all the changes in existing snapshots (.snap files).

@odiaz95012
Copy link
Contributor

After you run npm test -- -u, you have to commit and push all the changes in existing snapshots (.snap files).

Every time I run 'npm test -- -u' I get the error "ERR! lerna Unknown argument: u". Do I need to install something to make this work?

@nukeop
Copy link
Owner

nukeop commented Nov 13, 2021

Try going to packages/app first, the -u flag needs to be applied to jest instead of lerna.

@ramy-meng
Copy link
Contributor

Screen Shot 2021-11-15 at 10 40 07 PM
Thank you everyone for your guidance. It seemed like I have updated the snapshot. Please help me verify one last time before I commit and push my branch.

@haidang666
Copy link
Collaborator

Nice work, one last thing that revert change in other language file

@ramy-meng
Copy link
Contributor

My teammate @odiaz95012 seemed to have reverted all changes in other language files. Is there any part that we have left out?

@haidang666
Copy link
Collaborator

My teammate @odiaz95012 seemed to have reverted all changes in other language files. Is there any part that we have left out?

Did your friend push the commit, those changes still in PR. You can see in the file changes tab

@odiaz95012
Copy link
Contributor

My teammate @odiaz95012 seemed to have reverted all changes in other language files. Is there any part that we have left out?

Did your friend push the commit, those changes still in PR. You can see in the file changes tab

Yes, I pushed the changes where I got rid off all the keys we added from all language files except en.json.

@haidang666
Copy link
Collaborator

haidang666 commented Nov 16, 2021

I got it, there was a change on last line in other files but I think it OK to skip.
image

@nukeop
Copy link
Owner

nukeop commented Nov 16, 2021

The whitespace changes are fine, but it looks like snapshots do not pass, I'll check it out later today.

@ramy-meng
Copy link
Contributor

Oh, no. Was it because of my snapshot? Please feel free to let us know whatever needed to be fixed.

@nukeop
Copy link
Owner

nukeop commented Nov 18, 2021

It's because the test setup for settings doesn't have internationalization enabled (since the strings were hardcoded up until now), I'm fixing this now.

@codecov
Copy link

codecov bot commented Nov 18, 2021

Codecov Report

Merging #1087 (94b8966) into master (4a807e1) will decrease coverage by 0.00%.
The diff coverage is 37.50%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1087      +/-   ##
==========================================
- Coverage   61.39%   61.38%   -0.01%     
==========================================
  Files         280      280              
  Lines        5082     5089       +7     
  Branches      359      361       +2     
==========================================
+ Hits         3120     3124       +4     
- Misses       1658     1660       +2     
- Partials      304      305       +1     
Impacted Files Coverage Δ
.../app/components/Downloads/DownloadsHeader/index.js 70.58% <ø> (ø)
packages/app/app/components/HelpModal/index.tsx 100.00% <ø> (ø)
packages/app/app/components/SearchResults/index.js 52.27% <ø> (ø)
packages/app/app/components/Settings/index.tsx 78.12% <ø> (ø)
packages/app/app/reducers/equalizer.js 51.21% <ø> (ø)
...es/app/app/components/EqualizerPresetList/index.js 69.23% <33.33%> (-3.50%) ⬇️
...app/app/containers/EqualizerViewContainer/index.js 54.54% <50.00%> (-0.46%) ⬇️
packages/app/app/components/PlayQueue/index.js 52.83% <0.00%> (ø)
packages/ui/lib/components/PlayerBar/index.tsx 100.00% <0.00%> (ø)
packages/ui/lib/utils.ts 44.82% <0.00%> (+0.38%) ⬆️

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 4a807e1...94b8966. Read the comment docs.

@nukeop nukeop merged commit 86a66ab into nukeop:master Nov 18, 2021
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.

Wrap all text in i18next functions
5 participants