This Go script scans a specified directory for files with specific extensions and generates a POT file with the strings found in those files.
go build -o <executable-name>
go build -o <executable-name>.exe
Once compiled, you can run the script using the following syntax:
./<executable-name> -i /example/path -o output-file.pot -p extensions
Where:
-i
: Path to the directory to scan. If not specified, the current directory will be used.-o
: Name of the output POT file. The default isto-translate.pot
.-p
: File extensions to search for, separated by slashes. The default value isphp/js
.-h
: Displays the script help.
To scan a directory named src
and generate a POT file with strings from files with php
and js
extensions:
./<executable-name> -i /project-path -o translation.pot
Contributions are welcome. Please fork the repository and submit a pull request with your changes.
This project is licensed under the MIT License.