PslProject.AddTargetPathRule
Adds a new target path rule to the project. Use PslSourceList.SetTargetPathRule and PslTransList.SetTargetPathRule to assign the rule to string lists.
Syntax
Expression.AddTargetPathRule (Name as String, Path as String, SubPath as String, FileName as String, [optional] Description as String) as Long
Expression Object of type PslProject
Name Name of the target path rule
Path Base path of the target path rule
SubPath Sub path, this is appended to the base path
RelSrcPath Relative source path builds a folder structure for the target files according to the relation of the source file to a reference folder.
FileName Target file name
Description optional, a description of the target path rule
Returns the ID of the new target path rule.
The parameters Name, SubPath, RelSrcPath and FileName can use these placeholders:
| Placeholder | Description | Example |
|---|---|---|
| <LangID> | Numerical language ID, hexadecimal | "0C" |
| <LangIDDec> | Numerical language ID, decimal | 1036 |
| <LangCode> | Windows language code | "fra" |
| <LangRgnCode> | Language/region code | "fr-FR" |
| <LangISO639_1> | ISO 639-1 code | "fr" |
| <LangISO639_2B> | ISO 639-2 code, bibliographic | "fre" |
| <LangISO639_2T> | ISO 639-2 code, terminological | "fra" |
| <LangName> | Language name in current Passolo language | "Französisch (Frankreich)" |
| <LangEnglishName> | English Language Name | "French (France)" |
| <PrjDir> | Project folder | "c:\MyProject" |
| <SrcDir> | Source file folder | "c:\Sources" |
| <SrcName> | Source file name | "Example.exe" |
| <SrcTitle> | Source file title (source file name without extension) | "Example" |
| <SrcExt> | Source file extension | "exe" |
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
Const SubDir As String = <RelSrcPath:<PrjDir>\..\..\>
Dim idRule As Long
idRule = prj.AddTargetPathRule("Resource DLL", "<PrjDir>", "<LangID>", "<SrcTitle>.dll")
' Assign the rule to 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