bugGNU gettext - Bugs: bug #52788, Please provide support for the...


You are not allowed to post comments on this tracker with your current authentication level.

bug #52788: Please provide support for the golang

Submitted by:  Michael Vogt <mvogt>
Submitted on:  Tue 02 Jan 2018 02:43:26 PM UTC  
Category: OtherSeverity: 4 - Important
Item Group: NoneStatus: Confirmed
Privacy: PublicAssigned to: None
Open/Closed: Open

Wed 24 Jan 2018 03:08:17 AM UTC, comment #2:


The first thing is to review the existing implementations of a gettext runtime, which you have done.

The second thing will be to find out how a locale is chosen in the Go world.

The third thing will be to decide whether we want a gettext runtime that binds to the one in C, or one that is written entirely in Go. There seem to be different approaches in the Go world, cf. https://en.wikipedia.org/wiki/Go_(programming_language)#History

The fourth thing will be to decide about the API that the programmer should see.

Then we can go on to implement the thing.

Bruno Haible <haible>
Project Administrator
Tue 23 Jan 2018 09:59:48 PM UTC, comment #1:

A couple of remarks.

Being able to reorder the interpolated arguments is crucial for gettext because other languages can have different word orders. See https://golang.org/pkg/fmt/ and search for "Explicit argument indexes:". That differs from printf format strings for C.

Go does not have a default implementation of a gettext runtime. A quick search produced https://github.com/gosexy/gettext, https://github.com/leonelquinteros/gotext, https://github.com/snapcore/go-gettext, https://github.com/ojii/gettext.go, and probably more. That may make it hard to agree on a set of default keywords and flags for golang. But I haven't compared the APIs. If they are identical, this may be a non-issue.

That's not a thumbs-down on the suggestion but rather a hint that the implementation will probably be more than a quick copy and paste modification of the C backend.

Guido Flohr <gflohr>
Project Member
Tue 02 Jan 2018 02:43:26 PM UTC, original submission:

It would be great for gettext to support the go programming language.

Extracting the strings is similar to C, there is a additional "raw string" (https://golang.org/ref/spec#String_literals) that is enclosed in "`".

The format strings are also similar to C with some additional `%` verbs like: %q (details in https://golang.org/pkg/fmt/).

Michael Vogt <mvogt>


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by gflohr (Posted a comment)
  • -unavailable- added by haible (Updated the item)
  • -unavailable- added by mvogt (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 02 Jan 2018 08:12:04 PM UTChaibleCategoryProgrammer tools=>Other
    Tue 02 Jan 2018 07:40:44 PM UTChaibleSeverity3 - Normal=>4 - Important
    Tue 02 Jan 2018 05:01:34 PM UTChaibleCategoryNone=>Programmer tools

    Back to the top

    Powered by Savane 3.1-cleanup1