diff --git a/bridge_master.py b/bridge_master.py index 26e4059..91944a2 100755 --- a/bridge_master.py +++ b/bridge_master.py @@ -56,6 +56,9 @@ from mk_voice import pkt_gen #Read voices from read_ambe import readAMBE +#Remap some words for certain languages +from i8n_voice_map import voiceMap + #MySQL from mysql_config import useMYSQL @@ -441,7 +444,7 @@ def disconnectedVoice(system): _say.append(words['silence']) _say.append(words['linkedto']) _say.append(words['silence']) - _say.append(words['2']) + _say.append(words['to']) _say.append(words['silence']) _say.append(words['silence']) @@ -1514,7 +1517,7 @@ class routerHBP(HBSYSTEM): _say.append(words['silence']) _say.append(words['linkedto']) _say.append(words['silence']) - _say.append(words['2']) + _say.append(words['to']) _say.append(words['silence']) _say.append(words['silence']) @@ -1534,7 +1537,7 @@ class routerHBP(HBSYSTEM): _say.append(words['silence']) _say.append(words['linkedto']) _say.append(words['silence']) - _say.append(words['2']) + _say.append(words['to']) _say.append(words['silence']) _say.append(words['silence']) @@ -1869,8 +1872,17 @@ if __name__ == '__main__': words = AMBEobj.readfiles() logger.info('(AMBE) Read %s words into voice dict',len(words) - 1) + #Remap words for internationalisation + if CONFIG['GLOBAL']['ANNOUNCEMENT_LANGUAGE'] in voiceMap: + logger.info('(AMBE) i8n voice map entry for language %s',CONFIG['GLOBAL']['ANNOUNCEMENT_LANGUAGE']) + _map = voiceMap[CONFIG['GLOBAL']['ANNOUNCEMENT_LANGUAGE']] + for _mapword in _map: + logger.info('(AMBE) Mapping \"%s\" to \"%s\"',_mapword,_map[_mapword]) + words[_mapword] = words.pop(_map[_mapword]) + # HBlink instance creation - logger.info('(GLOBAL) HBlink \'bridge.py\' -- SYSTEM STARTING...') + logger.info('(GLOBAL) FreeDMR \'bridge_master.py\' -- SYSTEM STARTING...') + listeningPorts = {} diff --git a/i8n_voice_map.py b/i8n_voice_map.py new file mode 100644 index 0000000..f07fd33 --- /dev/null +++ b/i8n_voice_map.py @@ -0,0 +1,43 @@ +voiceMap = { + 'en_GB': { + 'to': '2', + }, + + 'en_US:': { + 'to': '2', + }, + + 'es_ES': { + 'to': 'silence' + }, + + 'fr_FR': { + 'to': 'silence' + }, + + 'de_DE': { + 'to': 'silence' + }, + + 'dk_DK': { + 'to': 'silence' + }, + + 'it_IT': { + 'to': 'silence' + }, + + 'no_NO': { + 'to': 'silence' + }, + + 'pl_PL': { + 'to': 'silence' + }, + + 'se_SE': { + 'to': 'silence' + } + +} +