Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix some translated strings and add Grunt toolchain for translation files #101

Merged
merged 2 commits into from
Apr 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
128 changes: 78 additions & 50 deletions wp-content/themes/caribbean/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,54 +1,82 @@
module.exports = function(grunt) {
'use strict';

// Load all tasks
require('load-grunt-tasks')(grunt);
// Show elapsed time
require('time-grunt')(grunt);

// Force use of Unix newlines
grunt.util.linefeed = '\n';

// Find what the current theme's directory is, relative to the WordPress root
var path = process.cwd().replace(/^[\s\S]+\/wp-content/, "\/wp-content");

var cssLessFiles = {
'css/child-style.css': 'less/style.less',
'homepages/assets/css/homepage.css': 'homepages/assets/less/homepage.less'
};

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

less: {
compile: {
options: {
paths: [
'less'
],
outputSourceFiles: true,
sourceMapBasepath: path,
compress: true
},
files: cssLessFiles
}
},

watch: {
less: {
files: [
'less/*.less',
'homepages/assets/less/*.less',
'use strict';

// Load all tasks
require('load-grunt-tasks')(grunt);
// Show elapsed time
require('time-grunt')(grunt);

// Force use of Unix newlines
grunt.util.linefeed = '\n';

// Find what the current theme's directory is, relative to the WordPress root
var path = process.cwd().replace(/^[\s\S]+\/wp-content/, "\/wp-content");

var cssLessFiles = {
'css/child-style.css': 'less/style.less',
'homepages/assets/css/homepage.css': 'homepages/assets/less/homepage.less'
};

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

less: {
compile: {
options: {
paths: [
'less'
],
tasks: [
'less:compile',
]
outputSourceFiles: true,
sourceMapBasepath: path,
compress: true
},
files: cssLessFiles
}
},

shell: {
msgmerge: {
command: [
'msgmerge -o lang/es_ES.po.merged lang/es_ES.po lang/caribbean.pot',
'mv lang/es_ES.po.merged lang/es_ES.po'
].join('&&')
},
pot: {
command: [
'wp i18n make-pot . lang/largo.pot'
].join('&&'),
options: {
stdout: true
}
},
},

watch: {
less: {
files: [
'less/*.less',
'homepages/assets/less/*.less',
],
tasks: [
'less:compile',
]
}
},

po2mo: {
files: {
src: 'lang/*.po',
expand: true
}
});

// Build assets, docs and language files
grunt.registerTask('default', 'Build less files', [
'less',
]);
}
}

});

// Build assets, docs and language files
grunt.registerTask('default', 'Build less files', [
'less',
'shell:pot',
'shell:msgmerge',
'po2mo'
]);
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function caribbean_group_block_fact_box_styling_init() {
'core/group',
array(
'name' => 'fact-box',
'label' => __( 'Fact Box' ),
'label' => __( 'Fact Box', 'caribbean' ),
'style_handle' => 'fact-box',
)
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function caribbean_post_selector_block_init() {
'core/group',
array(
'name' => 'post-group',
'label' => __( 'Post Group' ),
'label' => __( 'Post Group', 'caribbean' ),
'style_handle' => 'post-group',
)
);
Expand Down Expand Up @@ -68,4 +68,4 @@ function caribbean_post_selector_block_callback( $attributes, $content ) {

}

}
}
Empty file.
Empty file.
Empty file.
1 change: 1 addition & 0 deletions wp-content/themes/caribbean/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"grunt-contrib-less": "^2.0.0",
"grunt-contrib-uglify": "^4.0.1",
"grunt-contrib-watch": "^1.1.0",
"@floatwork/grunt-po2mo": "~0.3.0",
"grunt-shell": ">=0.2.1",
"load-grunt-tasks": "^5.1.0",
"time-grunt": "^1.2.2"
Expand Down
2 changes: 1 addition & 1 deletion wp-content/themes/largo
Submodule largo updated from f50df1 to 590181