Skip to content

Commit

Permalink
Merge pull request #687 from cboard-org/support-alfanum-sr-ME
Browse files Browse the repository at this point in the history
Support for the new montenegrin  TTS from Alfanum
  • Loading branch information
martinbedouret authored Apr 23, 2020
2 parents 3ef3fd5 + b0fcfd5 commit 138b4fb
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 40 deletions.
2 changes: 1 addition & 1 deletion src/components/App/App.constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export const APP_LANGS = [
'ja-JP',
'km-KH',
'ko-KR',
'me-ME',
'ne-NP',
'nl-NL',
'no-NO',
Expand All @@ -42,6 +41,7 @@ export const APP_LANGS = [
'ru-RU',
'si-LK',
'sk-SK',
'sr-ME',
'sr-SP',
'sr-RS',
'sv-SE',
Expand Down
5 changes: 0 additions & 5 deletions src/components/Settings/Settings.container.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ export class SettingsContainer extends Component {
supportedLangs = sLanguages;
}
}
// hack just for alfanum voice
if (supportedLangs.length === 1 && supportedLangs[0] === 'sr-RS') {
supportedLangs.push('hr-HR');
supportedLangs.push('me-ME');
}
setLangs(supportedLangs);
}
});
Expand Down
7 changes: 0 additions & 7 deletions src/providers/SpeechProvider/SpeechProvider.container.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ export class SpeechProvider extends Component {
supportedLangs = sLanguages;
}
}
// hack just for alfanum voice
if (
supportedLangs.length &&
(supportedLangs.includes('sr-RS') || supportedLangs.includes('sr-ME'))
) {
supportedLangs.push('me-ME');
}
const lang = supportedLangs.includes(propsLang)
? propsLang
: this.getDefaultLang(supportedLangs);
Expand Down
33 changes: 8 additions & 25 deletions src/providers/SpeechProvider/SpeechProvider.reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,31 +57,14 @@ function speechProviderReducer(state = initialState, action) {
}
};
case CHANGE_LANG:
// hack just for alfanum voice
if (
action.lang === 'sr-RS' ||
action.lang === 'sr-ME' ||
action.lang === 'me-ME'
) {
return {
...state,
options: {
...state.options,
lang: action.lang,
voiceURI: getVoiceURI(action.lang, state.voices)
},
langs: ['me-ME', 'sr-ME', 'sr-RS']
};
} else {
return {
...state,
options: {
...state.options,
lang: action.lang,
voiceURI: getVoiceURI(action.lang, state.voices)
}
};
}
return {
...state,
options: {
...state.options,
lang: action.lang,
voiceURI: getVoiceURI(action.lang, state.voices)
}
};
case CHANGE_PITCH:
return { ...state, options: { ...state.options, pitch: action.pitch } };
case CHANGE_RATE:
Expand Down
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",
"cboard.components.Settings.Language.serbian": "Srpski Crna Gora",
"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",
"cboard.components.Settings.Language.serbian": "srpski Srbija",
"cboard.components.Settings.Language.swedish": "švedski",
"cboard.components.Settings.Language.thai": "tajlandski",
"cboard.components.Settings.Language.turkish": "turski",
Expand Down

0 comments on commit 138b4fb

Please sign in to comment.