Error creating new Project after Studio 2022 SR1 (source and target languages empty)

Hello Developers, i hope you're all fine.

I have a console application used to create projects on demand.

When I create the project, my project has no source or target languages defined.

I use the code found in examples and I updated it to reflects recents SR1 changes in API (here  and here).

This is the code I use to build Project info:

public ProjectInfo ImpostaProgetto()
{
    ProjectInfo info = new ProjectInfo();
        info.Name = this.myParams.nomeProgetto;
        info.LocalProjectFolder = this.myParams.projectFolder;
        info.SourceLanguage = LanguageRegistryApi.Instance.GetLanguage("it-IT");
        
        Language[] targLangs = new Language[] { (LanguageRegistryApi.Instance.GetLanguage("en-US")) };
        info.TargetLanguages = targLangs;

    return info
}

and this is the code that creates the project

ProjectInfo infoProj = ImpostaProgetto();
FileBasedProject newProject = new FileBasedProject(infoProj);
newProject.Save();

So far nothing complicated, but:

- "newProject" object has source and target languages empty (while the Projecting object has them correctly set)

- the project folder and .sdlproj file get created correctly, but with no language attributes inside the xml (.sdlproj) file and no language folders.

I added reference to Sdl.Core.Globalization.Async along with Sdl.Core.Globalization.

 

Can anyone tell me what am I doing wrong?

Using Trados Studio 2022 SR1 - 17.1.6.16252

Thanks

emoji
Parents Reply Children
No Data