-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from wp-cli/rename
Rename to i18n-command
- Loading branch information
Showing
12 changed files
with
114 additions
and
62 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
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
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 |
---|---|---|
@@ -1,32 +1,43 @@ | ||
{ | ||
"name": "wp-cli/makepot-command", | ||
"description": "Create POT files for WordPress projects", | ||
"name": "wp-cli/i18n-command", | ||
"description": "Provides internationalization tools for WordPress projects.", | ||
"type": "wp-cli-package", | ||
"homepage": "https://github.com/wp-cli/makepot-command", | ||
"homepage": "https://github.com/wp-cli/i18n-command", | ||
"support": { | ||
"issues": "https://github.com/wp-cli/i18n-command/issues" | ||
}, | ||
"license": "MIT", | ||
"authors": [], | ||
"authors": [ | ||
{ | ||
"name": "Pascal Birchler", | ||
"homepage": "https://pascalbirchler.com/" | ||
} | ||
], | ||
"minimum-stability": "dev", | ||
"prefer-stable": true, | ||
"autoload": { | ||
"files": [ "makepot-command.php" ], | ||
"psr-4": { | ||
"WP_CLI\\Makepot\\": "src/" | ||
} | ||
"WP_CLI\\I18n\\": "src/" | ||
}, | ||
"files": [ | ||
"i18n-command.php" | ||
] | ||
}, | ||
"require": { | ||
"wp-cli/wp-cli": "^1.1.0", | ||
"gettext/gettext": "^4.4" | ||
}, | ||
"require-dev": { | ||
"wp-cli/wp-cli": "^1.1.0", | ||
"behat/behat": "~2.5" | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "1.x-dev" | ||
}, | ||
"bundled": true, | ||
"commands": [ | ||
"makepot" | ||
], | ||
"bundled": true | ||
"i18n", | ||
"i18n make-pot" | ||
] | ||
} | ||
} |
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
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,24 @@ | ||
<?php | ||
|
||
if ( ! class_exists( 'WP_CLI' ) ) { | ||
return; | ||
} | ||
|
||
$autoload = __DIR__ . '/vendor/autoload.php'; | ||
|
||
if ( file_exists( $autoload ) ) { | ||
require_once $autoload; | ||
} | ||
|
||
if ( class_exists( 'WP_CLI\Dispatcher\CommandNamespace' ) ) { | ||
WP_CLI::add_command( 'i18n', '\WP_CLI\I18n\Command_Namespace' ); | ||
} | ||
|
||
WP_CLI::add_command( 'i18n make-pot', '\WP_CLI\I18n\Makepot_Command', array( | ||
'before_invoke' => function() { | ||
$min_version = '5.4'; | ||
if ( version_compare( PHP_VERSION, $min_version, '<' ) ) { | ||
WP_CLI::error( "The `wp i18n make-pot` command requires PHP {$min_version} or newer." ); | ||
} | ||
} | ||
) ); |
This file was deleted.
Oops, something went wrong.
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,17 @@ | ||
<?php | ||
|
||
namespace WP_CLI\I18n; | ||
|
||
use WP_CLI\Dispatcher\CommandNamespace; | ||
|
||
/** | ||
* Provides internationalization tools for WordPress projects. | ||
* | ||
* ## EXAMPLES | ||
* | ||
* # Create a POT file for the WordPress plugin/theme in the current directory | ||
* $ wp i18n make-pot . languages/my-plugin.pot | ||
* | ||
*/ | ||
class Command_Namespace extends CommandNamespace { | ||
} |
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
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
namespace WP_CLI\Makepot; | ||
namespace WP_CLI\I18n; | ||
|
||
use Gettext\Generators\Po; | ||
use Gettext\Translations; | ||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
namespace WP_CLI\Makepot; | ||
namespace WP_CLI\I18n; | ||
|
||
use Gettext\Extractors\PhpCode; | ||
use Gettext\Translation; | ||
|
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
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
require: | ||
- makepot-command.php | ||
- i18n-command.php |