Documentation Center

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

ParserID (Index)Rule NameDescription
AddIn:Java File Parser0Java Lang_RegionNaming conventions for Java file types *.class, *.java, *properties
1Multilingual Java archiveNaming conventions for Java *.jar files
"AddIn:Borland Delphi/C++ Builder"0Borland Language DLLsNaming conventions for Borland Language DLLs
1Borland .NET Language DLLsNaming conventions for Borland .NET Language DLLs
"AddIn:Microsoft .NET Parser"0.NET AssembliesNaming conventions for .NET Satellite Assemblies
1.NET ResourcesNaming conventions for .NET resx-files
2.NET Satellite AssembliesNaming 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