• Lexical
Show / Hide Table of Contents
  • Lexical.FileSystem
    • Introduction
    • Abstractions
      • IFileSystem
        • IFileSystem
        • IFileSystemBrowse
        • IFileSystemCreateDirectory
        • IFileSystemDelete
        • IFileSystemFileAttribute
        • IFileSystemMount
        • IFileSystemMove
        • IFileSystemObserve
        • IFileSystemOpen
      • IEvent
      • IEntry
      • IOption
      • IToken
    • FileSystem
    • VirtualFileSystem
    • MemoryFileSystem
    • EmbeddedFileSystem
    • HttpFileSystem
    • Decoration
    • IFileProvider
    • Utility
      • DisposeList
      • FileScanner
      • VisitTree
      • File Operation
  • Lexical.FileProvider
    • Introduction
    • Package
    • Package.Abstractions
    • Root
    • Zip
    • Dll
    • SharpCompress
    • SharpZipLib
    • FileScanner
    • Utils
  • Lexical.Localization
    • Introduction
    • Tutorial
    • Asset
      • IAsset
      • IStringAsset
    • Line
      • ILine
      • ILineFactory
      • ILineRoot
      • ILineFormat
      • ILineLogger
      • LineComparer
    • File
      • ILineReader
      • ILineWriter
      • Ini
      • Json
      • Xml
      • Resx
      • Resources
    • Miscellaneous
      • Plurality
      • ICulturePolicy
      • IStringFormat
      • Dependency Injection
    • Practices
      • Class Library
      • Class Library DI
      • Class Library DI opt.
  • Lexical.Utilities
    • Introduction
    • UnicodeString
    • FileScanner
    • Permutation
    • Tuples
    • StructList

Test from Command-Line

Tool scans into package files, such as .zip, .gz, .gzip, .bzip2, .tar, .rar, .7z, .dll. Test scan can be used to test the extent of the file scanner. It doesn't affect the localization output. The feature is just for testing purposes.

The -t:<glob pattern> searches for files using glob pattern.

Lexical.Localization.Tool -le -t:**.dll/**.resources

Produces list of files.

Log started: 12.2.2019 23.12.14
C:/Tmp/Microsoft.Extensions.Configuration.Binder.dll/Microsoft.Extensions.Configuration.Binder.Resources.resources
C:/Tmp/Microsoft.Extensions.Configuration.dll/Microsoft.Extensions.Configuration.Resources.resources
C:/Tmp/Microsoft.Extensions.Configuration.FileExtensions..dll/Microsoft.Extensions.Configuration.FileExtensions.Resources.resources
C:/Tmp/Microsoft.Extensions.Configuration.Ini.dll/Microsoft.Extensions.Configuration.Ini.Resources.resources

The -T:<glob pattern> adds an exclude pattern, files not to scan. For instance, to exclude contents of a zip, add -T:.zip/.

Lexical.Localization.Tool -le -t:**.dll/**.resources -T:**.zip/**

Test Scan Configuration

Test scanning can be added with configuration file as well.

Lexical.Localization.Tool -le testscan.json

"TestJobs" is an array of sections that define test scan job.

  • json
  • xml
  • ini
"TestJobs": [
  {
    "PackageExtensions": "dll exe zip bzip2 z tar 7z gzip gz rar",
    "GlobPattern": "**/[culture/][Assembly].dll/**.resources",
    "GlobPatterns": [],
    "WildcardPattern": "*/[culture/][Assembly].dll/*.resources",
    "WildcardPatterns": [],
    "Filename": "mydata.zip/en/Lexical.Localization.Tool.dll",
    "Filenames": [],
    "Exclude": "",
    "Excludes":  []
  }
<TestJobs name="0">
  <PackageExtensions>dll, exe, zip, bzip2, z, tar, 7z, gzip, gz, rar</PackageExtensions>
  <GlobPattern>**/[culture/][Assembly].dll/**.resources</GlobPattern>
  <GlobPatterns name="0"></GlobPatterns>
  <WildcardPattern>*/[culture/][Assembly].dll/*.resources</WildcardPattern>
  <WildcardPatterns name="0"></WildcardPatterns>
  <FileName>mydata.zip/en/Lexical.Localization.Tool.dll</FileName>
  <Filenames name="0"></Filenames>
  <Exclude></Exclude>
  <Excludes name="0"></Excludes>
</TestJobs> 
[TestJobs:0]
PackageExtensions = dll exe zip bzip2 z tar 7z gzip gz rar
GlobPattern = **/[culture/][Assembly].dll/**.resources
GlobPatterns:0 = 
WildcardPattern = */[culture/][Assembly].dll/*.resources
WildcardPatterns:0 =
Filename = mydata.zip/en/Lexical.Localization.Tool.dll
Filenames:0 =
Exclude =
Excludes:0 =


One pattern, FileName, WildcardPattern, GlobPattern needs to be added.

TestJob Parameters:

Parameter Description Example Value
PackageExtensions Extensions to open dll exe zip bzip2 z tar 7z gzip gz rar
FileName Single file to scan filename.ext
FileNames List of files to scan filename1.ext, filename2.ext
WildcardPattern Pattern of files to scan *.dll
WildcardPatterns Multiple patterns of files to scan *.dll, *.exe
GlobPattern Glob pattern of files to scan **.dll/**.resources
GlobPatterns Multiple glob patterns to scan
Exclude One glob pattern of files to exclude **.zip/**
Excludes Multiple glob patterns of files to exclude
Back to top Copyright © 2015-2020 Toni Kalajainen