Documentation ¶
Overview ¶
Package main is the command line interface to the “translate” package, which is highly space and memory optimized l10n (localization) library.
gol10n.exe [Mode] [flags]:
Modes (Mutually exclusive):
Directory mode: [No arguments given] Processes all files in the “InputPath” directory Can be used in conjunction with -w File mode: [arg1=language identifier] Processes a single language file The default language will need to be processed if a compiled dictionary does not exist Can be used in conjunction with -s or -f -s, --single-file Mode=File. The default language will not be processed This will only work if a compiled dictionary already exists -f, --fallbacks Mode=File. Also process the language’s fallback files -w, --watch Mode=Directory. Continually watches the directory for relevant changes Only processes and updates the necessary files when a change is detected --create-settings Create the default settings-gol10n.json file -h, --help This help prompt
File flags (Modify how non-translation-text-files are interacted with):
-d, --go-dictionary[=false] Output the go dictionary files when processing the default language (default true) -c, --output-compiled[=false] Output the compiled translation files and dictionary (default true) -i, --ignore-timestamps Always read from translation text files [ignore compiled files even if they are newer]
The following are for overriding settings from settings-gol10n.json. If not given, the values from the settings file will be used:
-l, --default-language string The identifier for the default language -p, --input-path string The directory with the translation text files -g, --go-path string The directory to output the generated Go dictionary files to Each namespace gets its own directory and file in the format “$NamespaceName/translationIDs.go” -o, --output-path string The directory to output the compiled binary translation files to Each language gets its own .gtr or .gtr.gz (gzip compressed) file -m, --compress-compiled Whether the compiled binary translation files are saved as .gtr or .gtr.gz (gzip compressed) -b, --allow-big-strings If translation strings can be larger than 64KB If true, and a large translation is found, then compiled binary files will become larger -j, --allow-json-comma If JSON files can have trailing commas. If true, a sanitization process is ran over the JSON
Command line display modifiers: See using_in_go.md#ProcessedFile Mode=Directory, -w, -f
-t, --table[=false] Output an ascii table of the processed languages and their flags (default true) -v, --verbose Output a list of processed files and their processing flags -x, --warnings[=false] Output a list of warnings when processing non-default language translation files (default true)
Directories ¶
Path | Synopsis |
---|---|
Package execute contains the functions called by the main command line interface
|
Package execute contains the functions called by the main command line interface |
Package load_compiled loads compiled files (and fallbacks) from the language identifier
|
Package load_compiled loads compiled files (and fallbacks) from the language identifier |
Package translate is a highly space and memory optimized l10n (localization) library.
|
Package translate is a highly space and memory optimized l10n (localization) library. |
Package watch contains the watch.Execute function called by the main command line interface
|
Package watch contains the watch.Execute function called by the main command line interface |
Click to show internal directories.
Click to hide internal directories.