2021-08-06 17:42:08 +00:00
|
|
|
`xgettext` command for extracting translation
|
2021-08-18 19:23:39 +00:00
|
|
|
---
|
2021-08-06 17:42:08 +00: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 19:23:39 +00:00
|
|
|
---
|
2021-08-06 17:42:08 +00:00
|
|
|
|
|
|
|
```
|
2022-08-03 08:48:10 +00: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 17:42:08 +00: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
|
|
|
|
```
|