Civil Rights
Movements, leaders, victories and the continuing fight for equality.
Explore the people, places, events, achievements, struggles and stories that shaped our journey.
Movements, leaders, victories and the continuing fight for equality.
Innovation, patents, science, technology and world-changing contributions.
Pioneers, champions, Negro Leagues, records, activism and excellence.
Meet the people whose lives, choices and achievements shaped the journey.
Black towns, communities, institutions and places where history happened.
Moments that changed communities, movements, institutions and the nation.
Wilmington, North Carolina once had a thriving Black middle class and an elected interracial government. In 1898 white supremacists used violence to overthrow that government, kill Black residents and drive many others from the city.
MORE →Reflects the personal views, recollections, and perspective of the author, Mike Davis.
This is a personal recollection on the Move fire on May 13, 1985
This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these messages)
|
| gettext | |
|---|---|
| Original author | Sun Microsystems[1] |
| Developer | various |
| Release | 1990[2] |
| Stable release | 1.0[3] |
| Operating system | Cross-platform |
| Type | Internationalization and localization |
| License | Various free software licenses |
| Website | www |
| Repository | various based on OpenSolaris and GNU gettext |
In computing, gettext is an internationalization and localization (i18n and l10n) system commonly used for writing multilingual programs on Unix-like computer operating systems. One of the main benefits of gettext is that it separates programming from translating.[4] The most commonly used implementation of gettext is GNU gettext,[5] released by the GNU Project in 1995. The runtime library is libintl. gettext provides an option to use different strings for any number of plural forms of nouns, but this feature has no support for grammatical gender. The main filename extensions used by this system are .POT (Portable Object Template), .PO (Portable Object) and .MO (Machine Object).[6]
Initially, POSIX provided no means of localizing messages. Two proposals were raised in the late 1980s, the 1988 Uniforum gettext and the 1989 X/Open catgets (XPG-3 § 5). Sun Microsystems implemented the first gettext in 1993.[1] The Unix and POSIX developers never really agreed on what kind of interface to use (the other option is the X/Open catgets), so many C libraries, including glibc, implemented both.[7] As of August 2019[update], whether gettext should be part of POSIX was still a point of debate in the Austin Group, despite the fact that its old foe has already fallen out of use. Concerns cited included its dependence on the system-set locale (a global variable subject to multithreading problems) and its support for newer C-language extensions involving wide strings.[8]
The GNU Project decided that the message-as-key approach of gettext is simpler and more friendly. (Most other systems, including catgets, requires the developer to come up with "key" names for every string.)[9] They released GNU gettext, a free software implementation of the system in 1995.[2] Gettext, GNU or not, has since been ported to many programming languages.[10] The simplicity of po and widespread editor support even led to its adoption in non-program contexts for text documents or as an intermediate between other localization formats, with converters like po4a (po for anything) and Translate Toolkit emerging to provide such a bridge.[11][12]

