-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit a73600a
Showing
14 changed files
with
3,503 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* Build automation scripts. | ||
* | ||
* @package CoCart | ||
*/ | ||
|
||
module.exports = function(grunt) { | ||
'use strict'; | ||
|
||
require( 'load-grunt-tasks' )( grunt ); | ||
|
||
// Project configuration. | ||
grunt.initConfig({ | ||
pkg: grunt.file.readJSON( 'package.json' ), | ||
|
||
// Setting directories. | ||
dirs: { | ||
php: 'includes' | ||
}, | ||
|
||
// Bump version numbers (replace with version in package.json) | ||
replace: { | ||
php: { | ||
src: [ | ||
'<%= dirs.php %>/class-<%= pkg.name %>.php' | ||
], | ||
overwrite: true, | ||
replacements: [ | ||
{ | ||
from: /public static \$version = \'.*.'/m, | ||
to: "public static $version = '<%= pkg.version %>'" | ||
} | ||
] | ||
}, | ||
package: { | ||
src: [ | ||
'load-package.php', | ||
], | ||
overwrite: true, | ||
replacements: [ | ||
{ | ||
from: /@version .*$/m, | ||
to: "@version <%= pkg.version %>" | ||
}, | ||
] | ||
} | ||
}, | ||
|
||
}); // END of Grunt modules. | ||
|
||
// Update version of package. | ||
grunt.registerTask( 'version', [ 'replace:php', 'replace:package' ] ); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<h1 align="center">CoCart - Language Package</h1> | ||
|
||
<p align="center"><img src="https://cocart.xyz/wp-content/uploads/2021/11/cocart-home-default.png.webp" alt="CoCart Logo" /></p> | ||
|
||
<br> | ||
|
||
This is a package for CoCart that provides language support. | ||
|
||
It is designed to be pulled in via Composer when CoCart is compiled for a plugin build release or as a standalone WordPress plugin. | ||
|
||
⚠️ This package is currently in development and maybe incomplete in this repository. Use at your own risk! ⚠️ | ||
|
||
## License | ||
|
||
Released under [GNU General Public License v3.0](http://www.gnu.org/licenses/gpl-3.0.html). | ||
|
||
--- | ||
|
||
## CoCart Channels | ||
|
||
We have different channels at your disposal where you can find information about the CoCart project, discuss it and get involved: | ||
|
||
[![Twitter: cocartapi](https://img.shields.io/twitter/follow/cocartapi?style=social)](https://twitter.com/cocartapi) [![CoCart GitHub Stars](https://img.shields.io/github/stars/co-cart/co-cart?style=social)](https://github.com/co-cart/co-cart) | ||
|
||
<ul> | ||
<li>📖 <strong>Docs</strong>: this is the place to learn how to use CoCart API. <a href="https://docs.cocart.xyz/#getting-started">Get started!</a></li> | ||
<li>🧰 <strong>Resources</strong>: this is the hub of all CoCart resources to help you build a headless store. <a href="https://cocart.dev/?utm_medium=gh&utm_source=github&utm_campaign=readme&utm_content=cocart">Get resources!</a></li> | ||
<li>👪 <strong>Community</strong>: use our Slack chat room to share any doubts, feedback and meet great people. This is your place too to share <a href="https://cocart.xyz/community/?utm_medium=gh&utm_source=github&utm_campaign=readme&utm_content=cocart">how are you planning to use CoCart!</a></li> | ||
<li>🐞 <strong>GitHub</strong>: we use GitHub for bugs and pull requests, doubts are solved with the community.</li> | ||
<li>🐦 <strong>Social media</strong>: a more informal place to interact with CoCart users, reach out to us on <a href="https://twitter.com/cocartapi">Twitter.</a></li> | ||
<li>💌 <strong>Newsletter</strong>: do you want to receive the latest plugin updates and news? Subscribe <a href="https://twitter.com/cocartapi">here.</a></li> | ||
</ul> | ||
|
||
--- | ||
|
||
## Credits | ||
|
||
CoCart Language Package is developed and maintained by [Sébastien Dumont](https://github.com/seb86). | ||
|
||
Founder of CoCart - [Sébastien Dumont](https://github.com/seb86). | ||
|
||
--- | ||
|
||
Website [sebastiendumont.com](https://sebastiendumont.com) · | ||
GitHub [@seb86](https://github.com/seb86) · | ||
Twitter [@sebd86](https://twitter.com/sebd86) | ||
|
||
<p align="center"> | ||
<img src="https://raw.githubusercontent.com/seb86/my-open-source-readme-template/master/a-sebastien-dumont-production.png" width="353"> | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
/* | ||
* Plugin Name: CoCart Language | ||
* Plugin URI: https://cocart.xyz | ||
* Description: Experimental plugin to add language support for CoCart. | ||
* Author: Sébastien Dumont | ||
* Author URI: https://sebastiendumont.com | ||
* Version: 1.0.0 | ||
* Text Domain: cocart-lang | ||
* Domain Path: /languages/ | ||
* Requires at least: 5.6 | ||
* Requires PHP: 7.4 | ||
* WC requires at least: 5.4 | ||
* WC tested up to: 6.7 | ||
* | ||
* @package CoCart Language | ||
*/ | ||
|
||
defined( 'ABSPATH' ) || exit; | ||
|
||
if ( ! defined( 'COCART_LANGUAGE_FILE' ) ) { | ||
define( 'COCART_LANGUAGE_FILE', __FILE__ ); | ||
} | ||
|
||
// Include the main CoCart Language Package class. | ||
if ( ! class_exists( 'CoCart\Language\Package', false ) ) { | ||
include_once untrailingslashit( plugin_dir_path( COCART_LANGUAGE_FILE ) ) . '/includes/class-cocart-language.php'; | ||
} | ||
|
||
/** | ||
* Returns the main instance of cocart_language and only runs if it does not already exists. | ||
* | ||
* @return cocart_language | ||
*/ | ||
if ( ! function_exists( 'cocart_language' ) ) { | ||
function cocart_language() { | ||
return CoCart\Language\Package::init(); | ||
} | ||
|
||
add_action( 'plugins_loaded', 'cocart_language', 0 ); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
{ | ||
"name": "co-cart/cocart-language", | ||
"description": "Experimental plugin to add language support for CoCart.", | ||
"homepage": "https://cocart.xyz", | ||
"type": "wordpress-plugin", | ||
"keywords": [ | ||
"wordpress", | ||
"package", | ||
"woocommerce" | ||
], | ||
"license": "MIT", | ||
"prefer-stable": true, | ||
"minimum-stability": "stable", | ||
"authors": [ | ||
{ | ||
"name": "Sébastien Dumont", | ||
"email": "[email protected]", | ||
"homepage": "https://sebastiendumont.com", | ||
"role": "Developer" | ||
} | ||
], | ||
"support": { | ||
"issues": "https://github.com/co-cart/cocart-language/issues" | ||
}, | ||
"autoload": { | ||
"classmap": [ | ||
"includes/" | ||
] | ||
}, | ||
"require": { | ||
"composer/installers": "2.1.1", | ||
"co-cart/cocart-sniffs": "0.0.2" | ||
}, | ||
"require-dev": { | ||
"squizlabs/php_codesniffer": "3.6.2" | ||
}, | ||
"scripts": { | ||
"phpcs": [ | ||
"phpcs -s -p" | ||
], | ||
"phpcs-pre-commit": [ | ||
"phpcs -s -p -n" | ||
], | ||
"phpcbf": [ | ||
"phpcbf . -p" | ||
] | ||
}, | ||
"extra": { | ||
"scripts-description": { | ||
"phpcs": "Analyze code against the WordPress coding standards with PHP_CodeSniffer", | ||
"phpcbf": "Fix coding standards warnings/errors automatically with PHP Code Beautifier" | ||
} | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"composer/installers": true, | ||
"dealerdirect/phpcodesniffer-composer-installer": true | ||
} | ||
} | ||
} |
Oops, something went wrong.