Commit 827b2a9d5483d372ec3cf6efdad8f8e0442992e8
1 parent
d2146031
Exists in
OpenSigns
Read json
Showing
2 changed files
with
4 additions
and
2 deletions
Show diff stats
core/translator.py
@@ -15,6 +15,7 @@ E-Mail: wesnydy@lavid.ufpb.br | @@ -15,6 +15,7 @@ E-Mail: wesnydy@lavid.ufpb.br | ||
15 | import os | 15 | import os |
16 | import pika | 16 | import pika |
17 | import PikaManager | 17 | import PikaManager |
18 | +import json | ||
18 | 19 | ||
19 | from PortGlosa import traduzir | 20 | from PortGlosa import traduzir |
20 | from time import sleep | 21 | from time import sleep |
@@ -38,7 +39,8 @@ def run(ch, method, properties, body): | @@ -38,7 +39,8 @@ def run(ch, method, properties, body): | ||
38 | Json string containing the necessary arguments for workers. | 39 | Json string containing the necessary arguments for workers. |
39 | """ | 40 | """ |
40 | print ("Translating...") | 41 | print ("Translating...") |
41 | - gloss = traduzir(body) | 42 | + data = json.load(body) |
43 | + gloss = traduzir(data["text"],data["lang"]) | ||
42 | manager.send_to_queue("translations", gloss, properties) | 44 | manager.send_to_queue("translations", gloss, properties) |
43 | print ("Ok") | 45 | print ("Ok") |
44 | 46 |
translate-api/config/settings.js
@@ -15,7 +15,7 @@ var config = {}; | @@ -15,7 +15,7 @@ var config = {}; | ||
15 | config.contentsPath = process.env.VLIBRAS_VIDEO_LIBRAS; | 15 | config.contentsPath = process.env.VLIBRAS_VIDEO_LIBRAS; |
16 | config.bundlesPath = process.env.SIGNS_VLIBRAS; | 16 | config.bundlesPath = process.env.SIGNS_VLIBRAS; |
17 | 17 | ||
18 | -config.defaultLang = "pt-br" | 18 | +config.defaultLang = "pt_br" |
19 | 19 | ||
20 | config.platformsList = [ 'ANDROID', 'IOS', 'WEBGL', 'STANDALONE' ]; | 20 | config.platformsList = [ 'ANDROID', 'IOS', 'WEBGL', 'STANDALONE' ]; |
21 | 21 |