PslSourceList.SetTargetPathRule
Assigns a target path rule to the source list.
If you add target languages to a project, all new translation lists will use the target path rule of the source list.
Syntax
Expression.Leverage (Id as Long, bLink as Boolean, [optional] Parser as String) as Boolean
Expression Object of type PslSourceList
Id ID of the target path rule as returned by PslProject.AddTargetPathRule or index if this is a rule from a parser add-in
bLink True, if the source list should be linked to the target path rule, i.e. the target path will be calculated automatically and cannot be changed manually.
Parser optional, if set, the target path rule is from a parser and ID is the index. Parser has the format "Addin:<Parser Identifier>", see table below.
Standard Add-In defined Target Path Rules
| Parser | ID (Index) | Rule Name | Description |
|---|---|---|---|
| AddIn:Java File Parser | 0 | Java Lang_Region | Naming conventions for Java file types *.class, *.java, *properties |
| 1 | Multilingual Java archive | Naming conventions for Java *.jar files | |
| "AddIn:Borland Delphi/C++ Builder" | 0 | Borland Language DLLs | Naming conventions for Borland Language DLLs |
| 1 | Borland .NET Language DLLs | Naming conventions for Borland .NET Language DLLs | |
| "AddIn:Microsoft .NET Parser" | 0 | .NET Assemblies | Naming conventions for .NET Satellite Assemblies |
| 1 | .NET Resources | Naming conventions for .NET resx-files | |
| 2 | .NET Satellite Assemblies | Naming conventions for translation of .NET Satellite Assemblies |
Example
Sub Main
' Create a new project
Dim prj As PslProject
Set prj = PSL.Projects.Add("scribble", "c:\projects")
' Add a source list
Dim src As PslSourceList
Set src = prj.SourceLists.Add("c:\projects\scribble.exe")
' Add a target path rule for creating resource DLLs
Dim idRule As Long
idRule = prj.AddTargetPathRule("Resource DLL", "<PrjDir>", "<LangID>", "<SrcTitle>.dll")
' Assign the rule the the source list
src.SetTargetPathRule(idRule, True, "")
' Add a target language, the new translation list
' will use the rule that has been asigned to the source list
prj.Languages.Add(pslLangGerman)
End Sub