コード例 #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!
 }
コード例 #2
0
 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
ファイル: JobTests.cs プロジェクト: SaqibS/mygengo-csharp
 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
ファイル: JobTests.cs プロジェクト: SaqibS/mygengo-csharp
 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!
    }
コード例 #6
0
 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!
 }
コード例 #7
0
 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!
 }
コード例 #8
0
 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!
 }
コード例 #13
0
 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!
 }
コード例 #15
0
 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
ファイル: AccountTests.cs プロジェクト: SaqibS/mygengo-csharp
 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);
 }