Use xgettext's native support for scheme file string extraction
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
intltool |
Fix Released
|
High
|
Данило Шеган |
Bug Description
Intltool-update currently relies on intltool-extract to find translatable strings in guile/scheme files (*.scm). I have several arguments for this:
1. xgettext can handle scm files just fine, if not better than intltool-extract. So there is not need for an intermediate step.
2. xgettext is more flexible in handling whitespace. I have tested this on the gnucash code, which contains a lot of guile scripts with translatable strings.
Running
xgettext -k_ -kN_ *.scm
extracts all strings properly.
On the other hand
intltool-extract abc.scm
for each guile script returns nothing.This is because GnuCash marks the translatable strings with "N_ " while intltool-extract expects "N_" (no whitespace). Removing all the whitespaces makes intltool-extract extract all the strings. This could be fixed in intltool-extract, but it would be a redundant effort because xgettext already supports it.
3. intltool-extract creates an intermediate header file that xgettext parses. This means that the generated pot file has source references to this intermediate file instead of to the original source scm file. This makes it more difficult to look at a string in its original context. Using xgettext directly on the other hand does use the original source scm and hence the generated pot file has source references to the actual location of the string in this original file.
I have attached a patch for this change.
Related branches
- Данило Шеган: Approve
-
Diff: 351 lines (+42/-109)7 files modifiedintltool-extract.in (+4/-50)
intltool-update.in (+21/-7)
tests/cases/Makefile.am (+0/-2)
tests/cases/test.scm (+0/-16)
tests/results/Makefile.am (+0/-1)
tests/results/test.scm.h (+0/-11)
tests/selftest.pl.in (+17/-22)
Changed in intltool: | |
milestone: | none → 0.42.0 |
assignee: | nobody → Данило Шеган (danilo) |
status: | Triaged → In Progress |
Changed in intltool: | |
status: | In Progress → Fix Committed |
Changed in intltool: | |
status: | Fix Committed → Fix Released |
If I remember right, one blocking issue with intltool and gnucash was the problem of mulitline scheme strings extraction. Do you know if your patch also resolves this issue?