Add embedding locales in angular modules.
parent
ffcaade413
commit
311d7b9f53
|
@ -4,3 +4,4 @@ node_modules/
|
|||
app/vendor
|
||||
config/main.coffee
|
||||
bower_components
|
||||
app/coffee/modules/locales/locale*.coffee
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
###
|
||||
# Copyright (C) 2014 Andrey Antukh <niwi@niwi.be>
|
||||
# Copyright (C) 2014 Jesús Espino Garcia <jespinog@gmail.com>
|
||||
# Copyright (C) 2014 David Barragán Merino <bameda@dbarragan.com>
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# File: modules/locales.coffee
|
||||
###
|
||||
|
||||
module = angular.module("taigaLocales", [])
|
|
@ -32,6 +32,7 @@ paths = {
|
|||
sassMain: "app/styles/main.scss"
|
||||
css: "dist/styles/**/*.css"
|
||||
images: "app/images/**/*"
|
||||
locales: "app/locales/**/*.json"
|
||||
coffee: ["app/coffee/app.coffee",
|
||||
"config/main.coffee",
|
||||
"app/coffee/*.coffee",
|
||||
|
@ -51,7 +52,8 @@ vendorJsLibs = [
|
|||
"app/vendor/angular/angular.js",
|
||||
"app/vendor/angular-route/angular-route.js",
|
||||
"app/vendor/angular-sanitize/angular-sanitize.js",
|
||||
"app/vendor/angular-animate/angular-animate.js"
|
||||
"app/vendor/angular-animate/angular-animate.js",
|
||||
"app/vendor/i18next/i18next.js"
|
||||
]
|
||||
|
||||
|
||||
|
@ -128,14 +130,14 @@ gulp.task "jslibs", ->
|
|||
|
||||
gulp.task "locales", ->
|
||||
gulp.src("app/locales/en/app.json")
|
||||
.pipe(wrap("angular.module('locales.en', []).constant('locales.en', <%= contents %>);"))
|
||||
.pipe(rename("locale.en.coffee"))
|
||||
.pipe(gulp.dest("app/coffee/"))
|
||||
.pipe(wrap("angular.module('taigaLocales').constant('localesEnglish', <%= contents %>);"))
|
||||
.pipe(rename("localeEnglish.coffee"))
|
||||
.pipe(gulp.dest("app/coffee/modules/locales"))
|
||||
|
||||
gulp.src("app/locales/es/app.json")
|
||||
.pipe(wrap("angular.module('locales.es', []).constant('locales.es', <%= contents %>);"))
|
||||
.pipe(rename("locale.es.coffee"))
|
||||
.pipe(gulp.dest("app/coffee/"))
|
||||
# gulp.src("app/locales/es/app.json")
|
||||
# .pipe(wrap("angular.module('locales.es', []).constant('locales.es', <%= contents %>);"))
|
||||
# .pipe(rename("locale.es.coffee"))
|
||||
# .pipe(gulp.dest("app/coffee/"))
|
||||
|
||||
|
||||
##############################################################################
|
||||
|
@ -163,6 +165,7 @@ gulp.task "watch", ->
|
|||
gulp.watch(paths.jade, ["jade"])
|
||||
gulp.watch(paths.appStyles, ["scss-lint", "sass", "css"])
|
||||
gulp.watch(paths.coffee, ["coffee"])
|
||||
gulp.watch(paths.locales, ["locales"])
|
||||
|
||||
|
||||
gulp.task "express", ->
|
||||
|
@ -189,6 +192,7 @@ gulp.task "default", [
|
|||
"sass",
|
||||
"css",
|
||||
"copy",
|
||||
"locales",
|
||||
"coffee",
|
||||
"jslibs",
|
||||
"connect",
|
||||
|
|
Loading…
Reference in New Issue