sails-stringfile / 0.3.2 last updated 10 months ago created on Jan 17th 2014

Install

npm install --save sails-stringfile

Clone

git clone git@github.com:balderdashy/sails-stringfile.git

dependencies

main colors 1.0.3 MIT
lodash 2.4.1 MIT

maintainers

balderdashy

versions

0.3.2 10 months ago balderdashy
0.3.1 10 months ago balderdashy
0.2.0 10 months ago balderdashy
0.1.0 10 months ago balderdashy
0.0.1 10 months ago balderdashy
551 Downloads yesterday.

readme

sails-stringfile

Localized stringfile containing messages used in Sails command-line interface and runtime. This is one part of the effort towards making Sails more accessible to non-native English readers/speakers.

How This Module Works

These files are here for future use-- this project is an early-stage work in progress.

  • Environment variables are used to determine a user's locale. (defaults to English)

Usage

1
2
3
4
5
6
7
8
9
// From Sails core, an adapter, a generator, a hook, or some other dependency:
var STRINGFILE = require('sails-stringfile');

// Internally, this module runs node's native `util.format()` method,
// so you can also template strings:
var localizedMessage = STRINGFILE('cli.new.success', ['myApp', {some:'stuff'}, 'more stuff'])

// Then, appropriate msg is brought in auf deutsch, espanol, traditional chinese, english, etc.
console.log(localizedMessage);

Languages

Current language support targets are:

  • English
  • French
  • Spanish
  • Traditional Chinese
  • German

(please send a PR if you have a request and we'll add it to this list!)

How Can I Help?

  • The existing strings need to be pulled out of log messages and errors in:

    • sails core
    • anchor core
    • waterline core
    • sails-generate-*
    • sails-hook-*
    • sails-adapter-* (adapters)
  • Code comments and other support files (like README) in newly generated sails modules (or a new project) should be pulled out into the generator scope and brought in using the same mechanism. This is only relevant for generators:

    • sails-generate-new
    • sails-generate-frontend
    • sails-generate-backend
    • sails-generate-views
    • sails-generate-gruntfile
    • sails-generate-controller
    • sails-generate-model
    • sails-generate-generator
  • A stringfile needs to be created in the locales in this repository for each language we want to support, mapping the string keys to a reasonable log message in the target language (the English stringfile is a good reference to see how a particular type of message should be worded, etc.).

License

MIT c. Mike McNeil 2014

Resolving all dependencies.. This could take a while as our cache is not yet fully warmed up.