2023-02-15 21:42:31 +00:00
|
|
|
`xgettext` command for extracting translation
|
|
|
|
---
|
|
|
|
|
|
|
|
```
|
2023-06-10 01:30:48 +00:00
|
|
|
xgettext --omit-header -ctr: -ktr -kntr:1,2 daemon/HTTPServer.cpp libi2pd_client/HTTPProxy.cpp
|
2023-02-15 21:42:31 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Regex for transforming gettext translations to our format:
|
|
|
|
---
|
|
|
|
|
2023-06-12 13:33:21 +00:00
|
|
|
```
|
|
|
|
in: ^(\"|#[:.,]|msgctxt)(.*)$\n
|
|
|
|
out: <to empty line>
|
|
|
|
```
|
|
|
|
|
2023-02-15 21:42:31 +00:00
|
|
|
```
|
|
|
|
in: msgid\ \"(.*)\"\nmsgid_plural\ \"(.*)\"\nmsgstr\[0\]\ \"(.*)\"\n(msgstr\[1\]\ \"(.*)\"\n)?(msgstr\[2\]\ \"(.*)\"\n)?(msgstr\[3\]\ \"(.*)\"\n)?(msgstr\[4\]\ \"(.*)\"\n)?(msgstr\[5\]\ \"(.*)\"\n)?
|
|
|
|
out: #{"$2", {"$3", "$5", "$7", "$9", "$11"}},\n
|
|
|
|
```
|
|
|
|
|
|
|
|
```
|
|
|
|
in: msgid\ \"(.*)\"\nmsgstr\ \"(.*)\"\n
|
|
|
|
out: {"$1", "$2"},\n
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
in: \n\n
|
|
|
|
out: \n
|
|
|
|
```
|