Detecting language please wait for.......
Hi, I am developing a plugin for translators to use, which runs certain validation checks as they confirm segments (bilingual format). Some checks are language specific and so the plugin must know what the target language is, and I was wondering if anyone could tell me what object the target language is held in so that I may access it. Thank you in advance.
Hi Joshua O'Leary,
For the active project you can use .GetProjectInfo() method and you have TargetLanguage Property.
var targetLanguages = activeProject.GetProjectInfo().TargetLanguages;
Have a nice day,
Thank you, would you also be able to tell me how to access the "active project" please?
If you know the path of the project you can do it like this:
var project = new FileBasedProject("project path"); var languages = project.GetProjectInfo().TargetLanguages;
If you want to take the active projects(the project which is bolded) in Projects view you can access it like this:
var projectsController = SdlTradosStudio.Application.GetController<ProjectsController>(); var activeProject = projectsController?.CurrentProject;