Skip to content

Commit

Permalink
Merge pull request #689 from cboard-org/hotfix-me
Browse files Browse the repository at this point in the history
Fix that Montenegrin is showed under Serbian language
  • Loading branch information
martinbedouret authored Apr 28, 2020
2 parents 138b4fb + 1fa80a5 commit 84eb8a0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/components/Settings/Language/Language.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ const Language = ({
>
<ListItemText
primary={
locale !== 'me'
lang !== 'sr-ME'
? `${ISO6391.getNativeName(locale)} ${langCode}`
: `crnogorski jezik ${langCode}`
: `Crnogorski jezik`
}
secondary={<FormattedMessage {...messages[locale]} />}
/>
Expand Down
13 changes: 9 additions & 4 deletions src/components/Settings/Speech/Speech.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ const styles = theme => ({
}
});

const getVoiceLabel = voice => {
if (voice.name === 'srpski Crna Gora') {
return voice.voiceURI;
}
return isCordova() ? voice.name + ' - ' + voice.voiceURI : voice.name;
};

const Speech = ({
anchorEl,
classes,
Expand Down Expand Up @@ -65,9 +72,7 @@ const Speech = ({
>
<ListItemText
primary={<FormattedMessage {...messages.voice} />}
secondary={
isCordova() ? voice.name + ' - ' + voice.voiceURI : voice.name
}
secondary={getVoiceLabel(voice)}
/>
</ListItem>
<ListItem divider aria-label={intl.formatMessage(messages.pitch)}>
Expand Down Expand Up @@ -116,7 +121,7 @@ const Speech = ({
selected={index === selectedVoiceIndex}
onClick={() => handleMenuItemClick(voice, index)}
>
{isCordova() ? voice.name + ' - ' + voice.voiceURI : voice.name}
{getVoiceLabel(voice)}
</MenuItem>
))}
</Menu>
Expand Down
2 changes: 1 addition & 1 deletion src/translations/sr-ME.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
"cboard.components.Settings.Language.russian": "Ruski",
"cboard.components.Settings.Language.sinhala": "cejlonski",
"cboard.components.Settings.Language.slovak": "Slovački",
"cboard.components.Settings.Language.serbian": "Srpski Crna Gora",
"cboard.components.Settings.Language.serbian": "Crnogorski jezik",
"cboard.components.Settings.Language.swedish": "Švedski",
"cboard.components.Settings.Language.thai": "tajlandski",
"cboard.components.Settings.Language.turkish": "Turski",
Expand Down
2 changes: 1 addition & 1 deletion src/translations/sr-RS.json
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@
"cboard.components.Settings.Language.russian": "ruski",
"cboard.components.Settings.Language.sinhala": "Sinhala",
"cboard.components.Settings.Language.slovak": "slovački",
"cboard.components.Settings.Language.serbian": "srpski Srbija",
"cboard.components.Settings.Language.serbian": "Srpski jezik",
"cboard.components.Settings.Language.swedish": "švedski",
"cboard.components.Settings.Language.thai": "tajlandski",
"cboard.components.Settings.Language.turkish": "turski",
Expand Down

0 comments on commit 84eb8a0

Please sign in to comment.