Skip to content

Commit 4243e71

Browse files
committed
Switch commpletely to npm
1 parent 9cfe740 commit 4243e71

File tree

4 files changed

+17
-21
lines changed

4 files changed

+17
-21
lines changed

Diff for: README.md

+14-18
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,26 @@ This package offers translations for accounts-base, accounts-passwords, accounts
55
Translations are currently available for Arabic, Catalan, Chinese (Mandarin), Chinese (Traditional), Chinese (Hong Kong), Croatian, Czech, Danish, Dutch, Estoninan, Farsi, Finish, French, French (Canada), German, Greek, Hebrew, Hungarian, Indonesian, Italian, Japanese, Khmer, Korean, Norwegian, Polish, Portuguese (Brasil), Portugues (Portugal), Romanian, Russian, Slovak, Slovenian, Spanish (South America), Spanish (Spain), Swedish, Thai, Turkish, Ukrainian and Vietnamese.
66

77

8-
## Version 2.0.0
9-
The second generation of meteor-accounts-t9n is able to run with `npm` alone. This means it can even be used with plain Node.js applications, not only within Meteor, see in `./examples/npm` how this could work. In Version 2.2.0 the examples have moved to the seperate repository https://github.com/softwarerero/meteor-accounts-t9n-examples.
8+
## Version 2.3.0
9+
`meteor-accounts-t9n` now only works as an npm package, it is not possible to add it as meteor package any longer. Also the dependencies on `CoffeeScript` and `Tracker` do not exist any more, so there integration is optional and you have to do it manually, see https://github.com/softwarerero/meteor-accounts-t9n-example for some inspiration.
1010

11-
When using `npm` the translation files will no longer be eagerly loaded. Several people asked for this feature to safe bandwidth and it is possible now, this closes #161.
11+
## Installation and initialisation
12+
`meteor npm install --save meteor-accounts-t9n`
1213

13-
To make it work with `npm` the files have been translated to JavaScript, so if you use CoffeeScript you can require from the main directory and if you use JavaScript you would import/require from `build`.
14+
### Require (or import) T9n (this was a global variable in former versions)
15+
`T9n = (require 'meteor-accounts-t9n').T9n`
1416

15-
These `examples` show different use cases:
17+
### Add English default translations (to this for any language you want)
18+
T9n.map 'en', require 'meteor-accounts-t9n/build/en'
19+
`T9n.map 'en', # add another t9n to the English dictionary
20+
'another cool t9n', 'another cool translation'`
1621

17-
- meteorPackage: This is way it has been used in former versions as a meteor package.
18-
- meteorNpm: Use t9n as npm package within Meteor.
22+
### Register Tracker (optional and client only)
23+
`T9n.setTracker require 'meteor/tracker'`
1924

20-
## Installation
21-
```meteor add softwarerero:accounts-t9n```
25+
### Register `t9n` template helper (client only, this was done automatically before)
26+
`Template.registerHelper 't9n', (x, params) -> T9n.get(x, true, params.hash)`
2227

23-
## Starting from Version 2.2.0 the dependencies to `coffeescript` and `tracker` are optional, so you can bring your own, see examples for this.
24-
25-
Off course one can easily add translations for applications. By putting a file like ```myapp.es``` in a folder under ```lib``` translations can be used on the client and on the server. Example:
26-
27-
``` myapp.es
28-
es =
29-
meteor: "meteoro"
30-
T9n.map "es", es
31-
```
3228

3329
# API
3430

Diff for: package.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package.describe({
22
summary: "Almost i18n, with standard translations for basic meteor packages.",
3-
version: "2.2.1",
3+
version: "2.3.0",
44
name: "softwarerero:accounts-t9n",
55
git: "https://github.com/softwarerero/meteor-accounts-t9n.git",
66
});

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "meteor-accounts-t9n",
3-
"version": "2.2.1",
3+
"version": "2.3.0",
44
"description": "Translations for Meteor projects, almost i18n",
55
"repository": "https://github.com/softwarerero/meteor-accounts-t9n",
66
"bugs": "https://github.com/softwarerero/meteor-accounts-t9n/issues",

Diff for: smart.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"description": "Translations for the meteor account's error messages",
44
"homepage": "https://github.com/softwarerero/meteor-accounts-t9n",
55
"author": "Stefan Undorf <[email protected]>",
6-
"version": "2.2.1",
6+
"version": "2.3.0",
77
"git": "https://github.com/softwarerero/meteor-accounts-t9n.git",
88
"packages": {}
99
}

0 commit comments

Comments
 (0)