www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - mofile - gettext library for D

reply FreeSlave <freeslave93 gmail.com> writes:
It was a real concern for me that there's no gettext-compatible 
package for D (at least I could not find one in dub registry), 
because it's kind of standard. So I made it myself.

mofile is similar to GNU gettext, but gettext and ngettext 
functions are implemented as member functions of MoFile struct.

This package features only .mo file parsing and getting 
translated messages (with support for plural forms). No 
bindtextdomain present (so no globals)

To produce .mo files you still use standard utilities like 
xgettext, msginit, msgmerge and msgfmt.

dub package: https://code.dlang.org/packages/mofile
github repo: https://github.com/FreeSlave/mofile
May 10 2018
next sibling parent Andrea Fontana <nospam example.com> writes:
On Thursday, 10 May 2018 at 10:57:25 UTC, FreeSlave wrote:
 It was a real concern for me that there's no gettext-compatible 
 package for D (at least I could not find one in dub registry), 
 because it's kind of standard. So I made it myself.

 mofile is similar to GNU gettext, but gettext and ngettext 
 functions are implemented as member functions of MoFile struct.

 This package features only .mo file parsing and getting 
 translated messages (with support for plural forms). No 
 bindtextdomain present (so no globals)

 To produce .mo files you still use standard utilities like 
 xgettext, msginit, msgmerge and msgfmt.

 dub package: https://code.dlang.org/packages/mofile
 github repo: https://github.com/FreeSlave/mofile
Good news!
May 10 2018
prev sibling parent Bastiaan Veelo <Bastiaan Veelo.net> writes:
On Thursday, 10 May 2018 at 10:57:25 UTC, FreeSlave wrote:
 It was a real concern for me that there's no gettext-compatible 
 package for D (at least I could not find one in dub registry), 
 because it's kind of standard. So I made it myself.

 mofile is similar to GNU gettext, but gettext and ngettext 
 functions are implemented as member functions of MoFile struct.

 This package features only .mo file parsing and getting 
 translated messages (with support for plural forms). No 
 bindtextdomain present (so no globals)

 To produce .mo files you still use standard utilities like 
 xgettext, msginit, msgmerge and msgfmt.

 dub package: https://code.dlang.org/packages/mofile
 github repo: https://github.com/FreeSlave/mofile
Great! Support for i18n is an important step towards world domination (in more than one ways).
May 10 2018