Skip to content

Commit

Permalink
[#4] Add support for Studio 2021
Browse files Browse the repository at this point in the history
  • Loading branch information
EvzenP committed Jan 13, 2021
1 parent 99a3880 commit 6498a7f
Show file tree
Hide file tree
Showing 4 changed files with 241 additions and 212 deletions.
27 changes: 10 additions & 17 deletions Modules/ProjectHelper/ProjectHelper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,20 @@ public class RunspacedDelegateFactory

$LanguagesSeparator = "\s+|;\s*|,\s*"

$StudioVersionsMap = @{
Studio2 = "10.0.0.0"
Studio3 = "11.0.0.0"
Studio4 = "12.0.0.0"
Studio5 = "14.0.0.0"
Studio15 = "15.0.0.0"
Studio16 = "16.0.0.0"
}

function Get-DefaultProjectTemplate {
##########################################################################################################
# Due to API bug basing new projects on "Default.sdltpl" template instead of actual default project template,
# we need to find the real default template configured in Trados Studio by reading the configuration files
switch ($StudioVersion) {
"Studio2" {
$StudioVersionAppData = "10.0.0.0"
}
"Studio3" {
$StudioVersionAppData = "11.0.0.0"
}
"Studio4" {
$StudioVersionAppData = "12.0.0.0"
}
"Studio5" {
$StudioVersionAppData = "14.0.0.0"
}
"Studio15" {
$StudioVersionAppData = "15.0.0.0"
}
}
$StudioVersionAppData = $StudioVersionsMap[$StudioVersion]
# Get default project template GUID from the user settings file
$UserSettingsFilePath = "${Env:AppData}\SDL\SDL Trados Studio\$StudioVersionAppData\UserSettings.xml"
$DefaultProjectTemplateGuid = (Select-Xml -Path $UserSettingsFilePath -XPath "//Setting[@Id='DefaultProjectTemplateGuid']").Node.InnerText
Expand Down
Loading

0 comments on commit 6498a7f

Please sign in to comment.