Skip to content

Extractor Command Line

perpetualKid edited this page Oct 22, 2022 · 2 revisions

--source, -s

solution-file or project-file or directory

--target, -t

target PO template file name (*.pot)

--unixstyle, -u

producing unix-style (forward slash '/') path separators in output .pot files even on Windows systems.

#: ..\Gettext\examples\Examples.HelloForms\Form1.cs:38
msgid "Text encoding"
msgstr ""

vs

#: ../Gettext/examples/Examples.HelloForms/Form1.cs:38
msgid "Text encoding"
msgstr ""

While tools like GetText.Net or PoEdit will work with both path separator styles, some other tools like GNU commandline tools (xgettext and thelike) will always expect unix-style path separators.
If such tools are used in the process, specify the -u option to enforce forward-slash path separators also when running on Windows systems, otherwise you can omit.

--order, -o

Sorts catalogue entries alphabetically by message id before export. This enables a stable order of entries in the catalogue template, which is important when comparing/editing templates such as in diff/merge scenarios. If not explicitly sorted, catalogue entries may have an arbitrary order on each export, caused by parallelization of the extractor.

--version

    gettext.extractor --version
0.9.6+180209612172ee93924a11d365d093e709300831

Aliases -as, -ad, -ap, -adp

  • -as, --aliasgetstring
  • -ad, --aliasgetparticular
  • -ap, --aliasgetplural
  • -adp, --aliasgetparticularplural

Allows to provide aliases (single or multiple as comma separated list) for the GetString* command, to support GNU-style shorthands like '_', or other custom and proprietary "GetString*" commands.

    gettext.extractor -as _

or

    gettext.extractor -as _,gs,gets

--help, -h

        gettext.extractor --help
  PS C:\> gettext.extractor --help
  Description:
    Extracts strings from C# source code files to creates or updates PO template file
  
  Usage:
    GetText.Extractor [options]
  Options:
    Source, -s, --source <Source>                   Visual Studio Solution file, Project file, or source directory.
                                                    Multiple entries are allowed. [default:
                                                    C:\Storage\Dev\ORTS-MG\Source]
    Target, -t, --target <Target>                   Target PO template file [default:
                                                    C:\Storage\Dev\ORTS-MG\Source\messages.pot]
    -v, --verbose                                   Verbose output
    -u, --unixstyle                                 Unix-style Path Separator ('/')
    -o, --order                                     Sort catalogue entries before exporting to template
    -as, --aliasgetstring <aliasgetstring>          List of aliases for GetString
    -ad, --aliasgetparticular <aliasgetparticular>  List of aliases for GetParticularString
    -ap, --aliasgetplural <aliasgetplural>          List of aliases for GetPluralString
    -adp, --aliasgetparticularplural                List of aliases for GetParticularPluralString
    <aliasgetparticularplural>
    --version                                       Show version information
    -?, -h, --help                                  Show help and usage information