How to configure parser for text file

Hello alltogether,

I've got a text file which should be translated using Passolo.

Unfortunately I don't know how to configure a rule for the text parser to read the file.
The file looks like:


Version=2.0.1.7


_Start_Scan='Start Scan'
_Stopp_Scan='Stopp Scan'


//------------------- New Form2 -----------



The first line "Version=2.0.1.7" must not be changed / translated. This line must be included in the destination file as it is.

I'm able to "read" the string tag by configuring a string tag with start and end as a ' character.
But I don't know, how to extract the ID of the string (for example the ID "_Start_Scan".)
The second thing is, that the file is seperated by something like "//------------------- New Form2 -----------" which seperates the translations for different dialogues. The number of "-" in that line unfortunately can be different.
This seperation of the dialogues must be included in the destination file, too.

I would be very happy if someone could lead me to a text parser rule for this kind of file.
If you have any further questions, please don't hesitate to let me know.

Thank you very much in advance for your support.

Kind regards and take care.
Nils

Parents
  • Please try my attached rule as a starting point. It uses a regular expression with a back reference to catch the ID and defines lines starting with // as comments.

    [Rule]
    name="txt"
    ext="txt"
    comment="//","<EOL>","0"
    string="^([^=]+)='","'","0","1","5","1","0","1","","0"
    
    

    Please note that the translated target file always uses the structure of the source files as it is copied from the source.

  • Difficult to send files here... Store the showed content into a 'dat' file and import it into the text parser rule setup.

Reply Children
No Data