What is MIME type "application/x-gettext-translation"?

A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.

application/x-gettext-translation is a MIME type for binary translation files. These files are used by software that supports multiple languages.
They store precompiled translations from human-readable text files. This speeds up the lookup of translated strings during runtime.
Files with this MIME type are often seen as compiled objects with formats such as MO or GMO.
application/x-gettext-translation ensures that programs can quickly retrieve the right translation for a given locale, making it an essential part of software internationalization. For more details, check out additional resources on GNU Gettext.

Associated file extensions

Usage Examples

HTTP Header

When serving content with this MIME type, set the Content-Type header:


    Content-Type: application/x-gettext-translation    
  

HTML

In HTML, you can specify the MIME type in various elements:


    <a href="file.dat" type="application/x-gettext-translation">Download file</a>    
  

Server-side (Node.js)

Setting the Content-Type header in Node.js:


    const http = require('http');    
    
    http.createServer((req, res) => {    
      res.setHeader('Content-Type', 'application/x-gettext-translation');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

What is the purpose of the application/x-gettext-translation MIME type?

This MIME type identifies binary message catalogs used by the GNU gettext system for software localization. These files, typically with the extension .mo, contain compiled translations that allow applications to display text in different languages efficiently.

How do I open or edit a file with this MIME type?

Files served as application/x-gettext-translation are binary and cannot be edited directly in a text editor. You must edit the original human-readable source file (usually .po) using a tool like Poedit and then compile it back into the .mo format.

How do I configure Apache to serve .mo files with the correct MIME type?

You can ensure your server identifies these files correctly by adding a directive to your .htaccess or configuration file. Add the line: AddType application/x-gettext-translation .mo .gmo.

Why does my browser download the .mo file instead of displaying it?

Browsers are not designed to interpret or render binary translation data. When a browser encounters application/x-gettext-translation, it defaults to downloading the file because it does not know how to display the binary content visually.

What is the difference between .po and .mo files?

A .po file is a human-readable text file containing translation strings, often associated with text-based MIME types. A .mo file (identified by application/x-gettext-translation) is the compiled binary version of the .po file, optimized for fast lookup by the software at runtime.

Is application/x-gettext-translation a standard MIME type?

The x- prefix indicates that this is a non-standard or experimental type not officially registered with the IANA. However, it is the widely accepted convention for identifying binary gettext files on Linux systems and web servers.

Can I convert a file with this MIME type back to text?

Yes, you can reverse the compilation process using the msgunfmt command-line tool included with GNU gettext. Running msgunfmt filename.mo will output the readable translations, effectively converting the binary data back to a source format.

General FAQ

What is a MIME type?

A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.

MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.

MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.

How do I find the MIME type for a file?

You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.

Why are multiple MIME types listed for one extension?

Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.