How to implement locking sentence segments in plug-ins does not require machine translation

Hi, there!
I'm developing Trados plug-in now, and I've encountered a problem! When I perform batch pre translation of files, that is, batch machine translation, if there are locked sentences in the file, this sentence does not need machine translation. The attribute of the locked sentence segment is not found in the TranslationUnit class in the API. How can I get whether the current sentence segment is a locked sentence segment through the code. I found that the ConfirmationLevel property of TranslationUnit can be used to obtain whether the current sentence segment has been translated. However, for the information about locking the sentence segment, find the relevant content in TranslationUnit . Please advise whether it is not in this class!
Parents
  • Hi.

    Can't you use this? When you are looping through the paragraph units (in the project and the translatable files, that is)...

                // looping through the whole paragraph unit
                foreach (var segmentPair in paragraphUnit.SegmentPairs)
                {
                    // Determine what the confirmation status of the (currently processed) segment pair is...
                    ConfirmationLevel MyConfLevel = segmentPair.Properties.ConfirmationLevel;

                    // Determine what the lock status of the (currently processed) segment pair is...
                    bool MySegmntLockStatus = segmentPair.Properties.IsLocked;

                        //skip if locked and checkbox is set...
                        if (MySegmntLockStatus == true)
                        {}

    else

    {

    //This is where you need to do what you need to do when segment inside document inside project is not locked

    }
                        ...

    etc.

    Make sure you have the required Sdl.FileTypeSupport.Framework.... included

    Patrick

Reply
  • Hi.

    Can't you use this? When you are looping through the paragraph units (in the project and the translatable files, that is)...

                // looping through the whole paragraph unit
                foreach (var segmentPair in paragraphUnit.SegmentPairs)
                {
                    // Determine what the confirmation status of the (currently processed) segment pair is...
                    ConfirmationLevel MyConfLevel = segmentPair.Properties.ConfirmationLevel;

                    // Determine what the lock status of the (currently processed) segment pair is...
                    bool MySegmntLockStatus = segmentPair.Properties.IsLocked;

                        //skip if locked and checkbox is set...
                        if (MySegmntLockStatus == true)
                        {}

    else

    {

    //This is where you need to do what you need to do when segment inside document inside project is not locked

    }
                        ...

    etc.

    Make sure you have the required Sdl.FileTypeSupport.Framework.... included

    Patrick

Children
No Data