Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions mstranslator.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,30 +107,30 @@ def _translate(self, action, text_params, lang_from, lang_to, contenttype, categ
return self.make_request(action, params)

def translate(self, text, lang_from=None, lang_to=None,
contenttype='text/plain', category='general'):
contenttype='text/plain', category='generalnn'):
params = {
'text': text,
}
return self._translate('Translate', params, lang_from, lang_to,
contenttype, category)

def translate_array(self, texts=[], lang_from=None, lang_to=None,
contenttype='text/plain', category='general'):
contenttype='text/plain', category='generalnn'):
params = {
'texts': json.dumps(texts),
}
return self._translate('TranslateArray', params, lang_from, lang_to,
contenttype, category)

def translate_array2(self, texts=[], lang_from=None, lang_to=None,
contenttype='text/plain', category='general'):
contenttype='text/plain', category='generalnn'):
params = {
'texts': json.dumps(texts),
}
return self._translate('TranslateArray2', params, lang_from, lang_to,
contenttype, category)

def get_translations(self, text, lang_from, lang_to, max_n=10, contenttype='text/plain', category='general',
def get_translations(self, text, lang_from, lang_to, max_n=10, contenttype='text/plain', category='generalnn',
url=None, user=None, state=None):
options = {
'Category': category,
Expand Down Expand Up @@ -169,7 +169,7 @@ def break_sentences(self, text, lang):
return result

def add_translation(self, text_orig, text_trans, lang_from, lang_to, user, rating=1,
contenttype='text/plain', category='general', url=None):
contenttype='text/plain', category='generalnn', url=None):
if len(text_orig) > 1000:
raise ValueError('The original text maximum length is 1000 characters')
if len(text_trans) > 2000:
Expand Down