Socket
Socket
Sign inDemoInstall

swig-i18n-abide

Package Overview
Dependencies
0
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    swig-i18n-abide

Swig translation tags for i18n-abide


Version published
Weekly downloads
2
Maintainers
2
Install size
5.63 kB
Created
Weekly downloads
 

Readme

Source

Swig translation tags for i18n-abide

i18n-abide is a translation library for node.js apps.

Usage

Prerequisites

i18n-abide and swig need to be added as a middleware to the express (or other framework) app.

Also, format and gettext need to be supplied in the context of swig (using res.locals).

Template helpers

// setup the trans & blocktrans template helpers
require('swig-i18n-abide')(swig);

Templates

// single line translations
{% trans "I'll be translated" %}
// single line translations with replacements
{% trans "String %(foobar)s with string replacements" %}

// multiline translations with replacements and maybe html
{% blocktrans with name=name url=url %}
Hello <a href="%(url)s">%(name)s</a>.
Pleasure to meet you.
{% blocktrans %}

Keywords

FAQs

Last updated on 16 Jun 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc