2021-08-06 20:42:08 +03:00
|
|
|
`xgettext` command for extracting translation
|
2021-08-18 22:23:39 +03:00
|
|
|
---
|
2021-08-06 20:42:08 +03:00
|
|
|
|
|
|
|
```
|
|
|
|
xgettext --omit-header -ctr: -ktr -ktr:1,2 daemon/HTTPServer.cpp libi2pd_client/HTTPProxy.cpp
|
|
|
|
```
|
|
|
|
|
|
|
|
Regex for transforming gettext translations to our format:
|
2021-08-18 22:23:39 +03:00
|
|
|
---
|
2021-08-06 20:42:08 +03:00
|
|
|
|
|
|
|
```
|
2022-08-03 11:48:10 +03:00
|
|
|
in: msgid\ \"(.*)\"\nmsgid_plural\ \"(.*)\"\nmsgstr\[0\]\ \"(.*)\"\n(msgstr\[1\]\ \"(.*)\"\n)?(msgstr\[2\]\ \"(.*)\"\n)?(msgstr\[3\]\ \"(.*)\"\n)?(msgstr\[4\]\ \"(.*)\"\n)?(msgstr\[5\]\ \"(.*)\"\n)?
|
2021-08-06 20:42:08 +03:00
|
|
|
out: #{"$2", {"$3", "$4", "$6", "$8", "$10"}},\n
|
|
|
|
```
|
|
|
|
|
|
|
|
```
|
|
|
|
in: msgid\ \"(.*)\"\nmsgstr\ \"(.*)\"\n
|
|
|
|
out: {"$1", "$2"},\n
|
|
|
|
```
|
|
|
|
|
|
|
|
```
|
|
|
|
in: ^#[:.](.*)$\n
|
|
|
|
out: <to empty line>
|
|
|
|
```
|
|
|
|
|
|
|
|
```
|
|
|
|
in: \n\n
|
|
|
|
out: \n
|
|
|
|
```
|