From 1a9ebf0772721bf74ef5b8038907201a7b4fa1b3 Mon Sep 17 00:00:00 2001 From: zhaoweny Date: Mon, 27 Jul 2020 14:51:26 +0800 Subject: [PATCH] i18n: add detail for excluding a folder (virtualenv) when generating new `lang.pot` Because in-tree virtualenv folder is developer-defined, we can't really predict and provide specific commands for excluding virtualenv. --- locale/README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/locale/README.md b/locale/README.md index 177b19856..6216fe679 100644 --- a/locale/README.md +++ b/locale/README.md @@ -85,8 +85,10 @@ $ find * -name "*.py" | xgettext --from-code=UTF-8 -o locale/lang.pot -d lang -k explanation: -* `find * -name "*.py"`: collect all `.py` file path in current folder and all sub-folders - (except those starts with `.`, e.g. `.env`, `.idea`), write it to stdout +* `find * -name "*.py"`: collect all `.py` file path in current folder and all sub-folders, write it to stdout + * except those starts with `.`, e.g. `.env`, `.idea` which is convient if your python venv starts with `.` + * can also append `-not -path 'path/to/venv/*` to exclude `path/to/venv` recursively. + * `xgettext`: a utility looking for keyword and put string literals in a specific format for human translation * `--from-code=UTF-8`: designates encoding of files * `-o locale/lang.pot`: let `xgettext` write to `locale/lang.pot`