Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Commit

Permalink
Be able to require complete translations, or specific messages in all…
Browse files Browse the repository at this point in the history
… translations

Fixes #7.
Fixes #3.
Fixes #4.
Closes #27.
  • Loading branch information
jdforrester authored and Krinkle committed Sep 2, 2015
1 parent 21619cc commit 946d916
Show file tree
Hide file tree
Showing 15 changed files with 290 additions and 70 deletions.
24 changes: 12 additions & 12 deletions Gruntfile.js
Expand Up @@ -35,28 +35,28 @@ module.exports = function ( grunt ) {
documentationFile: 'documentation.json'
}
},
requireMetadata: {
src: 'test/requireMetadata',
disallowEmptyDocumentation: {
src: 'test/disallowEmptyDocumentation',
options: {
requireMetadata: false
disallowEmptyDocumentation: false
}
},
requireCompleteMessageDocumentation: {
src: 'test/requireCompleteMessageDocumentation',
disallowUnusedDocumentation: {
src: 'test/disallowUnusedDocumentation',
options: {
requireCompleteMessageDocumentation: false
disallowUnusedDocumentation: false
}
},
requireNonEmptyDocumentation: {
src: 'test/requireNonEmptyDocumentation',
requireCompleteMessageDocumentation: {
src: 'test/requireCompleteMessageDocumentation',
options: {
requireNonEmptyDocumentation: false
requireCompleteMessageDocumentation: false
}
},
requireNoUnusedDocumentation: {
src: 'test/requireNoUnusedDocumentation',
requireMetadata: {
src: 'test/requireMetadata',
options: {
requireNoUnusedDocumentation: false
requireMetadata: false
}
}
},
Expand Down
44 changes: 38 additions & 6 deletions README.md
Expand Up @@ -34,42 +34,74 @@ You can specify the targets and options for the task using the normal Grunt conf

For edge cases, you can set some path options:

### sourceFile
#### sourceFile
Type: `string`
Default value: `"en.json"`

The JSON file providing the primary messages.

### documentationFile
#### documentationFile
Type: `string`
Default value: `"qqq.json"`

The JSON file providing the documentation messages.

### requireMetadata
#### requireMetadata
Type: `boolean`
Default value: `true`

Whether to fail if message files don't have a `@metadata` meta-data key.

### requireCompleteMessageDocumentation
#### requireCompleteMessageDocumentation
Type: `boolean`
Default value: `true`

Whether to fail if any message is in the primary file but not documented.

### requireNonEmptyDocumentation
#### disallowEmptyDocumentation
Type: `boolean`
Default value: `true`

Whether to fail if any message is in the primary file but documented as a blank string.

### requireNoUnusedDocumentation
#### disallowUnusedDocumentation
Type: `boolean`
Default value: `true`

Whether to fail if any documented message isn't in the primary file.

#### disallowBlankTranslations
Type: `boolean`
Default value: `false`

Whether to fail if any message is translated as a blank string.

#### disallowDuplicateTranslations
Type: `boolean`
Default value: `false`

Whether to fail if any message is translated as identical to the original string.

#### disallowUnusedTranslations
Type: `boolean`
Default value: `false`

Whether to fail if any translated message isn't in the primary file.

#### requireCompleteTranslationLanguages
Type: `string[]`
Default value: `[]`
Example value: `[ 'fr', 'es' ]`

Languages on which to fail if any message in the primary file is missing.

#### requireCompleteTranslationMessages
Type: `string[]`
Default value: `[]`
Example value: `[ 'first-message-key', 'third-message-key' ]`

Messages on which to fail if missing in any provided language.


Example uses
--------------------
Expand Down

0 comments on commit 946d916

Please sign in to comment.