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
fix(i18n): add i18next keys for ShowProjectLinks #41239
fix(i18n): add i18next keys for ShowProjectLinks #41239
Conversation
I believe these title are already translated in the challenge files - probably be pretty tough to pull them from there though. I guess they should get translated automatically by crowdin I think, since the strings will match what has already been translated. Just thinking out loud here. |
That's definitely how it should be done. Then there would be no need to use @RandellDawson how much extra work are we generating by temporarily changing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @errmayank nice work on this PR. I have a few suggestions on how it could be simplified slightly:
eeaff05
to
f40c6fa
Compare
@ojeytonwilliams Thanks for the help! I've made the necessary changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @errmayank thanks again for your hard work on this.
As well as the suggestions below, could you revert the changes to /chinese/translations.json
and /espanol/translations.json
? We just changed our approach so we default to English #41246 which means we're better off leaving those files alone and relying on the defaults.
@ojeytonwilliams cool! just to make sure, I should keep |
@ojeytonwilliams weird but after changing the footnote to what you suggested and adding those default values, the text does not render properly |
Here's how I was able to make this work by using fragments "footnote": "If you suspect that any of these projects violate the <1>academic honesty policy</1>, please <3>report this to our team</3>." <Trans i18nKey='certification.project.footnote'>
<>If you suspect that any of these projects violate the </>
<a
href='https://www.freecodecamp.org/news/academic-honesty-policy/'
target='_blank'
rel='noreferrer'
>
academic honesty policy
</a>
<>, please </>
<a
href={`/user/${username}/report-user`}
target='_blank'
rel='noreferrer'
>
report this to our team
</a>
<>.</>
</Trans> |
Yes, that's exactly right, thanks.
Nice job getting that to work, but we can get away without using fragments here. The trick is to find the correct numbers for the translation string and that's explained here. Long story short: we have to look at the |
I've updated my suggestion - if that doesn't work for you, just let me know and I'll make 100% it works locally and push a commit! |
@ojeytonwilliams great! the updated replacement tags that you suggested is working, I've pushed my changes. |
The Lint Source Files test failed due to missing keys in chinese and espanol |
@ojeytonwilliams I thought we had changed it so we no longer have to add the non-English keys. Instead, the fallback was English and then when the English source file gets uploaded to Crowdin gets uploaded, the file would get the English version at first until translated/approved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RandellDawson so did I, but it looks like we just agreed that that was the plan.
@errmayank thanks again for bearing with us on this. As far as I'm concerned this PR is done, so I'll take care of the validation problem myself and rebase this PR once that's complete.
@raisedadead Can you confirm that we still want to have to add changes to the non-English files for |
English is currently set to be the fallback value - if we choose to go this direction, I can disable the linting specifically for the |
Yes - @nhcarrigan you can go ahead and remove the linting. Maybe we can downgrade that to a warning or something just as an FYI, but it should not throw. |
I guess instead of |
ef5583b
to
79d1cca
Compare
GitHub actions are currently down, so we may need to restart them once that is resolved. |
Looks to be resolved now, according to their status page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
@errmayank Congrats on your first pull request (PR)! 🎉 Thank you for your contribution to the page! 👍 |
Checklist:
Update index.md
)main
branch of freeCodeCamp.Closes #41155
translation.json
file for Chinese and Spanish uses English values for now.translations.json
, certification => project => title => 'Project Title' to translate project titles let me know if there's a better way to do this.ShowProjectLinks.js
I've used thet
function to translate simple texts and for more complex (nested) cases I've used the<Trans />
component.