예제 #1
0
 public void CreateJob()
 {
     var mygengo = new MyGengoClient(ApiKeys.PublicKey, ApiKeys.PrivateKey, useSandbox: true);
     var job = new TranslationJob("My slug", "trololololol", "en", "ja", Tier.Standard);
     XDocument response = mygengo.PostTranslationJob(job);
     // response.Root.Element("response") is your ideal response!
 }
 public void DetermineTranslationCost()
 {
     var mygengo = new MyGengoClient(ApiKeys.PublicKey, ApiKeys.PrivateKey, useSandbox: true);
     var job = new TranslationJob("Slug", "Mmmhmm, yes, yes, quite right", "en", "ja", Tier.Standard);
     XDocument response = mygengo.DetermineTranslationCost(job);
     // response.Root.Element("response") is your ideal response!
 }
예제 #3
0
 public void TestJobCreation()
 {
     var myGengo = new MyGengoClient(ApiKeys.PublicKey, ApiKeys.PrivateKey, useSandbox: true);
     var rnd = new Random();
     string text = string.Format("Test{0}ing myGe{1}ngo A{2}PI li{3}brary calls.", rnd.Next(1, 226), rnd.Next(1, 226), rnd.Next(1, 226), rnd.Next(1, 226));
     var job = new TranslationJob(text, "en", "ja", Tier.Standard);
     XDocument response = myGengo.PostTranslationJob(job);
     Assert.AreEqual("ok", response.Root.Element("opstat").Value);
     Assert.IsNotNull(response.Root.Element("response").Element("job").Element("job_id").Value);
 }
예제 #4
0
 public void TestMultipleJobCreation()
 {
     var myGengo = new MyGengoClient(ApiKeys.PublicKey, ApiKeys.PrivateKey, useSandbox: true);
     var rnd = new Random();
     var jobs = new TranslationJob[3];
     for (int i = 0; i < 3; i++)
     {
         string text = string.Format("Test{0}ing myGe{1}ngo A{2}PI li{3}brary calls.", rnd.Next(1, 226), rnd.Next(1, 226), rnd.Next(1, 226), rnd.Next(1, 226));
         jobs[i] = new TranslationJob(text, "en", "ja", Tier.Standard);
     }
     XDocument response = myGengo.PostTranslationJobs(jobs, shouldProcess: false);
     Assert.AreEqual("ok", response.Root.Element("opstat").Value);
     Assert.AreEqual(3, response.Root.Descendants("item").Count());
 }
예제 #5
0
    public void CreateJob()
    {
        var mygengo = new MyGengoClient(ApiKeys.PublicKey, ApiKeys.PrivateKey, useSandbox: true);
        var rnd = new Random();
        var jobs = new TranslationJob[3];

        for (int i = 0; i < 3; i++)
        {
            // The same text is used here for slug and translation; they are fine to be different.
            string text = string.Format("Test{0}ing myGe{1}ngo A{2}PI li{3}brary calls.", rnd.Next(1, 226), rnd.Next(1, 226), rnd.Next(1, 226), rnd.Next(1, 226));
            jobs[i] = new TranslationJob(text, text, "en", "ja", Tier.Standard);
        }

        /**
         *	Can pass shouldProcess and/or processAsGroup; former pays immediately, latter
         *	keeps them all under one translator (advisable for context).
         */
        XDocument response = myGengo.PostTranslationJobs(jobs, processAsGroup: true, shouldProcess: false);
        // response.Root.Element("response") is your ideal response!
    }
 public void JobRevision()
 {
     var mygengo = new MyGengoClient(ApiKeys.PublicKey, ApiKeys.PrivateKey, useSandbox: true);
     XDocument response = mygengo.GetTranslationJobRevision('42', '1'); // job_id, revision_id
     // response.Root.Element("opstat") is your ideal response!
 }
 public void ReturnLanguagePairs()
 {
     var mygengo = new MyGengoClient(ApiKeys.PublicKey, ApiKeys.PrivateKey, useSandbox: true);
     XDocument response = mygengo.GetServiceLanguagePairs();
     // response.Root.Element("response") is your ideal response!
 }
 public void DeleteJob()
 {
     var mygengo = new MyGengoClient(ApiKeys.PublicKey, ApiKeys.PrivateKey, useSandbox: true);
     int[] jobs = [42, 43, 44];
예제 #9
0
 public void ReviseJob()
 {
     var mygengo = new MyGengoClient(ApiKeys.PublicKey, ApiKeys.PrivateKey, useSandbox: true);
     XDocument response = mygengo.ReviseTranslationJob("42", "This job needs more effort");
     // response.Root.Element("response") is your ideal response!
 }
예제 #10
0
 public void RejectJob()
 {
     var mygengo = new MyGengoClient(ApiKeys.PublicKey, ApiKeys.PrivateKey, useSandbox: true);
     XDocument response = mygengo.RejectTranslationJob("42", RejectReason.Quality, "Thanks!", "Captcha Fill", false);
     // response.Root.Element("response") is your ideal response!
 }
예제 #11
0
 public void PurchaseJob()
 {
     var mygengo = new MyGengoClient(ApiKeys.PublicKey, ApiKeys.PrivateKey, useSandbox: true);
     XDocument response = mygengo.PurchaseTranslationJob("42");
     // response.Root.Element("response") is your ideal response!
 }
예제 #12
0
 public void ApproveJob()
 {
     var mygengo = new MyGengoClient(ApiKeys.PublicKey, ApiKeys.PrivateKey, useSandbox: true);
     XDocument response = mygengo.ApproveTranslationJob("42", Rating.TwoStars, "Thanks!", "All Good", false);
     // response.Root.Element("response") is your ideal response!
 }
 public void BatchJobs()
 {
     var mygengo = new MyGengoClient(ApiKeys.PublicKey, ApiKeys.PrivateKey, useSandbox: true);
     XDocument response = mygengo.GetTranslationJobBatch('42');
     // response.Root.Element("opstat") is your ideal response!
 }
예제 #14
0
 public void ReturnAccountStats()
 {
     var mygengo = new MyGengoClient(ApiKeys.PublicKey, ApiKeys.PrivateKey, useSandbox: true);
     XDocument response = mygengo.GetAccountStats();
     // response.Root.Element("response") is your ideal response!
 }
 public void AddJobComment()
 {
     var mygengo = new MyGengoClient(ApiKeys.PublicKey, ApiKeys.PrivateKey, useSandbox: true);
     XDocument response = mygengo.PostTranslationJobComment("42", comment: "Mmmmm better");
     // response.Root.Element("response") is your ideal response!
 }
예제 #16
0
 public void TestGetAccountStats()
 {
     var myGengo = new MyGengoClient(ApiKeys.PublicKey, ApiKeys.PrivateKey, useSandbox: true);
     XDocument response = myGengo.GetAccountStats();
     Assert.AreEqual("ok", response.Root.Element("opstat").Value);
 }