def translateText(text, forlanguage): language = forlanguage lang = MTLangUtils.languageToLocale(language) if lang == '': return if not prepareDict(lang): return translatenew(text, language) return 1
def prepareDict(locale): global lang global language lang = locale #print(lang) language = MTLangUtils.localeToLanguage(locale) #print(language) if language == '': return False translationFile = exec_path + '/Test/' + 'hi-' + lang + '.voc' #print (translationFile) loadTranslationFrom(translationFile) return True
def translateLanguageJobs(atpath, forlanguage): language = forlanguage lang = MTLangUtils.languageToLocale(language) if lang == '': return if not prepareDict(lang): return langjobspath = atpath + language + '/' jobspath = langjobspath + 'todo/' jobs = listJobFolders(jobspath) print(jobs) for job in jobs: print('processing... ' + job) translateAllFiles(job, langjobspath)
def mapTranslate(word, language): if language == 'Marathi': return word #if language=='Punjabi': # return mapTranslatePun(word,language) return MTLangUtils.mapHindiString(word, language)