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
ooni-wui 2.2.0-rc.1 #37
Conversation
* Now the uber boring part of replacing every single string with `FormattedMessage` 😱
* Fixes to NDT * Fixes to WebConnectivity
…P Header Field Manipulation
Added support for translations
My contributions to #30
* agrabeli/feature/intl: Added support for translation of WhatsApp test
* Lint code
* src/components/Deck/Deck.js * src/components/Deck/DeckContainer.js * src/components/Notification/Notification.js * src/components/Settings/SharingOptions.js * src/routes/Dashboard/components/Dashboard.js
… feature/intl * 'feature/intl' of github.com:TheTorProject/ooni-wui: s/defaultValue/defaultMessage/orry Make sure also Headers.js is i18n ready
Gotcha: JSX interprets strings in arguments (such as defaultMessage='foo') as HTML strings and not as javascript strings. This means that \n is not a valid HTML string and hence we need to wrap it them in {'foo'} to make them work properly.
* Better responsiveness in navbar
Feature/intl
"onboard.welcome.learnMore": "Learn more", | ||
"onboard.welcome.alreadyUnderstand": "I already understand the risks, take me to my dashboard.", | ||
"settings.title": "Settings" | ||
} |
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.
Given that the default is already English, isn't this duplicating strings?
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.
This is actually the master translation file from which all the other translations are built.
This file is the one that I upload to transifex for translations and that people use for translating.
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.
What is the purpose of defaultMessage='foo'
then?
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.
Specifying the content inline. This file here is generated from the <FormatMessages>
by means of the bin/translate.js
script.
In theory I could also not commit this file and it would still work, however it's best to commit it so that we can setup transifex to pull in translations automatically from the source code.
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.
Ah, got it! I was wondering it was a duplicate (hence, maintenance effort)
src/util/language.js
Outdated
@@ -0,0 +1,3 @@ | |||
export const getLanguage = () => { | |||
return navigator.language | |||
} |
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.
Is this function used? It seems I cannot find it elsewhere in the diff
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.
Ah, good call I missed removing this in a refactor.
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.
Overall looks good except for a couple of things that I asked for inline
…ui into release/v2.2.0-rc.1 * 'release/v2.2.0-rc.1' of github.com:TheTorProject/ooni-wui: npm run lint:fix
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.
🐰 (i.e. "follow the white rabbit")
Merging! |
I am going to use this branch to stage the changes for ooni-wui 2.2.0-rc.1