How to add rule for resx to mark variables {0}, {1} etc. non-translatable and display non-translatable <comment>?

How can I add rule for parsing resx to mark variables {0}, {1} etc. non-translatable and display non-translatable <comment>?

I added the two rules to standard XML Microsoft .NET resources format and I tried to generate a custom file type for resx but the result is the same.

(The source file is attached zipped, otherwise it would not upload.)

 3858.Resource2.zip

Parents
  • You need to add your rule for the variables {0} etc. into the embedded content section.  It's a regex and you can't use these as a parser rule.

  • Omg that was fun but it worked for the variables Slight smile

    I compiled the solution from your instruction videos on Embedded content.

    How to deal with <comment> elements to get them into Trados comment fields?

  • Well done so far... you did the hardest part!!

    The comments seem to be within <comment> elements.  So here you only need to add a new parser rule to extract them.  It's not possible to extract them and have them displayed as messages/comments so instead you should be able to add the new parser rule for comments, give it some structure (comment for example), and then you can filter on the comment structure using the Advanced Display Filter, copy source to target if it doesn't need to be translated, and lock it.  This way you can always see the comments as you work but they won't get in the way of translating.

    However, I just tested this and the problem is that when you also use the embedded content filter the document structure information is removed!  I believe this is a bug that is already known but I'll make sure to report it anyway.

    So, what can you do now?  Maybe a workaround like this and forget about using the embedded content filetype:

    1. create your new parser rule and add the appropriate structure:


    2. You should now have something like this:


    3. Filter on the comments, copy source to target and lock:


    4. So now you have this, which seem workable and clean:
    5. To handle the variables now I would use something like the SDL Data Protection Suite like this:


    6. Now on running the task I get this:

    Once complete don't forget to "unprotect" the file before saving the target.

  • , thanks a lot! I have managed to:

    - Keep the previous Parser rules + marking <comment> as translatable

    - Keep the previous Embedded content setting that protects {\d+}

    - Still use the Community Advanced Display Filter to select COM segments and lock them!

    This truly looks workable and clean, however it puts some pre- and post-processing effort at document level, while ideally I'd get it all done at file type definition level Slight smile

    Regards and thank you!

    Marta Bartnicka

    PS. I could not get "Protect Data" under Batch Processing, however I've installed SDL Data Protection Suite :(

  • I could not get "Protect Data" under Batch Processing, however I've installed SDL Data Protection Suite :(

    What do you see when you run the batch tasks?  So in the menu for selecting a Batch Task?

  • Ahh, there IS "Protect Data" when I select a Batch Task so I guess I could add the processing there.

    But I really want to get done as much as possible under custom File Type, and the embedded content filter is getting it right Slight smile

    So thank you, I got resx custom-handled as good as possible!

    Regards,

    Marta

Reply Children
No Data