Gettext
Sublime Text syntax and support for gettext Portable Object (.po) translation files
By
michaelblyons
Created
Installations minus removals
Upgrades
- 1,305 installs
Links
Versions
1.2.0
·
sublime-gettext
Sublime Text support
for gettext's Portable Object (.po) translation files.

Features
- Scopes for colors follow Sublime Text conventions
- Syntax highlighting for documentation key-values
- Mini-language for
Plural-Formats
- Mini-language for
- Goto Symbol for
msgidcontents- Even for multiline strings. See Known Issues below.
- Fold markers from
msgidthrough the end of the block - Flag-dependent placeholder formats for
- Programming languages that use
printfformatting - Programming languages with
{/}brace placeholders - Shell's
$dollar variables - Whatever you decide to add
- Programming languages that use
Installation
Package Control
- Make sure you already have Package Control installed.
- Choose Install Package from the Command Palette (Super+Shift+P).
- Type Gettext and press Enter.
With auto_upgrade enabled, Package Control will keep all installed packages up-to-date!
Using Git
- Change to your Sublime Text
Packagesdirectory. - Clone this repository.
Manual installation
- Download the latest ZIP file (./archive/master.zip).
- Unzip the archive to your Sublime Text
Packagesdirectory.
Usage
Build
Use Ctrl+B to invoke a simple .mo build system
for the currently opened .po file.
(Cmd+B on Mac)
Source reference lookup
If your cursor is on a source reference in a #: comment,
F12 will prefill it in the GoTo overlay.
Snippets
Blocks
msg=> Simple Messagemsgc=> Simple message in a contextmsgcp=> Plural message in a contextmsgp=> Plural message
Lines
ctx=> Message contexthdr=> Headerid=> Message IDidp=> Message ID pluralstr=> Message stringstrp=> Message string plural
Todo
Syntax regression testsInvestigate "range" flagsCustom fold markersFeel free to add more!printfand other string formatting placeholdersPlurals mini-language in header- Navigation by
fuzzyor unfinished translations - Toggle
fuzzyflag Go to source reference- More build variants
Known issues
- When the
msgidcontents are long, Goto Symbol may not find phrases in the middle. - Placeholders in string content are shared between language families. The formats may not be perfect.
- The source reference lookup is a bit naive.
Credits
- Snippets: language-gettext