Ejemplo n.º 1
0
 //[MenuItem("Transfluent/testInput")]
 public static void DoTestInput()
 {
     string filePath = Application.dataPath + Path.DirectorySeparatorChar + "TransfluentLocalization_en-us.xml";
     string contents = File.ReadAllText(filePath);
     var sender = new FileBasedSend();
     sender.RecieveFile(contents);
 }
Ejemplo n.º 2
0
        //[MenuItem("Transfluent/testInput")]
        public static void DoTestInput()
        {
            string filePath = Application.dataPath + Path.DirectorySeparatorChar + "TransfluentLocalization_en-us.xml";
            string contents = File.ReadAllText(filePath);
            var    sender   = new FileBasedSend();

            sender.RecieveFile(contents);
        }
Ejemplo n.º 3
0
        //[MenuItem("Transfluent/test get content")]
        public static void getTestContent()
        {
            var list = ResourceLoadFacade.getLanguageList();
            GameTranslationSet source = GameTranslationGetter.GetTranslaitonSetFromLanguageCode("en-us");
            var sender   = new FileBasedSend();
            var contents = sender.SendFileContents(source.getGroup().getDictionaryCopy(), list.getLangaugeByCode("en-us"), "", "");

            Debug.Log("Contents :" + contents);
        }
Ejemplo n.º 4
0
        //[MenuItem("Transfluent/test full loop english content")]
        public static void getTestSaveEnglishContent()
        {
            var list = ResourceLoadFacade.getLanguageList();
            GameTranslationSet source = GameTranslationGetter.GetTranslaitonSetFromLanguageCode("en-us");
            var sender   = new FileBasedSend();
            var contents = sender.SendFileContents(source.getGroup().getDictionaryCopy(), list.getLangaugeByCode("en-us"), "", "");

            Debug.Log("Contents :" + contents);

            TransfluentEditorWindowMediator mediator = new TransfluentEditorWindowMediator();

            mediator.doAuth();
            string authToken      = mediator.getCurrentAuthToken();
            string fileIdentifier = "testfile";
            var    sourceLang     = list.getLangaugeByCode("en-us");

            var saveCall     = new FileBasedSaveCall(fileIdentifier, sourceLang.id, authToken, contents);
            var caller       = new SyncronousEditorWebRequest();
            var returnStatus = caller.request(saveCall);

            Debug.Log("saved file return status:");
            Debug.Log(JsonWriter.Serialize(returnStatus));
            Debug.Log("auth token:" + authToken);
            var translateRequest = new FileTranslate("", new int[] { 3, 4 },
                                                     OrderTranslation.TranslationQuality.NATIVE_SPEAKER, fileIdentifier, sourceLang.id, authToken);
            var translateReturn = caller.request(translateRequest);

            Debug.Log("translate request file:");
            Debug.Log(JsonWriter.Serialize(translateReturn));

            var translateResultRequest = new FileBasedRead(fileIdentifier, sourceLang.id, authToken);
            var translateResultReturn  = caller.request(translateResultRequest);

            Debug.Log("translate resulting file:");
            Debug.Log(JsonWriter.Serialize(translateResultReturn));
        }
Ejemplo n.º 5
0
        //[MenuItem("Transfluent/test full loop english content")]
        public static void getTestSaveEnglishContent()
        {
            var list = ResourceLoadFacade.getLanguageList();
            GameTranslationSet source = GameTranslationGetter.GetTranslaitonSetFromLanguageCode("en-us");
            var sender = new FileBasedSend();
            var contents = sender.SendFileContents(source.getGroup().getDictionaryCopy(), list.getLangaugeByCode("en-us"), "", "");
            Debug.Log("Contents :" + contents);

            TransfluentEditorWindowMediator mediator = new TransfluentEditorWindowMediator();
            mediator.doAuth();
            string authToken = mediator.getCurrentAuthToken();
            string fileIdentifier = "testfile";
            var sourceLang = list.getLangaugeByCode("en-us");

            var saveCall = new FileBasedSaveCall(fileIdentifier, sourceLang.id, authToken, contents);
            var caller = new SyncronousEditorWebRequest();
            var returnStatus = caller.request(saveCall);

            Debug.Log("saved file return status:");
            Debug.Log(JsonWriter.Serialize(returnStatus));
            Debug.Log("auth token:" + authToken);
            var translateRequest = new FileTranslate("", new int[] { 3, 4 },
                OrderTranslation.TranslationQuality.NATIVE_SPEAKER, fileIdentifier, sourceLang.id, authToken);
            var translateReturn = caller.request(translateRequest);

            Debug.Log("translate request file:");
            Debug.Log(JsonWriter.Serialize(translateReturn));

            var translateResultRequest = new FileBasedRead(fileIdentifier, sourceLang.id, authToken);
            var translateResultReturn = caller.request(translateResultRequest);
            Debug.Log("translate resulting file:");
            Debug.Log(JsonWriter.Serialize(translateResultReturn));
        }
Ejemplo n.º 6
0
 //[MenuItem("Transfluent/test get content")]
 public static void getTestContent()
 {
     var list = ResourceLoadFacade.getLanguageList();
     GameTranslationSet source = GameTranslationGetter.GetTranslaitonSetFromLanguageCode("en-us");
     var sender = new FileBasedSend();
     var contents = sender.SendFileContents(source.getGroup().getDictionaryCopy(), list.getLangaugeByCode("en-us"), "", "");
     Debug.Log("Contents :" + contents);
 }