0.6.8 • Published 9 months ago

alchemy-i18n v0.6.8

Weekly downloads
5
License
MIT
Repository
github
Last release
9 months ago

Alchemy i18n

The i18n plugin for the Alchemy MVC

Installation

Just installing the npm package can be done like this:

$ npm install alchemy-i18n

Activate

You can activate the plugin by adding this to the main bootstrap.js file:

alchemy.usePlugin('i18n');

Use

This plugin will add a global __ function you can use to create translatable string objects.

Here's an example on how to use them in your Hawkejs templates:

<div class="user-menu">
    <%= __('user.greeting') %>
    <span class="username">
        <%= username %>
    </span>
    <ul class="actions">
        <li><%= __('user.profile') %></li>
        <li><%= __('user.logout') %></li>
    </ul>
</div>

This would result in the following HTML, when the user requests the page with an English locale:

<div class="user-menu">
    Hello,
    <span class="username">
        skerit
    </span>
    <ul class="actions">
        <li>My profile</li>
        <li>Logout</li>
    </ul>
</div>
0.7.0-alpha.2

9 months ago

0.6.8

9 months ago

0.7.0-alpha.1

9 months ago

0.6.7

1 year ago

0.6.6

2 years ago

0.6.5

2 years ago

0.6.4

2 years ago

0.6.3

2 years ago

0.6.2

3 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.0

7 years ago

0.3.0

8 years ago

0.2.0

8 years ago