Skip to content

Commit

Permalink
include comments for hack just for Alfanum Serbian voices
Browse files Browse the repository at this point in the history
  • Loading branch information
martinbedouret committed Jun 19, 2020
1 parent 9f5a9d1 commit daaf373
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/components/Settings/Settings.container.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export class SettingsContainer extends Component {
const sLanguages = getVoicesLangs(voices);
if (sLanguages !== undefined && sLanguages.length) {
supportedLangs = sLanguages;
//hack just for Alfanum Serbian voices
//https://github.com/cboard-org/cboard/issues/715
if(supportedLangs.includes('sr-RS')){
supportedLangs.push('sr-SP');
}
Expand Down
2 changes: 2 additions & 0 deletions src/providers/SpeechProvider/SpeechProvider.container.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export class SpeechProvider extends Component {
const sLanguages = getVoicesLangs(voices);
if (sLanguages !== undefined && sLanguages.length) {
supportedLangs = sLanguages;
//hack just for Alfanum Serbian voices
//https://github.com/cboard-org/cboard/issues/715
if (supportedLangs.includes('sr-RS')) {
supportedLangs.push('sr-SP');
}
Expand Down
5 changes: 4 additions & 1 deletion src/providers/SpeechProvider/SpeechProvider.reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ function speechProviderReducer(state = initialState, action) {
};
case RECEIVE_VOICES:
const langs = [...new Set(action.voices.map(voice => voice.lang))];
//hack just for Alfanum Serbian voices
//https://github.com/cboard-org/cboard/issues/715
if (langs.includes('sr-RS')) {
langs.push('sr-SP');
}
Expand All @@ -61,7 +63,8 @@ function speechProviderReducer(state = initialState, action) {
}
};
case CHANGE_LANG:
// hack just for alfanum voice
//hack just for Alfanum Serbian voices
//https://github.com/cboard-org/cboard/issues/715
if (action.lang === 'sr-SP' || action.lang === 'sr-RS') {
const language = 'sr-RS';
return {
Expand Down

0 comments on commit daaf373

Please sign in to comment.