Exclude strings in a .txt file

Hello,

 

we are currently having problems, excluding strings in a .txt file when we create a new project.

The file looks like this:

   Stellgeraet[3].Bezeichnung_Abs := '2:SG:3';
   Stellgeraet[3].Bezeichnung_Sym := 'Vereinzelung Radschraube 1';
   Stellgeraet[3].Bewegung_links_Abs := 'A100.1';
   Stellgeraet[3].Bewegung_links_Sym := 'zurück';
   Stellgeraet[3].Endlage_links_Abs := 'E4.3';
   Stellgeraet[4].Bezeichnung_Abs := '2:SG:4';
   Stellgeraet[4].Bezeichnung_Sym := 'Blasluftschuß Radschraube 1';
   Stellgeraet[4].Bewegung_links_Abs := 'N A100.5';
   Stellgeraet[4].Bewegung_links_Sym := 'aus';

 

We only need to translate the yellow text. How do we have to set the project settings, to only get this marked text?

We tried it with Document structure to define the start and the end of the text that needs to be translated with :=' for start and '; for end (but it didn't work).

We also tried to set inline tags, which also didn't work.

 

We appreciate every kind of help.

 

If you have further questions, please ask.

 

Best regards,

Marius Dieterle

Parents
  • Hi Marius,

    In addition to the suggestion type definition file sent by Paul, I have copied your text and I have created a plain text file, assuming that the file you are working on is a plain text file (*.txt).

    If your file has a different extension, but if actually it is a text file, just create a copy of your original file and add to it a second extension “.txt” (e.g. TEXT.[your extension].txt) and open/check it in a simple text editor (say Notepad or Notepad++; I suggest to avoid MS Word, when possible).

    As you want to extract just text between starting ' and closing ', ignoring all other text of the pertinent string, before loading the file to create your project, you should define the Project Options “Options > File Type > Text > Document structure” window inserting a ' in “Opening pattern” field and a ' in the “Closing pattern” field, check the “Multiline” if required, and click on “Add” to obtain:

    Now click on the existing default pattern (opening pattern ^ and closing pattern $) to select it and click on “Delete” to discard this rule and maintaining just your ' and ' opening and closing patterns.

    At this point, to preview the result of this setting, click on “Browse” and select the file with double extension (*.[your extension].txt) and then on “Preview” and you should obtain:

    that is what you needed. Am I right?

    Now go on loading your file in SDL Studio as usual and complete the Project routine and start translating your file that should appear as follows in the Editor view:

    When completed the translation, save the target final file as usual (SHIFT + F12), go to the folder containing your translated (double extension) file and delete from it the second added extension (.txt) to obtain a final translated file *.[your extension].

    I hope this may help you.

    Claudio

     

    ADDENDUM: To avoid problems regarding the presence of possible internal presence of ' inside the text to extract/translate, the above opening/closing patterns may be, respectively. =\s' and ';$.

  • Hi ,

    That's looking remarkably similar to the original suggestion... but with more pictures ;-)

    I did notice something interesting through and would suggest a changed closing pattern as the last word gets missed for me... but that might be just because of the copy paste to create the file rather than dealing with the actual file itself.

    Opening pattern:
    .*:=\s'

    Closing pattern:
    ';|\s$

    Regards

    Paul

    Paul Filkin | RWS Group

    ________________________
    Design your own training!

    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

Reply Children
No Data