Use zh-HK for Cantonese Chinese as Android does not properly support the yue language code.

This commit is contained in:
Reece H. Dunn
2013-01-16 18:27:07 +00:00
parent 920dc0ad0c
commit df1adcfcfb
2 changed files with 3 additions and 3 deletions
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2012 Reece H. Dunn
* Copyright (C) 2012-2013 Reece H. Dunn
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -200,6 +200,6 @@ public class VoiceData
new Voice("vi", "vi", "vi", "vie", "", "", "", SpeechSynthesis.GENDER_MALE, "Vietnamese", "vi", "Đây là mẫu văn bản được đọc bằng Tiếng Việt"),
new Voice("wo", "test/wo", "wo", "wol", "", "", "", SpeechSynthesis.GENDER_UNSPECIFIED, "Wolof", "wo", "This is a sample of text spoken in Wolof"),
new Voice("zh", "zh", "zh", "zho", "", "", "", SpeechSynthesis.GENDER_MALE, "Chinese (Mandarin)", "zh", "This is a sample of text spoken in 中文"),
new Voice("zh-yue", "zh-yue", "yue", "", "", "", "", SpeechSynthesis.GENDER_MALE, "Chinese (Cantonese)", "yue", "This is a sample of text spoken in 中文"),
new Voice("zh-yue", "zh-yue", "zh", "zho", "HK", "HKG", "", SpeechSynthesis.GENDER_MALE, "Chinese (Cantonese)", "zh-HK", "This is a sample of text spoken in 中文 (中華人民共和國香港特別行政區)"),
};
}
@@ -245,7 +245,7 @@ public class SpeechSynthesis {
locale = new Locale("hy", "", "arevmda");
} else if (name.equals("zh-yue")) {
// Android/Java does not support macrolanguages.
locale = new Locale("yue");
locale = new Locale("zh", "HK");
} else {
String[] parts = name.split("-");
switch (parts.length) {