The basic interface of gettext is the gettext(const char*) function, which accepts a string that the user will see in the original language, usually English. To save typing time and reduce code clutter, this function is commonly aliased to _:[13]
printf(gettext("My name is %s.\n"), my_name);
printf(_("My name is %s.\n"), my_name); // same, but shorter
gettext() then uses the supplied strings as keys for looking up translations, and will return the original string when no translation is available. This is in contrast to POSIX catgets(),[14] AmigaOS GetString(),[15] or Microsoft Windows LoadString() where a programmatic ID (often an integer) is used. To handle the case where the same original-language text can have different meanings, gettext has functions like cgettext() that accept an additional "context" string.
xgettext is run on the sources to produce a .pot (Portable Object Template) file, which contains a list of all the translatable strings extracted from the sources. Comments starting with /// are used to give translators hints, although other prefixes are also configurable to further limit the scope. One such common prefix is TRANSLATORS:.
For example, an input file with a comment might look like:
/// TRANSLATORS: %s contains the user's name as specified in Preferences
printf(_("My name is %s.\n"), my_name);
xgettext is run using the command:
xgettext -c /
The resultant .pot file looks like this with the comment (note that xgettext recognizes the string as a C-language printf format string):
#. TRANSLATORS: %s contains the user's name as specified in Preferences
#, c-format
#: src/name.c:36
msgid "My name is %s.\n"
msgstr ""
In POSIX shell script, gettext provides a gettext.sh library one can include that provides the many same functions gettext provides in similar languages.[16] GNU bash also has a simplified construct $"msgid" for the simple gettext function, although it depends on the C library to provide a gettext() function.[17]
The translator derives a .po (Portable Object) file from the template using the msginit program, then fills out the translations.[18] msginit initializes the translations so, for instance, for a French language translation, the command to run would be:[6]
msginit --locale=fr --input=name.pot
This will create fr.po. The translator then edits the resultant file, either by hand or with a translation tool like Poedit, or Emacs with its editing mode for .po files. An edited entry will look like:
#: src/name.c:36
msgid "My name is %s.\n"
msgstr "Je m'appelle %s.\n"
Finally, the .po files are compiled with msgfmt into binary .mo (Machine Object) files. GNU gettext may use its own file name extension .gmo on systems with another gettext implementation.[19] These are now ready for distribution with the software package.
GNU msgfmt can also perform some checks relevant to the format string used by the programming language. It also allows for outputting to language-specific formats other than MO;[20] the X/Open equivalent is gencat.
In later phases of the developmental workflow, msgmerge can be used to "update" an old translation to a newer template. There is also msgunfmt for reverse-compiling .mo files, and many other utilities for batch processing.
The user, on Unix-type systems, sets the environment variable LC_MESSAGES, and the program will display strings in the selected language, if there is an .mo file for it.
Users on GNU variants can also use the environment variable LANGUAGE instead. Its main difference from the Unix variable is that it supports multiple languages, separated with a colon, for fallback.[21]
The ngettext() interface accounts for the count of a noun in the string. As with the convention of gettext(), it is often aliased to N_ in practical use. Consider the code sample:
// parameters: english singular, english plural, integer count
printf(ngettext("%d translated message", "%d translated messages", n), n);
A header in the "" (empty string) entry of the PO file stores some metadata, one of which is the plural form that the language uses, usually specified using a C-style ternary operator. Suppose we want to translate for the Slovene language:
msgid ""
msgstr ""
"..."
"Language: sl\n"
"Plural-Forms: nplurals=4; plural=(n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0);\n"
Since now there are four plural forms, the final po would look like:
#: src/msgfmt.c:876
#, c-format
msgid "%d translated message"
msgid_plural "%d translated messages"
msgstr[0] "%d prevedenih sporočil"
msgstr[1] "%d prevedeno sporočilo"
msgstr[2] "%d prevedeni sporočili"
msgstr[3] "%d prevedena sporočila"
Reference plural rules for languages are provided by the Unicode consortium.[22] msginit also prefills the appropriate rule when creating a file for one specific language.[18]
In addition to C, gettext has the following implementations: C# for both ASP.NET[23][24] and for WPF,[25] Perl,[26] PHP,[27] Python,[28] R,[29] Scala,[30] Node.js[31] and GAWK[32].
GNU gettext has native support for Objective-C, but there is no support for the Swift programming language yet. A commonly used gettext implementation on these Cocoa platforms is POLocalizedString.[33] The Microsoft Outlook for iOS team also provides a LocalizedStringsKit library with a gettext-like API.[34]
{{cite web}}: CS1 maint: deprecated archival service (link)
{{cite web}}: CS1 maint: deprecated archival service (link)
Source: Wikipedia. Article content is retrieved live through the MediaWiki API.
In computing, gettext is an internationalization and localization (i18n and l10n) system commonly used for writing multilingual programs on Unix-like computer operating systems. One of the main benefits of gettext is that it separates programming from translating. The most commonly used implementation of gettext is GNU gettext, released by the GNU Project in 1995. The runtime library is libintl. gettext provides an option to use different strings for any number of plural forms of nouns, but this feature has no support for grammatical gender. The main filename extensions used by this system are .POT (Portable Object Template), .PO (Portable Object) and .MO (Machine Object).
Poedit (formerly poEdit) is a shareware and cross-platform gettext catalog (.po file) editor to aid in the process of language localisation. According to WordPress developer Thord Hedengren, Poedit is "one of the most popular programs" for editing portable language files. It is written in C++ and depends on some subclasses from the wxWidgets, but utilizes graphical control elements from the GTK library. Besides Gettext catalogs, Poedit supports XLIFF, JSON, Qt and Flutter localization files. It also supports offline editing and synchronization of projects hosted on Crowdin and Localazy.
Gtranslator is a specialized computer-assisted translation software and po file editor for the internationalization and localization (i18n) of software that uses the gettext system. It handles all forms of gettext po files and includes features such as Find/Replace, Translation Memory, different Translator Profiles, Messages Table (for having an overview of the translations/messages in the po file), Easy Navigation and Editing of translation messages and comments of the translation where accurate. Gtranslator includes also a plugin system with plugins such as Alternate Language, Insert Tags, Open Tran, Integration with Subversion, and Source Code Viewer. Gtranslator is written in the programming language C for the GNOME desktop environment. It is available as free software under the terms of the GNU General Public License (GPL). In line with modern GNOME app naming conventions, Gtranslator has been renamed to GNOME Translation Editor
The GnuWin32 project provides native ports in the form of executable computer programs, patches, and source code for various GNU and open source tools and software, much of it modified to run on the 32-bit Windows platform. The ports included in the GnuWin32 packages are: GNU utilities such as bc, bison, chess, Coreutils, diffutils, ed, Flex, gawk, gettext, grep, Groff, gzip, iconv, less, m4, patch, readline, rx, sharutils, sed, tar, texinfo, units, Wget, which. Archive management and compression tools, such as: arc, arj, bzip2, gzip, lha, zip, zlib. Non-GNU utilities such as: cygutils, file, ntfsprogs, OpenSSL, PCRE. Graphics tools. PDCurses. Tools for processing text. Mathematical software and statistics software. Most programs have dependencies (typically DLLs), so that the executable files cannot simply be run in Windows unless files they depend upon are available. An alternative set of ported programs is UnxUtils; these are usually older versions, but depend only on the Microsoft C-runtime msvcrt.dll. There is a package maintenance utility, GetGnuWin32, to download and install or update current versions of all GnuWin32 packages.
Before the 1921 destruction of Tulsa’s Greenwood District, Black residents had created a remarkable center of business and community life. The district included stores, professional offices, entertainment venues and homes owned by Black citizens. Understanding Greenwood means learning what was built—not only what was burned.
MORE →The Greenwood District.