From 0ae02e4f09681faf022d8e5d68d2c5ccc44733de Mon Sep 17 00:00:00 2001 From: Aleksuei Riabtsev Date: Wed, 12 Nov 2014 14:48:57 -0500 Subject: [PATCH 1/8] Add option to add/override locale strings from RAMP core --- Gruntfile.coffee | 52 ++++++++++++++++++++++-------- package.json | 1 + src/locales/en-CA/translation.json | 6 ++++ src/locales/fr-CA/translation.json | 6 ++++ 4 files changed, 51 insertions(+), 14 deletions(-) create mode 100644 src/locales/en-CA/translation.json create mode 100644 src/locales/fr-CA/translation.json diff --git a/Gruntfile.coffee b/Gruntfile.coffee index f75c9db..c372483 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -1,7 +1,7 @@ fs = require("fs") module.exports = (grunt) -> - + @registerTask( 'default' 'Default task create a distribution package.' @@ -43,6 +43,7 @@ module.exports = (grunt) -> 'copy:assetsBuild' 'copy:proxyBuild' 'copy:localesBuild' + 'mergeLocales' 'copy:templatesBuild' 'notify:assets' ] @@ -226,7 +227,7 @@ module.exports = (grunt) -> contents = contents.replace 'js/lib/lib.js', 'js/lib/lib.min.js' contents = contents.replace 'css/lib/lib.css', 'css/lib/lib.min.css' contents = contents.replace 'css/theme.less.css', 'css/theme.less.min.css' - contents = contents.replace /((?=\/wet-boew\/)[^\"]+?\.)(js|css)/g, '$1min.$2' + contents = contents.replace(/((?=\/wet-boew\/)[^\"]+?\.)(js|css)/g, '$1min.$2') grunt.file.write file, contents ) @@ -314,6 +315,28 @@ module.exports = (grunt) -> done() ) + @registerTask( + 'mergeLocales' + 'INTERNAL' + -> + locales = ['en-CA', 'fr-CA'] + tasks = [] + + locales.forEach( + ( locale ) -> + grunt.config 'merge-json.locale-' + locale, + src: [ + 'build/locales/' + locale + '/translation.json' + 'src/locales/' + locale + '/translation.json' + ] + dest: 'build/locales/' + locale + '/translation.json' + + tasks.push 'merge-json:locale-' + locale + ) + + grunt.task.run tasks + ) + @registerTask( 'thanks' -> @@ -510,22 +533,13 @@ module.exports = (grunt) -> cwd: '<%= corepath %>src/locales' src: '**/*.json' dest: 'build/locales' - , - expand: true - cwd: 'src/locales' - src: '**/*.json' - dest: 'build/locales' ] localesDist: files: [ expand: true - cwd: '<%= corepath %>src/locales' - src: '**/*.json' - dest: 'dist/locales' - , - expand: true - cwd: 'src/locales' + #cwd: '<%= corepath %>src/locales' + cwd: 'build/locales' src: '**/*.json' dest: 'dist/locales' ] @@ -613,6 +627,15 @@ module.exports = (grunt) -> src: '**/*.*' dest: '<%= pkg.deployFolder %>/' + 'merge-json': + locales: + src: [ + '<%= corepath %>src/locales/en-CA/translation.json' + 'src/locales/en-CA/translation.json' + ] + dest: 'build/locales/en-CA/translation.json' + + assemble: options: data: [ @@ -639,7 +662,7 @@ module.exports = (grunt) -> i18next: countryCode: 'CA' debug: false - localePath: '<%= corepath %>src/locales' + localePath: 'build/locales' languages: ['en', 'fr'] ramp: @@ -1227,6 +1250,7 @@ module.exports = (grunt) -> @loadNpmTasks 'grunt-contrib-uglify' @loadNpmTasks 'grunt-contrib-watch' @loadNpmTasks 'grunt-contrib-yuidoc' + @loadNpmTasks 'grunt-merge-json' @loadNpmTasks 'grunt-docco' @loadNpmTasks 'grunt-hub' @loadNpmTasks 'grunt-jscs' diff --git a/package.json b/package.json index 8f86bb7..e96054c 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "grunt-contrib-uglify": "~0.4.0", "grunt-contrib-watch": "~0.6.1", "grunt-contrib-yuidoc": "~0.5.2", + "grunt-merge-json": "~0.9.5", "grunt-docco": "~0.3.3", "grunt-hub": "~0.7.0", "grunt-jscs": "~0.7.1", diff --git a/src/locales/en-CA/translation.json b/src/locales/en-CA/translation.json new file mode 100644 index 0000000..ce078a7 --- /dev/null +++ b/src/locales/en-CA/translation.json @@ -0,0 +1,6 @@ +{ + "page": { + "title": "Reusable Accessible Mapping Platform (RAMP) - Usability Theme", + "siteTitle": "Reusable Accessible Mapping Platform (RAMP) - Usability Theme" + } +} diff --git a/src/locales/fr-CA/translation.json b/src/locales/fr-CA/translation.json new file mode 100644 index 0000000..ca07ad9 --- /dev/null +++ b/src/locales/fr-CA/translation.json @@ -0,0 +1,6 @@ +{ + "page": { + "title": "Plateforme de cartographie accessible et réutilisable (PCAR) - thème de la convivialité", + "siteTitle": "Plateforme de cartographie accessible et réutilisable - thème de la convivialité" + } +} From 3a2f0c4cc7b2cddeeb1326283b3eeb0c46c228d2 Mon Sep 17 00:00:00 2001 From: Aleksuei Riabtsev Date: Thu, 13 Nov 2014 07:54:21 -0500 Subject: [PATCH 2/8] Update title to include theme name --- src/locales/en-CA/translation.json | 4 ++-- src/locales/fr-CA/translation.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/locales/en-CA/translation.json b/src/locales/en-CA/translation.json index ce078a7..c2e0c40 100644 --- a/src/locales/en-CA/translation.json +++ b/src/locales/en-CA/translation.json @@ -1,6 +1,6 @@ { "page": { - "title": "Reusable Accessible Mapping Platform (RAMP) - Usability Theme", - "siteTitle": "Reusable Accessible Mapping Platform (RAMP) - Usability Theme" + "title": "Reusable Accessible Mapping Platform (RAMP) - Intranet Theme", + "siteTitle": "Reusable Accessible Mapping Platform (RAMP) - Intranet Theme" } } diff --git a/src/locales/fr-CA/translation.json b/src/locales/fr-CA/translation.json index ca07ad9..39c9432 100644 --- a/src/locales/fr-CA/translation.json +++ b/src/locales/fr-CA/translation.json @@ -1,6 +1,6 @@ { "page": { - "title": "Plateforme de cartographie accessible et réutilisable (PCAR) - thème de la convivialité", - "siteTitle": "Plateforme de cartographie accessible et réutilisable - thème de la convivialité" + "title": "Plateforme de cartographie accessible et réutilisable (PCAR) - Thème d'intranet", + "siteTitle": "Plateforme de cartographie accessible et réutilisable - Thème d'intranet" } } From 2eea83eadc5dcf9f2735b03c59ad1c68684b753e Mon Sep 17 00:00:00 2001 From: Aleksuei Riabtsev Date: Thu, 13 Nov 2014 08:39:11 -0500 Subject: [PATCH 3/8] Update date modified to 3.0.1 release date --- site/pages/ramp.hbs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/pages/ramp.hbs b/site/pages/ramp.hbs index 016cc68..ef64478 100644 --- a/site/pages/ramp.hbs +++ b/site/pages/ramp.hbs @@ -1,7 +1,7 @@ --- { "altLangPrefix": "ramp", - "dateModified": "2014-09-22", + "dateModified": "2014-11-04", "sitesearch": "false", "breadcrumb": "false", "subsite_title": "false" From b01c6d2b7a5ca94325ff9ea196e06ba98008182a Mon Sep 17 00:00:00 2001 From: Aleksuei Riabtsev Date: Thu, 13 Nov 2014 09:42:09 -0500 Subject: [PATCH 4/8] Fix core config overriding local when building a dist package --- Gruntfile.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index c372483..66cb51f 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -445,13 +445,13 @@ module.exports = (grunt) -> configDist: files: [ expand: true - cwd: 'src' + cwd: '<%= corepath %>src' src: 'config.*.json' dest: 'dist/' # overrider core config with local if exists , expand: true - cwd: '<%= corepath %>src' + cwd: 'src' src: 'config.*.json' dest: 'dist/' ] From b70bc3ade9e65d43408a7f3f867e08a3247260a1 Mon Sep 17 00:00:00 2001 From: Aleksuei Riabtsev Date: Mon, 17 Nov 2014 12:58:53 -0500 Subject: [PATCH 5/8] Switch RAMP dependency to develop branch --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index d0eb1e4..30fda07 100644 --- a/bower.json +++ b/bower.json @@ -24,7 +24,7 @@ "./lib" ], "dependencies": { - "ramp-pcar": "https://github.com/RAMP-PCAR/RAMP-PCAR.git#v3.0.1", + "ramp-pcar": "https://github.com/RAMP-PCAR/RAMP-PCAR.git/archive/develop.zip", "theme-gc-intranet": "https://github.com/wet-boew/theme-gc-intranet.git#4.0.5" }, "moduleType": [ From 12a125c495b822ae381b707e0cf92b8ebc670edc Mon Sep 17 00:00:00 2001 From: Aleksuei Riabtsev Date: Tue, 18 Nov 2014 14:26:00 -0500 Subject: [PATCH 6/8] Add grunt bump task Usage: $ grunt bump >> Version bumped to 0.0.2 $ grunt bump:patch >> Version bumped to 0.0.3 $ grunt bump:minor >> Version bumped to 0.1.0 $ grunt bump:major >> Version bumped to 1.0.0 $ grunt bump:prerelease >> Version bumped to 1.0.0-1 $ grunt bump:patch >> Version bumped to 1.0.1 --- Gruntfile.coffee | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index 66cb51f..da58294 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -1232,7 +1232,15 @@ module.exports = (grunt) -> options: output: '<%= corepkg.ramp.docco.outdir %>' - + bump: + options: + files: [ + 'package.json' + 'bower.json' + ] + commit: false + createTag: false + push: false # These plugins provide necessary tasks. @loadNpmTasks 'assemble' @@ -1253,6 +1261,7 @@ module.exports = (grunt) -> @loadNpmTasks 'grunt-merge-json' @loadNpmTasks 'grunt-docco' @loadNpmTasks 'grunt-hub' + @loadNpmTasks 'grunt-bump' @loadNpmTasks 'grunt-jscs' @loadNpmTasks 'grunt-json-minify' @loadNpmTasks 'grunt-newer' From b6d0e01671c83e750d96744cf0dbb474d9ac484b Mon Sep 17 00:00:00 2001 From: Aleksuei Riabtsev Date: Wed, 19 Nov 2014 09:05:36 -0500 Subject: [PATCH 7/8] Update grunt bump task to commit automagically --- Gruntfile.coffee | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Gruntfile.coffee b/Gruntfile.coffee index da58294..eac4f18 100644 --- a/Gruntfile.coffee +++ b/Gruntfile.coffee @@ -1238,7 +1238,12 @@ module.exports = (grunt) -> 'package.json' 'bower.json' ] - commit: false + commitFiles: [ + 'package.json' + 'bower.json' + ] + commit: true + commitMessage: 'Release v%VERSION%', createTag: false push: false From 9962276a36391069ffa3968fe64c6d514ccbe450 Mon Sep 17 00:00:00 2001 From: Aleksuei Riabtsev Date: Wed, 19 Nov 2014 09:16:59 -0500 Subject: [PATCH 8/8] Release v3.0.2 --- bower.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bower.json b/bower.json index 30fda07..e90355a 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "ramp-theme-intranet", - "version": "3.0.1", + "version": "3.0.2", "homepage": "http://ramp-pcar.github.io", "authors": [ "BeSD - SA Team" @@ -24,7 +24,7 @@ "./lib" ], "dependencies": { - "ramp-pcar": "https://github.com/RAMP-PCAR/RAMP-PCAR.git/archive/develop.zip", + "ramp-pcar": "https://github.com/RAMP-PCAR/RAMP-PCAR.git#v3.0.2", "theme-gc-intranet": "https://github.com/wet-boew/theme-gc-intranet.git#4.0.5" }, "moduleType": [ diff --git a/package.json b/package.json index e96054c..9992a75 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ramp-theme-intranet", "subname": "Reusable Accessible Mapping Platform - Intranet Theme", - "version": "3.0.1", + "version": "3.0.2", "description": "RAMP GIS viewer - Canada Goose; Sample of an implementation of RAMP with Intranet Theme", "main": "index.js", "url": "http://tfs.int.ec.gc.ca:8080/tfs/dc/_git/RAMP",