-
Notifications
You must be signed in to change notification settings - Fork 60
Find all strings for i18n - Closes #557 #759
Conversation
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.
Thanks, @yasharAyari .
Please see some comments below.
Also, there should be an e2e test for switching language.
@@ -21,7 +22,7 @@ class ForgingTitle extends React.Component { | |||
{this.props.account.delegate.username} | |||
</h2> | |||
<span> | |||
<LiskAmount val={this.props.statistics.total} roundTo={2} /> LSK Earned | |||
<LiskAmount val={this.props.statistics.total} roundTo={2} /> LSK {this.props.t('Earned')} |
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.
LSK
should be part of the translated string {this.props.t('LSK Earned')
because other languages can have a different word order.
src/components/header/header.js
Outdated
className='verify-message' | ||
onClick={() => props.setActiveDialog({ | ||
title: 'Verify message', | ||
title: props.t('verify-message'), |
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 key should be the same as the one two lines ago - 'Verify message'
src/components/header/header.js
Outdated
<IconMenu | ||
className={`${styles.iconButton} ${offlineStyle.disableWhenOffline}`} | ||
icon='language' position='topRight'> | ||
<MenuItem caption='english' onClick={() => i18n.changeLanguage('en')} /> |
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.
The first letter of caption should be capitalized caption='English'
src/components/header/header.js
Outdated
className={`${styles.iconButton} ${offlineStyle.disableWhenOffline}`} | ||
icon='language' position='topRight'> | ||
<MenuItem caption='english' onClick={() => i18n.changeLanguage('en')} /> | ||
<MenuItem caption='deutsch' onClick={() => i18n.changeLanguage('de')} /> |
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.
The first letter of caption should be capitalized caption='Deutsch'
src/locales/en/common.json
Outdated
@@ -1,4 +1,49 @@ | |||
{ | |||
"send": "send", |
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.
S in send should be capitalized: "send": "Send",
It's the same on the button, but different as the send modal title.
<span className='title'> | ||
{ cardObj.label === 'Last 24 hours' ? | ||
this.props.t(cardObj.label) : | ||
this.props.t('Last x days', { day: cardObj.label }) } |
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 condition is ugly and hacky. I would move the definition of statCardObjects
inside ForgingStats.render
so that it can use this.props.t
and here the code can stay the way it was.
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.
The key should be Last {{day}} days
for better readability. Or maybe Last {{count}} days
as well as the value.
src/components/header/header.js
Outdated
@@ -64,6 +65,12 @@ const Header = props => ( | |||
title: props.t('send'), | |||
childComponent: Send, | |||
})}>{props.t('send')}</Button> | |||
<IconMenu | |||
className={`${styles.iconButton} ${offlineStyle.disableWhenOffline}`} | |||
icon='language' position='topRight'> |
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.
The IconMenu
can use selectable
and selected
properties to indicate selected language.
http://react-toolbox.com/#/components/menu
I we already spent too much time trying to fix it
Closes #557