Migrate to standard xgettext for weblate feature parity #688

Open
opened 2025-10-02 09:10:36 +00:00 by decentral1se · 1 comment
Owner

Weblate keeps resetting what xgettext-go does...

Any ideas @3wordchant?

Weblate keeps resetting what `xgettext-go` does... * https://git.coopcloud.tech/toolshed/abra/commit/9c648a25668a061f15988a6dff7ec7a0f2a97c30 * https://git.coopcloud.tech/toolshed/abra/commit/1c10e64c58b8d779d73e40da8b3e652dc72344b4 * https://git.coopcloud.tech/toolshed/abra/commit/df4447b0387559b7d04933372232b5b14c6fc8fb * https://git.coopcloud.tech/toolshed/abra/commit/896c434f3861c85666b2677fbd8fc2d7171f8d69 Any ideas @3wordchant?
decentral1se added this to the Language translation project 2025-10-02 09:10:36 +00:00
decentral1se changed title from i18n: resolve line length contest between xgettext-go / weblate to Resolve line length contest between xgettext-go / weblate 2025-10-02 09:11:00 +00:00
decentral1se added the
i18n
label 2025-10-02 09:11:06 +00:00
decentral1se referenced this issue from a commit 2025-10-23 07:09:09 +00:00
decentral1se referenced this issue from a commit 2025-10-23 07:10:58 +00:00
decentral1se referenced this issue from a commit 2025-10-23 07:14:26 +00:00
Author
Owner

I was trying to figure this out. It seems this issue is relevant: https://github.com/WeblateOrg/weblate/issues/6688 which points to a potential fix, using this plugin which enables --no-wrap: https://docs.weblate.org/en/weblate-4.8.1/admin/addons.html#addon-weblate-gettext-customize

I enabled it (here) but several commits later, I can't seem to get the weblate wrapping to match our frankenstein xgettext-go implementation wrapping. Weblate seems to take exception with this wrapping: fcb3167394 and I can't find any wrapping/length logic in xgettext-go apart from this quite indecipherable function:

main.go Lines 235 to 241 in bc963387fc
func formatOutput(in string) string {
// split string with \n into multiple lines
// to make the output nicer
out := strings.Replace(in, "\\n", "\\n\"\n \"", -1)
// cleanup too aggressive splitting (empty "" lines)
return strings.TrimSuffix(out, "\"\n \"")
}

Giving up for now 🙈 I guess we need to migrate to xgettext > 0.25 for the native implementation which supports Go and this will then be consistent: https://savannah.gnu.org/projects/gettext/ For another day...

I was trying to figure this out. It seems this issue is relevant: https://github.com/WeblateOrg/weblate/issues/6688 which points to a potential fix, using this plugin which enables `--no-wrap`: https://docs.weblate.org/en/weblate-4.8.1/admin/addons.html#addon-weblate-gettext-customize I enabled it ([here](https://translate.coopcloud.tech/addon/3/)) but several commits later, I can't seem to get the weblate wrapping to match our frankenstein `xgettext-go` implementation wrapping. Weblate seems to take exception with this wrapping: https://git.coopcloud.tech/toolshed/abra/commit/fcb316739481c664eecfcc70e49e23b73015219c and I can't find any wrapping/length logic in `xgettext-go` apart from this quite indecipherable function: https://git.coopcloud.tech/toolshed/xgettext-go/src/commit/bc963387fcd682673b9435fe5658587c84f7099c/main.go#L235-L241 Giving up for now 🙈 I guess we need to migrate to `xgettext` > 0.25 for the native implementation which supports Go and this will then be consistent: https://savannah.gnu.org/projects/gettext/ For another day...
decentral1se changed title from Resolve line length contest between xgettext-go / weblate to Migrate to standard xgettext for weblate feature parity 2025-10-26 09:52:01 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: toolshed/abra#688
No description provided.