.razor, .cs files in Trados Studio?

Dear all,

I’ve got a client asking me to translate .razor and .cs files. Is there any possibility to edit them in Trados Studio?

Thanks for your piece of advice 

Aurélie 

emoji
Parents
  •   

    .razor and .cs files are not XML-based.

    • .cs files: These are C# source code files.  They contain C# syntax, not XML.

    • .razor files: These are Razor component files used in Blazor/ASP.NET Core.  They mix HTML markup with C# code, but again, not XML.

    They are not usually translated.  They are implementation files in a software project.  If you see text in them (labels, messages, UI strings), best practice is to extract those into resource files (.resx) or another localisation framework.  Translating the .razor or .cs files directly could break the build.

    So if your client is asking you to translate them I would ask your client what specifically they want translated in the file so you know exactly what can be translated and what should not.  Only then will you be able to see whether you can handle them with some regex based filetype perhaps.  But as I mentioned... it would be better for your client to extract translatable content into proper resource files.

    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

    emoji
  • Hello  , thanks for your quick answer. I’ll check that with my client. 

    Doing some research, I was wondering if Passolo could help. What do you think?

    Thanks, Aurélie 

    emoji
  •   

    Passolo is not designed to handle .razor or .cs files directly.

    • These files are source code. Translating them in Passolo would risk corrupting the logic.
    • The intended workflow is to externalise localisable strings into resource files (.resx in .NET projects). Passolo has a .NET parser that works with .resx, .dll, or .exe resources and is well-suited for that. But if you get proper resources files you could handle them in Trados Studio anyway.
    • Any text left directly inside .razor or .cs is not meant for translation. Developers should move it into resources before localisation

    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

    emoji
Reply
  •   

    Passolo is not designed to handle .razor or .cs files directly.

    • These files are source code. Translating them in Passolo would risk corrupting the logic.
    • The intended workflow is to externalise localisable strings into resource files (.resx in .NET projects). Passolo has a .NET parser that works with .resx, .dll, or .exe resources and is well-suited for that. But if you get proper resources files you could handle them in Trados Studio anyway.
    • Any text left directly inside .razor or .cs is not meant for translation. Developers should move it into resources before localisation

    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

    emoji
Children