Added Hungarian fomal and added a fix for language locale

This commit is contained in:
PaulStets 2018-08-15 16:30:50 +03:00
parent 4a2cdcaaeb
commit 55b8958690
2 changed files with 3 additions and 3 deletions

View file

@ -60,9 +60,9 @@
<asset source="voice/fr/fr_tts.js" destination="voice/fr-tts/fr_tts.js" mode="alwaysOverwriteOrCopy" />
<!--<asset source="voice/he/he_tts.js" destination="voice/he-tts/he_tts.js" mode="overwriteOnlyIfExists" />-->
<asset source="voice/hi/hi_tts.js" destination="voice/hi-tts/hi_tts.js" mode="overwriteOnlyIfExists" />
<!--<asset source="voice/hr/hr_tts.js" destination="voice/hr-tts/hr_tts.js" mode="overwriteOnlyIfExists" />-->
<asset source="voice/hr/hr_tts.js" destination="voice/hr-tts/hr_tts.js" mode="overwriteOnlyIfExists" />
<asset source="voice/hu/hu_tts.js" destination="voice/hu-tts/hu_tts.js" mode="overwriteOnlyIfExists" />
<!--<asset source="voice/hu-formal/hu-formal_tts.js" destination="voice/hu_formal-tts/hu-formal_tts.js" mode="overwriteOnlyIfExists" />-->
<asset source="voice/hu-formal/hu-formal_tts.js" destination="voice/hu_formal-tts/hu-formal_tts.js" mode="overwriteOnlyIfExists" />
<asset source="voice/it/it_tts.js" destination="voice/it-tts/it_tts.js" mode="alwaysOverwriteOrCopy" />
<asset source="voice/ja/ja_tts.js" destination="voice/ja-tts/ja_tts.js" mode="alwaysOverwriteOrCopy" />
<!--<asset source="voice/ko/ko_tts.js" destination="voice/ko-tts/ko_tts.js" mode="overwriteOnlyIfExists" />-->

View file

@ -120,7 +120,7 @@ public class JSTTSCommandPlayerImpl extends AbstractJSCommandPlayer {
ttsRequests = 0;
final float speechRate = cSpeechRate;
final String[] lsplit = (language + "____.").split("[_\\-]");
final String[] lsplit = (language.replaceAll("_formal", "") + "____.").split("[_\\-]");
// constructor supports lang_country_variant
Locale newLocale0 = new Locale(lsplit[0], lsplit[1], lsplit[2]);
// #3344: Try Locale builder instead of constructor (only available from API 21). Also supports script (for now supported as trailing x_x_x_Scrp)