Example #1
0
 public static function getDirtyConfigChunks()
 {
     // return the set of chunk IDs, which are the chunks that contain
     // lids that are in need of some translation.  These IDs are calculated
     // as the segment ID of the first segment in the chunk, divided by
     // the configured chunk size.  So, segments 1 through [chunk size] would
     // be in chunk #1, etc.
     $lids = self::getDirtyChunkLids();
     $chunk_ids = array();
     foreach ($lids as $lid) {
         $id = LingotekConfigChunk::getIdBySegment($lid);
         if (array_key_exists($id, $chunk_ids)) {
             $chunk_ids[$id]++;
         } else {
             $chunk_ids[$id] = 1;
         }
     }
     $chunk_ids = self::pruneChunksWithPendingTranslations($chunk_ids);
     return $chunk_ids;
 }