Skip to content

Commit

Permalink
add en locale
Browse files Browse the repository at this point in the history
  • Loading branch information
johngruen committed Jan 12, 2017
1 parent 39b52ed commit 05ce7b1
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ media/
node_modules/
static/
tmp/
locales/en/

# Files to ignore within specific directories
addon/*.rdf
Expand Down
5 changes: 3 additions & 2 deletions frontend/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ module.exports = {
ENABLE_DEV_CONTENT: (process.env.ENABLE_DEV_CONTENT === '1'),
AVAILABLE_LOCALES: (process.env.ENABLE_DEV_LOCALES === '1') ?
// All locales on Pontoon for local & dev
fs.readdirSync('./locales').join(',') :
// en is copied from en-US at build time, so we have to add it special
'en,' + fs.readdirSync('./locales').join(',') :
// Enabled locales for stage & production - update as they reach 100%
'en-US,cs,de,dsb,es-ES,fr,fy-NL,hsb,hu,it,nl,pt-BR,ru,sv-SE,uk,zh-CN,zh-TW',
'en-US,en,cs,de,dsb,es-ES,fr,fy-NL,hsb,hu,it,nl,pt-BR,ru,sv-SE,uk,zh-CN,zh-TW',

// TODO: Move addon build to a better path
ADDON_SRC_PATH: './addon/',
Expand Down
11 changes: 11 additions & 0 deletions frontend/tasks/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@ gulp.task('content-experiments-data', function generateStaticAPITask() {
.pipe(gulp.dest(config.DEST_PATH));
});

// The next two tasks are hacks to copy the en-US locale
// to an en locale. See issue #2006 for background.
gulp.task('content-watch-en', () => {
gulp.watch('./locales/en-US/**/*', ['content-build-en']);
});

gulp.task('content-build-en', () => {
return gulp.src('./locales/en-US/**/*')
.pipe(gulp.dest('./locales/en'));
});

gulp.task('import-api-content', (done) => {
fetch(config.PRODUCTION_EXPERIMENTS_URL)
.then(response => response.json())
Expand Down
13 changes: 8 additions & 5 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,23 @@ gulp.task('clean', () => del([
config.DJANGO_OLD_STATIC
]));

gulp.task('build', [
'addon-copy-locales',
gulp.task('build', done => runSequence(
'content-build',
'content-build-en',
'addon-copy-locales',
'scripts-build',
'styles-build',
'images-build',
'assets-build',
'pages-build'
]);
'pages-build',
done
));

gulp.task('watch', [
'addon-watch-locales',
'self-watch',
'content-watch',
'content-watch-en',
'addon-watch-locales',
'scripts-watch',
'styles-watch',
'images-watch',
Expand Down

0 comments on commit 05ce7b1

Please sign in to comment.