[dasher: 186/217] Removed language code element from alphabet. Now it should be defined as attribute of enclosing alph
- From: Patrick Welche <pwelche src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dasher: 186/217] Removed language code element from alphabet. Now it should be defined as attribute of enclosing alph
- Date: Sat, 27 Feb 2016 12:15:57 +0000 (UTC)
commit b8c810c4db5952700562d6048e97c9b7c0eecb84
Author: Ada Majorek <amajorek google com>
Date: Sat Jan 23 12:51:38 2016 -0800
Removed language code element from alphabet. Now it should be defined as attribute of enclosing alphabets
tag.
https://github.com/ipomoena/dasher/issues/63
Data/alphabets/alphabet.dtd | 7 +++++--
Src/DasherCore/Alphabet/AlphIO.cpp | 13 +++----------
Src/DasherCore/Alphabet/AlphIO.h | 2 +-
3 files changed, 9 insertions(+), 13 deletions(-)
---
diff --git a/Data/alphabets/alphabet.dtd b/Data/alphabets/alphabet.dtd
index 70b24a4..bbc9ec2 100644
--- a/Data/alphabets/alphabet.dtd
+++ b/Data/alphabets/alphabet.dtd
@@ -3,9 +3,12 @@ along with some useful information. It does nothing to tell Dasher,
how those symbols may be used. -->
<!ELEMENT alphabets (alphabet*)>
-<!ATTLIST alphabets langcode CDATA #IMPLIED>
+<!--langcode Makes it possible to generate speech in language other
+than system default. Enables bilingual use of dasher.
+For alphabets without spoken language i. e. musical symbols, make it empty string. -->
+<!ATTLIST alphabets langcode CDATA #REQUIRED>
-<!ELEMENT alphabet (orientation, encoding, palette, train, langcode?, paragraph,
+<!ELEMENT alphabet (orientation, encoding, palette, train, paragraph,
space, control, conversionmode?, group*)>
<!ATTLIST alphabet name CDATA #REQUIRED>
diff --git a/Src/DasherCore/Alphabet/AlphIO.cpp b/Src/DasherCore/Alphabet/AlphIO.cpp
index 56e7afb..6e3757c 100644
--- a/Src/DasherCore/Alphabet/AlphIO.cpp
+++ b/Src/DasherCore/Alphabet/AlphIO.cpp
@@ -163,7 +163,7 @@ void CAlphIO::XmlStartHandler(const XML_Char *name, const XML_Char **atts) {
if (strcmp(name, "alphabets") == 0) {
while(*atts != 0) {
if(strcmp(*atts, "langcode") == 0) {
- DefaultLanguageCode = *(atts+1);
+ LanguageCode = *(atts+1);
}
atts += 2;
}
@@ -373,7 +373,7 @@ void Reverse(SGroupInfo *&pList) {
void CAlphIO::XmlEndHandler(const XML_Char *name) {
if (strcmp(name, "alphabets") == 0) {
- DefaultLanguageCode = "";
+ LanguageCode = "";
}
if(strcmp(name, "alphabet") == 0) {
@@ -392,9 +392,7 @@ void CAlphIO::XmlEndHandler(const XML_Char *name) {
delete SpaceCharacter;
}
- if (InputInfo->LanguageCode.empty()) {
- InputInfo->LanguageCode = DefaultLanguageCode;
- }
+ InputInfo->LanguageCode = LanguageCode;
InputInfo->iEnd = InputInfo->m_vCharacters.size()+1;
@@ -409,11 +407,6 @@ void CAlphIO::XmlEndHandler(const XML_Char *name) {
return;
}
- if(strcmp(name, "langcode") == 0) {
- InputInfo->LanguageCode = CData;
- return;
- }
-
if(strcmp(name, "gamemode") == 0) {
InputInfo->GameModeFile = CData;
return;
diff --git a/Src/DasherCore/Alphabet/AlphIO.h b/Src/DasherCore/Alphabet/AlphIO.h
index 0822182..4e4ee00 100644
--- a/Src/DasherCore/Alphabet/AlphIO.h
+++ b/Src/DasherCore/Alphabet/AlphIO.h
@@ -77,7 +77,7 @@ private:
std::string CData; // Text gathered from when an elemnt starts to when it ends
CAlphInfo *InputInfo;
int iGroupIdx;
- std::string DefaultLanguageCode;
+ std::string LanguageCode;
void XmlStartHandler(const XML_Char * name, const XML_Char ** atts);
void XmlEndHandler(const XML_Char * name);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]