ember-i18n support for ember-changeset-validations messages
Switch branches/tags
greenkeeper/ember-changeset-validations-1.3.1 greenkeeper/ember-changeset-validations-1.3.2 greenkeeper/ember-changeset-validations-1.3.3 greenkeeper/ember-changeset-validations-pin-1.3.0 greenkeeper/ember-cli-3.1.3 greenkeeper/ember-cli-3.5.0 greenkeeper/ember-cli-3.5.1 greenkeeper/ember-cli-3.6.0 greenkeeper/ember-cli-htmlbars-inline-precompile-1.0.4 greenkeeper/ember-cli-htmlbars-inline-precompile-1.0.5 greenkeeper/ember-cli-htmlbars-inline-precompile-2.0.0 greenkeeper/ember-cli-htmlbars-inline-precompile-2.1.0 greenkeeper/ember-cli-htmlbars-inline-precompile-pin-1.0.3 greenkeeper/ember-cli-inject-live-reload-2.0.0 greenkeeper/ember-cli-inject-live-reload-2.0.1 greenkeeper/ember-data-3.5.0 greenkeeper/ember-data-3.5.1 greenkeeper/ember-data-3.5.2 greenkeeper/ember-data-3.6.0 greenkeeper/ember-load-initializers-2.0.0 greenkeeper/ember-source-3.5.0 greenkeeper/ember-source-3.5.1 greenkeeper/ember-source-3.6.0 greenkeeper/eslint-config-prettier-3.0.0 greenkeeper/eslint-config-prettier-3.0.1 greenkeeper/eslint-config-prettier-3.1.0 greenkeeper/eslint-config-prettier-3.2.0 greenkeeper/eslint-config-prettier-3.3.0 greenkeeper/eslint-plugin-ember-6.0.0 greenkeeper/eslint-plugin-ember-6.0.1 greenkeeper/eslint-plugin-ember-6.1.0 greenkeeper/eslint-plugin-node-7.0.0 greenkeeper/eslint-plugin-node-7.0.1 greenkeeper/eslint-plugin-node-8.0.0 greenkeeper/eslint-plugin-prettier-2.7.0 greenkeeper/eslint-plugin-prettier-3.0.0 greenkeeper/eslint-plugin-prettier-pin-2.6.2 greenkeeper/prettier-1.14.3 greenkeeper/prettier-1.15.0 greenkeeper/prettier-1.15.1 greenkeeper/prettier-1.15.2 greenkeeper/prettier-1.15.3 greenkeeper/prettier-pin-1.14.2 master
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci
addon
app
config
tests
.editorconfig
.ember-cli
.eslintrc.js
.gitignore
.prettierrc.json
.watchmanconfig
LICENSE
README.md
ember-cli-build.js
index.js
package.json
testem.js
yarn.lock

README.md

ember-i18n-changeset-validations

CircleCI Coveralls branch npm Ember Ember Observer Score Greenkeeper badge

Adds support for ember-i18n to ember-changeset-validations

ember-i18n-changeset-validations is a companion validation library to ember-changeset-validations. This addon adds the ability to translate ember-changeset-validation messages using the ember-i18n addon. Since ember-changeset is required to use this addon, please see documentation there on how to use changeset.

Usage

To install: ember install ember-i18n-changeset-validations.

This addon also provides ember-changeset-validations (and ember-changeset) as dependencies.

Define ember-i18n translation files for the validation messages files in app/locales/<LANG_CODE>/validations.js (where LANG_CODE is an ISO language code).

An example of an ember-i18n translation file, showing a translation key that will replace the default "between" message from ember-changeset-validations.

// app/locales/en/validations.js
export default {
  /* overrides for ember-changeset-validation messages
   * see: ember-changeset-validations/utils/messages
   */
  between: "{description} must be between{min} and {max} characters",
};

An example of a Japanese validation message.

// app/locales/ja/validations.js
export default {
  /* overrides for ember-changeset-validation messages
   * see: ember-changeset-validations/utils/messages
   */
  between: "{description}は{min}〜{max}文字の間でなければなりません",
};

For each locale (en & ja in this example), import the validations translation module into the main ember-i18n manifest, located in app/locales/<LANG_CODE>/translations.js.

e.g English translations manifest file.

// app/locales/en/validations.js
import validations from "./validations";
// other imports

export default {
  // other translation objects
  validations
};

e.g. Japanese translations manifest file.

// app/locales/ja/validations.js
import validations from "./validations";
// other imports

export default {
  // other translation objects
  validations
};

Installation

  • git clone <repository-url> this repository
  • cd ember-i18n-changeset-validations
  • yarn

Running

Running Tests

  • yarn test (Runs ember try:each to test your addon against multiple Ember versions)
  • ember test Runs the test suite on the current Ember version
  • ember test --server Runs the test suite in "watch mode"

Building

  • ember build

For more information on using ember-cli, visit https://ember-cli.com/.

License

This project is licensed under the MIT License.