how to Untranslated an image from a macro ?

Hi,

 I try by macro to untranslated an image in passolo 2018 18.0.178.0

The image comes from a .CHM file. My first image it's the Resource(6).

I can provide the lpu if you need.

When I try to change the value for the state of pslStateTranslated

The debugger stop and  I received the error on execution 

128) This state flag can not be set for this resource. 

On this line

prj.TransLists.Item(1).Resource(6).State(pslStateTranslated)= False

 

Set prj = PSL.ActiveProject 

If (prj.TransLists.Item(1).Resource(6).IsBinary )then

     If (prj.TransLists.Item(1).Resource(6).State(pslStateTranslated)) Then   

          ‘ import the source image in the translated list        

          filename = prj.TransLists.Item(1).SourceList.Resource(6).IDName       

          target2 = prj.TransLists.Item(1).SourceList.Resource(6).ExportBinary("D:\test",fileName)       

          prj.TransLists.Item(1).Resource(6).ImportBinary(target2)     

           ‘ try to set the image to untranslated. 

          prj.TransLists.Item(1).Resource(6).State(pslStateTranslated)= False       

          prj.TransLists.Item(1).Save 

     end if

end if

 

If this is the right way to untranslated an image?

emoji
Parents Reply Children
  • However, I hope that the code provided at least answers the original question "How to untranslate an image from a macro" sufficiently well and provides a solution to this problem.

    Passolo was developed for the localization of strings in graphical user interfaces. It contains a few functions that can be used to modify and replace images, but it does not have true image localization functions due to limitations of the underlying data model.

    For the vast majority of customers, the functions provided are sufficient because images are not usually localized. Therefore, for the management and localization of 1200 images in a large online documentation, other tools, such as large CMS systems, should be used.

    emoji