forked from theoephraim/grunt-i18n-gspreadsheet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1bbc942
commit 8baf94a
Showing
8 changed files
with
180 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
node_modules | ||
npm-debug.log | ||
tmp | ||
tmp_* | ||
locales |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
{ | ||
"name": "grunt-i18n-gspreadsheet", | ||
"name": "grunt-i18n-spreadsheet", | ||
"description": "Grunt plugin to generate i18n locale files from a google spreadsheet", | ||
"version": "0.1.5", | ||
"homepage": "https://github.com/theoephraim/grunt-i18n-gspreadsheet", | ||
"homepage": "https://github.com/theoephraim/grunt-i18n-spreadsheet", | ||
"author": { | ||
"name": "Theo Ephraim", | ||
"email": "[email protected]" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/theoephraim/grunt-i18n-gspreadsheet.git" | ||
"url": "git://github.com/theoephraim/grunt-i18n-spreadsheet.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/theoephraim/grunt-i18n-gspreadsheet/issues" | ||
"url": "https://github.com/theoephraim/grunt-i18n-spreadsheet/issues" | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "MIT", | ||
"url": "https://github.com/theoephraim/grunt-i18n-gspreadsheet/blob/master/LICENSE-MIT" | ||
"url": "https://github.com/theoephraim/grunt-i18n-spreadsheet/blob/master/LICENSE-MIT" | ||
} | ||
], | ||
"main": "Gruntfile.js", | ||
|
@@ -31,18 +31,27 @@ | |
"grunt-contrib-jshint": "~0.6.0", | ||
"grunt-contrib-clean": "~0.4.0", | ||
"grunt-contrib-nodeunit": "~0.2.0", | ||
"grunt": "~0.4.1" | ||
"grunt": "~0.4.1", | ||
"grunt-contrib-connect": "~0.5.0" | ||
}, | ||
"peerDependencies": { | ||
"grunt": "~0.4.1" | ||
}, | ||
"keywords": [ | ||
"gruntplugin", "grunt", "i18n", "google", "spreadsheet", "gdocs", "locale" | ||
"gruntplugin", | ||
"grunt", | ||
"i18n", | ||
"google", | ||
"spreadsheet", | ||
"gdocs", | ||
"locale" | ||
], | ||
"dependencies": { | ||
"google-spreadsheet": "~0.2.5", | ||
"step": "0.0.5", | ||
"underscore": "~1.5.2", | ||
"mkdirp": "~0.3.5" | ||
"mkdirp": "~0.3.5", | ||
"request": "~2.27.0", | ||
"csv": "~0.3.6" | ||
} | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
key,en,fr,es,comments | ||
!test,en,fr,es,Must be the same as locale -- used for testing | ||
,hello,bonjour,hola,default (en) is empty for testing | ||
,goodbye,Au revoir,Adios, | ||
!newlineTest1,"This item | ||
has a newline in it.",,, | ||
!newlineTest2,"This item | ||
|
||
has 2 newlines in it.",,, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
'use strict'; | ||
|
||
var grunt = require('grunt'); | ||
var _ = require('underscore'); | ||
|
||
|
||
/* | ||
These tests use the test spreadsheet accessible at https://docs.google.com/spreadsheet/ccc?key=0Araic6gTol6SdEtwb1Badl92c2tlek45OUxJZDlyN2c#gid=0 | ||
It is read-only to the public. | ||
If you need to add something to it in order to test new features, please contact [email protected] to get write access to the doc. | ||
*/ | ||
|
||
exports.i18n_spreadsheet = { | ||
test_files: function(test) { | ||
// the "test" row of each spreadsheet has the key of each locale (en.test = "en") | ||
var test_locales = ['en','es','fr']; | ||
var types = ['gdocs', 'http', 'local']; | ||
test.expect( types.length * test_locales.length ); | ||
_(types).each(function(type){ | ||
_(test_locales).each(function(locale){ | ||
var translations = JSON.parse( grunt.file.read('tmp_' + type + '/'+locale+'.js') ); | ||
test.equal( translations['!test'], locale, locale+'.js file should have correct translation from google doc'); | ||
}); | ||
}); | ||
test.done(); | ||
}, | ||
test_default_translations: function(test){ | ||
// the spreasheet has en.hello as empty, but the default translation option should fill it anyway | ||
var types = ['gdocs', 'http', 'local']; | ||
test.expect(types.length); | ||
_(types).each(function(type){ | ||
var translations = JSON.parse( grunt.file.read('tmp_' + type + '/en.js') ); | ||
test.equal( translations.hello, 'hello', 'default translation should get filled from key column'); | ||
}); | ||
test.done(); | ||
} | ||
}; |