From 9a1e81f730b334b3d048bd553415271f130e3e45 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Mon, 22 Feb 2016 12:33:01 +0100 Subject: [PATCH] support plugin locales --- app/coffee/app.coffee | 3 ++ app/locales/taiga/locale-en.json | 64 -------------------------------- gulpfile.js | 18 ++++++++- package.json | 1 + 4 files changed, 21 insertions(+), 65 deletions(-) diff --git a/app/coffee/app.coffee b/app/coffee/app.coffee index 2a860aea..e5fca90a 100644 --- a/app/coffee/app.coffee +++ b/app/coffee/app.coffee @@ -580,6 +580,9 @@ i18nInit = (lang, $translate) -> init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $navUrls, appMetaService, projectService, loaderService, navigationBarService) -> $log.debug("Initialize application") + $rootscope.$on '$translatePartialLoaderStructureChanged', () -> + $translate.refresh() + # Checksley - Extra validators validators = { linewidth: (val, width) -> diff --git a/app/locales/taiga/locale-en.json b/app/locales/taiga/locale-en.json index 0e9aa7da..138fdb09 100644 --- a/app/locales/taiga/locale-en.json +++ b/app/locales/taiga/locale-en.json @@ -1480,69 +1480,5 @@ "ACTION_TITLE": "Search", "RESULTS": "Search results" } - }, - "SUBSCRIPTIONS": { - "PLAN": "Plan", - "PLAN_STARTING": "Active Plans starting April 30, 2016", - "YOUR_PLAN": "Your plan", - "YOUR_RECOMMENDED_PLAN": "Your recommended plan", - "WANT_PLAN": "I want it!", - "UPDATE_PLAN": "Update Plan", - "PRIVATE_PROJECTS_LIMIT": "Up to {{number}} private projects + Unlimited public projects", - "MEMBERS_LIMIT": "Up to {{number}} members per private project", - "CONTACT_SUBSCRIBE": "Subscribe to this plan by contacting us at support@taiga.io", - "FREQUENCY_MONTH": "month", - "FREQUENCY_YEAR": "year", - "HELP": { - "WHY": "Why do we recommend this plan?", - "NO_PROJECTS": "Currently you have no private projects, so the plan that fits for you is the {{name}} plan.", - "FEW_PROJECTS": "You just have {{private_num}} private project, so the plan that fits for you is the {{name}} plan.", - "NUM_PROJECTS": "You own {{private_num}} private projects and {{public_num}} public projects, so the plan that better fits for you is the {{plan}} Plan.", - "NUM_PROJECTS_CUSTOM": "You own {{private_num}} private projects and {{public_num}} public projects, so the plan that better fits for you is the Custom Plan.", - "SUBSCRIBE": "You can already ensure the privacity of your projects subscribing the recommended plan, or that better fits for your use. You have until April, 30th to select your plan. You don't need to pay anything until then!", - "UPGRADE": "You can upgrade your plan if you need it.", - "ACTIVATION": "On 30th April we will activate the paid plans. If you have more than 1 provate project you could keep its privacity making the payment for the plan that better fits for you.", - "PAYMENT": "After April 30th, if you are not subscribed to a plan, your private projects will be temporarily blocked. Do not worry, we will not delete them, its just that we cannot decide for you what to do with your projects and we will wait for your decission", - "PUBLIC": "We love to share, so if you keep your projects public, it will be completely free.", - "MORE_INFO_TITLE": "Frequently Asked Questions", - "MORE_INFO": "More info (FAQ)" - }, - "PAYMENT_HISTORY": { - "TITLE": "Payment History", - "FREE": "Free until April, 30th", - "CHANGE_DATA": "Change payment data" - }, - "PLANS_SELECTOR": { - "TITLE": "What plan do you need?", - "FREE": "Enjoy free plans until 30th April", - "CURRENT": "Current Plan", - "RECOMMENDED": "Recommended Plan", - "CUSTOM": "Custom", - "CONTACT": "Do you need more than 25 users per projects? We have custom plan for enterprises. Get in touch with us at support@taiga.io" - }, - "DOWNGRADE": { - "TITLE": "Downgrade", - "IMAGE_ALT": "Downgrading a plan", - "REASON": "You own more private projects or users per project than the maximum allowed by this plan. Your selected plan only allows {{projects}} private projects and {{members}} members per private project, so if you want to change to the {{plan}} plan you should make the following changes", - "MORE_PROJECTS": "If you have more than {{projects}} private projects", - "MORE_PROJECTS_OPTION1": "Keep {{projects}} private projects as maximum and set the others as public", - "MORE_PROJECTS_OPTION2": "Keep {{projects}} private projects and delete the others", - "MORE_PROJECTS_OPTION3": "Transfer the property of the private projects to another person that has capacity to own more projects", - "MORE_PROJECTS_OPTION4": "Or a combination of the above options", - "MORE_MEMBERS": "If you have more than {{members}} members per private project", - "MORE_MEMBERS_OPTION1": "Have a maximum of {{members}} members in all your private projects", - "ACCEPT": "Ok, understood" - }, - "SELECT_PLAN": { - "TITLE": "Subscribe to a plan", - "SUBTITLE": "You will not billed anything. Enjoy your plan for free until April, 30th", - "YOUR_NEW_PLAN": "Your new plan", - "INTERVAL": "After the free period How would you like to pay?", - "PAY_MONTHLY": "Monthly", - "PAY_YEARLY": "Yeary", - "BACK": "Back", - "BACK_TITLE": "Back to select plans", - "CONTINUE": "Continue" - } } } diff --git a/gulpfile.js b/gulpfile.js index 03ee1164..1ea5bd33 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -28,6 +28,8 @@ var gulp = require("gulp"), livereload = require('gulp-livereload'), gulpFilter = require('gulp-filter'), addsrc = require('gulp-add-src'); + mergeStream = require('merge-stream'), + path = require('path'), coffeelint = require('gulp-coffeelint'); var argv = require('minimist')(process.argv.slice(2)); @@ -379,8 +381,22 @@ gulp.task("app-loader", function() { }); gulp.task("locales", function() { - return gulp.src(paths.locales) + var plugins = gulp.src(paths.app + "modules/**/locales/*.json") + .pipe(rename(function (localeFile) { + // rename app/modules/compiles-modules/tg-contrib/locales/locale-en.json + // to tg-contrib/locale-en.json + + var pluginPath = path.join(localeFile.dirname, '..'); + var pluginFolder = pluginPath.split('/').pop(); + + localeFile.dirname = pluginFolder; + })) .pipe(gulp.dest(paths.distVersion + "locales")); + + var core = gulp.src(paths.locales) + .pipe(gulp.dest(paths.distVersion + "locales")); + + return mergeStream(plugins, core); }); gulp.task("coffee-lint", function () { diff --git a/package.json b/package.json index 5e4eb334..ec26f476 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "karma-coffee-preprocessor": "^0.3.0", "karma-mocha": "^0.2.0", "karma-sourcemap-loader": "^0.3.4", + "merge-stream": "^1.0.0", "minimist": "^1.1.1", "mocha": "^2.2.4", "node-uuid": "^1.4.3",