From daaf37325bed44786c562e5bf276ad1cd3679392 Mon Sep 17 00:00:00 2001 From: martin bedouret Date: Fri, 19 Jun 2020 18:18:21 -0300 Subject: [PATCH] include comments for hack just for Alfanum Serbian voices --- src/components/Settings/Settings.container.js | 2 ++ src/providers/SpeechProvider/SpeechProvider.container.js | 2 ++ src/providers/SpeechProvider/SpeechProvider.reducer.js | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/Settings/Settings.container.js b/src/components/Settings/Settings.container.js index 3ec4f27ef..006dd4f4b 100644 --- a/src/components/Settings/Settings.container.js +++ b/src/components/Settings/Settings.container.js @@ -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'); } diff --git a/src/providers/SpeechProvider/SpeechProvider.container.js b/src/providers/SpeechProvider/SpeechProvider.container.js index addb3e6ed..2c54d36f2 100644 --- a/src/providers/SpeechProvider/SpeechProvider.container.js +++ b/src/providers/SpeechProvider/SpeechProvider.container.js @@ -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'); } diff --git a/src/providers/SpeechProvider/SpeechProvider.reducer.js b/src/providers/SpeechProvider/SpeechProvider.reducer.js index 2949b396b..2c98afb14 100644 --- a/src/providers/SpeechProvider/SpeechProvider.reducer.js +++ b/src/providers/SpeechProvider/SpeechProvider.reducer.js @@ -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'); } @@ -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 {