sails-stringfile

translated/localized stringfiles containing messages from Sails core and dependencies

sails-stringfile

Localized stringfile containing messages used in Sails command-line interface and runtime.

This project is an early-stage work in progress to make all strings used in Sails humanLanguageAgnostic. That includes console messages, comments in generated code files, and even errors. This is a big project, but just one small part of the effort towards making Sails more accessible to non-native English readers/speakers.

How This Module Works

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

Usage

// 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.get('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 targetsare:

  • 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)

See the complete list of modules here: https://github.com/balderdashy/sails/blob/master/MODULES.md

  • 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 localesin 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

HomePage

https://github.com/balderdashy/sails-stringfile

Repository

https://github.com/balderdashy/sails-stringfile


上一篇:include-all
下一篇:sails.io.js-dist

相关推荐

  • 我该如何把鲍尔组件与sails.js?

    我该如何把鲍尔组件与sails.js?...

    2 年前
  • sails.js VS流星——两者的优点是什么?[关闭]

    sails.js VS流星——两者的优点是什么?关闭...

    2 年前
  • sails.io.js-dist

    Distribution version of sails.io.js for browsers, including bundled socket.ioclient. sails.io.jsdi...

    8 个月前
  • sails.io.js

    Javascript SDK for communicating w/ a Sails server via WebSockets/socket.io. (https://github.com/b...

    2 年前
  • sails-sqlserver

    SQL Server Adapter for Sails / Waterline SailsMSSQL Adapter MSSQL adapter for Sails framework a...

    4 个月前
  • sails-redis

    A lightweight Redis adapter for Sails / Waterline. sailsredis A lightweight Sails/Waterline adapt...

    5 个月前
  • sails-react

    Integration of fb react into sailsjs. sailsreact The aim of this plugin is to make the whole proce...

    8 个月前
  • sails-postgresql

    a PostgreSQL adapter for Waterline and Sails.js Sails PostgreSQL A Waterline(http://waterlinejs.o...

    4 个月前
  • sails-mysql

    MySQL adapter for Sails.js SailsMySQL Adapter MySQL adapter for the Sails framework and Waterlin...

    4 个月前
  • sails-mongo

    Mongo DB adapter for Sails.js/Waterline. Node.js and MongoDB on Sails.js/Waterline(https://camo.git...

    1 年前

官方社区

扫码加入 JavaScript 社区