Ejemplo n.º 1
0
 public function translations_status()
 {
     $client = new Lingotek_API();
     $translations = $client->get_translations_status($this->document_id);
     // key are Lingotek locales
     if ($translations !== false) {
         foreach ($this->translations as $locale => $status) {
             $lingotek_locale = $this->pllm->get_language($locale)->lingotek_locale;
             if ('current' != $status && isset($translations[$lingotek_locale]) && 100 == $translations[$lingotek_locale]) {
                 $this->translations[$locale] = 'ready';
             }
         }
         unset($this->desc_array['lingotek']['api_errors']['translations_status']);
         $this->save();
     } else {
         $this->desc_array['lingotek']['api_errors']['translations_status'] = __('Error checking translations status of post ', 'wp-lingotek') . $this->source;
         $this->save();
     }
 }
Ejemplo n.º 2
0
 public function translations_status()
 {
     $client = new Lingotek_API();
     $translations = $client->get_translations_status($this->document_id, $this->source);
     // key are Lingotek locales
     foreach ($this->translations as $locale => $status) {
         $lingotek_locale = $this->pllm->get_language($locale)->lingotek_locale;
         if ('current' != $status && isset($translations[$lingotek_locale]) && 100 == $translations[$lingotek_locale]) {
             $this->translations[$locale] = 'ready';
         }
     }
     $this->save();
 }