ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Gettext

by michaelblyons ALL

Sublime Text syntax and support for gettext Portable Object (.po) translation files

Details

Installs

  • Total 1K
  • Win 397
  • Mac 445
  • Linux 479
Jul 21 Jul 20 Jul 19 Jul 18 Jul 17 Jul 16 Jul 15 Jul 14 Jul 13 Jul 12 Jul 11 Jul 10 Jul 9 Jul 8 Jul 7 Jul 6 Jul 5 Jul 4 Jul 3 Jul 2 Jul 1 Jun 30 Jun 29 Jun 28 Jun 27 Jun 26 Jun 25 Jun 24 Jun 23 Jun 22 Jun 21 Jun 20 Jun 19 Jun 18 Jun 17 Jun 16 Jun 15 Jun 14 Jun 13 Jun 12 Jun 11 Jun 10 Jun 9 Jun 8 Jun 7
Windows 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0
Mac 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 1 0 0 0 0 0 0 0 3 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

sublime-gettext

Sublime Text support for gettext's Portable Object (.po) translation files.

Screenshot demonstrating some features listed below

Features

  • Scopes for colors follow Sublime Text conventions
  • Syntax highlighting for documentation key-values
    • Mini-language for Plural-Formats
  • Goto Symbol for msgid contents
  • Fold markers from msgid through the end of the block
  • Flag-dependent placeholder formats for
    • Programming languages that use printf formatting
    • Programming languages with {/} brace placeholders
    • Shell's $ dollar variables
    • Whatever you decide to add

Installation

Package Control

  1. Make sure you already have Package Control installed.
  2. Choose Install Package from the Command Palette (Super+Shift+P).
  3. Type Gettext and press Enter.

With auto_upgrade enabled, Package Control will keep all installed packages up-to-date!

Using Git

  1. Change to your Sublime Text Packages directory.
  2. Clone this repository.

Manual installation

  1. Download the latest ZIP file (./archive/master.zip).
  2. Unzip the archive to your Sublime Text Packages directory.

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

Type Trigger Description
Block msg Simple message
Block msgc Simple message in a context
Block msgp Plural message
Block msgcp Plural message in a context
Line hdr Header key-value pair
Line ctx Message context
Line id Message ID
Line idp Plural message ID
Line str Message string
Line strp Plural message string

Known issues

  • When the msgid contents 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