Skip to content

Commit

Permalink
Update text domain. (woocommerce#1795)
Browse files Browse the repository at this point in the history
* Translation call text domain change from “wc-admin” to “woocommerce-admin”.

* Fix .pot file generation.

* Fix errantly closed array item in /revenue/stats controller.

* Rename plugin zip, main file, and repo name to "woocommerce-admin".
  • Loading branch information
jeffstieler authored Mar 13, 2019
1 parent 8a4c3cd commit 0f20052
Show file tree
Hide file tree
Showing 188 changed files with 1,641 additions and 1,599 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build-module
build-style
languages/*
!languages/README.md
wc-admin.zip
woocommerce-admin.zip
includes/feature-config.php

# Directories/files that may appear in your environment
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ node_js:

before_script:
- phpenv config-rm xdebug.ini
- export PATH="$WP_CORE_DIR/wp-content/plugins/wc-admin/vendor/bin:$PATH"
- export PATH="$WP_CORE_DIR/wp-content/plugins/woocommerce-admin/vendor/bin:$PATH"
- bash bin/install-wp-tests.sh wc_admin_test root '' localhost $WP_VERSION
- bash bin/travis.sh before
- node --version
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ There are many ways to contribute – reporting bugs, feature suggestions, and f

## Reporting Bugs, Asking Questions, Sending Suggestions

Open [a GitHub issue](https://github.com/woocommerce/wc-admin/issues/new/choose), that's all. If you have write access, add any appropriate labels.
Open [a GitHub issue](https://github.com/woocommerce/woocommerce-admin/issues/new/choose), that's all. If you have write access, add any appropriate labels.

If you're filing a bug, specific steps to reproduce are always helpful. Please include what you expected to see and what happened instead.

Expand All @@ -21,7 +21,7 @@ If you're a first-time code contributor to the repository, here's a quick guide
1. Fork the repo to your own account.
2. Clone your fork into the `wp-content/plugins` directory of your preferred WordPress development environment.
3. Don't forget to create a branch to keep your changes. (`git checkout -b add/my-cool-thing`).
4. From the `wc-admin` plugin directory, build with `npm install` and `npm start`.
4. From the `woocommerce-admin` plugin directory, build with `npm install` and `npm start`.
5. Visit your dev environment in the browser to enable the `WooCommerce Admin` plugin and try it out.

Tips:
Expand Down
6 changes: 3 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ module.exports = function( grunt ) {
options: {
domainPath: '/languages',
exclude: [ '\.git/*', 'bin/*', 'node_modules/*', 'tests/*' ],
mainFile: 'wc-admin.php',
potFilename: 'wc-admin.pot',
mainFile: 'woocommerce-admin.php',
potFilename: 'woocommerce-admin.pot',
potHeaders: {
poedit: true,
'x-poedit-keywordslist': true
Expand All @@ -24,7 +24,7 @@ module.exports = function( grunt ) {

checktextdomain: {
options:{
text_domain: 'wc-admin',
text_domain: 'woocommerce-admin',
keywords: [
'__:1,2d',
'_e:1,2d',
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This is a feature plugin for a modern, javascript-driven WooCommerce Admin exper

---

:warning: This project is in active development, and is not ready for general use. You can follow the features in development by looking at the [project's issues](https://github.com/woocommerce/wc-admin/issues). **We do not recommend running this on production sites.**
:warning: This project is in active development, and is not ready for general use. You can follow the features in development by looking at the [project's issues](https://github.com/woocommerce/woocommerce-admin/issues). **We do not recommend running this on production sites.**

---

Expand All @@ -20,7 +20,7 @@ After cloning the repo, install dependencies with `npm install`. Now you can bui

- `npm run build` : Build a production version
- `npm start` : Build a development version, watch files for changes
- `npm run build:release` : Build a WordPress plugin ZIP file (`wc-admin.zip` will be created in the repository root)
- `npm run build:release` : Build a WordPress plugin ZIP file (`woocommerce-admin.zip` will be created in the repository root)

There are also some helper scripts:

Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = function( api ) {
[
'@wordpress/babel-plugin-makepot',
{
output: 'languages/wc-admin.pot',
output: 'languages/woocommerce-admin.pot',
},
],
],
Expand Down
8 changes: 4 additions & 4 deletions bin/build-plugin-zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ build_files=$(ls dist/*/*.{js,css})

# Generate the plugin zip file.
status "Creating archive... 🎁"
zip -r wc-admin.zip \
wc-admin.php \
zip -r woocommerce-admin.zip \
woocommerce-admin.php \
lib/*.php \
includes/*.php \
includes/**/*.php \
images/* \
$build_files \
languages/wc-admin.pot \
languages/wc-admin.php \
languages/woocommerce-admin.pot \
languages/woocommerce-admin.php \
readme.txt

success "Done. You've built WooCommerce Admin! 🎉 "
2 changes: 1 addition & 1 deletion bin/phpcs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if [[ ${RUN_PHPCS} == 1 ]]; then

if [ "$CHANGED_FILES" != "" ]; then
echo "Running Code Sniffer."
cd "$WP_CORE_DIR/wp-content/plugins/wc-admin/"
cd "$WP_CORE_DIR/wp-content/plugins/woocommerce-admin/"
./vendor/bin/phpcs --encoding=utf-8 -n -p $CHANGED_FILES
fi
fi
2 changes: 1 addition & 1 deletion bin/phpunit.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
WORKING_DIR="$PWD"
cd "$WP_CORE_DIR/wp-content/plugins/wc-admin/"
cd "$WP_CORE_DIR/wp-content/plugins/woocommerce-admin/"
phpunit --version
phpunit -c phpunit.xml.dist
TEST_RESULT=$?
Expand Down
2 changes: 1 addition & 1 deletion bin/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
if [ $1 == 'before' ]; then

if [[ ${RUN_PHPCS} == 1 ]]; then
cd "$WP_CORE_DIR/wp-content/plugins/wc-admin/"
cd "$WP_CORE_DIR/wp-content/plugins/woocommerce-admin/"
# This can (currently) only run for PHP 7.1+
composer install
fi
Expand Down
2 changes: 1 addition & 1 deletion client/analytics/components/leaderboard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class Leaderboard extends Component {
return (
<Card title={ title } className="woocommerce-leaderboard">
<EmptyTable>
{ __( 'No data recorded for the selected time period.', 'wc-admin' ) }
{ __( 'No data recorded for the selected time period.', 'woocommerce-admin' ) }
</EmptyTable>
</Card>
);
Expand Down
4 changes: 2 additions & 2 deletions client/analytics/components/report-chart/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ export class ReportChart extends Component {
const allowedIntervals = getAllowedIntervalsForQuery( query );
const formats = getDateFormatsForInterval( currentInterval, primaryData.data.intervals.length );
const emptyMessage = emptySearchResults
? __( 'No data for the current search', 'wc-admin' )
: __( 'No data for the selected date range', 'wc-admin' );
? __( 'No data for the current search', 'woocommerce-admin' )
: __( 'No data for the selected date range', 'woocommerce-admin' );
return (
<Chart
allowedIntervals={ allowedIntervals }
Expand Down
8 changes: 4 additions & 4 deletions client/analytics/components/report-error/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ class ReportError extends Component {
let title, actionLabel, actionURL, actionCallback;

if ( isError ) {
title = __( 'There was an error getting your stats. Please try again.', 'wc-admin' );
actionLabel = __( 'Reload', 'wc-admin' );
title = __( 'There was an error getting your stats. Please try again.', 'woocommerce-admin' );
actionLabel = __( 'Reload', 'woocommerce-admin' );
actionCallback = () => {
// @todo Add tracking for how often an error is displayed, and the reload action is clicked.
window.location.reload();
};
} else if ( isEmpty ) {
title = __( 'No results could be found for this date range.', 'wc-admin' );
actionLabel = __( 'View Orders', 'wc-admin' );
title = __( 'No results could be found for this date range.', 'woocommerce-admin' );
actionLabel = __( 'View Orders', 'woocommerce-admin' );
actionURL = getAdminLink( 'edit.php?post_type=shop_order' );
}
return (
Expand Down
4 changes: 2 additions & 2 deletions client/analytics/components/report-summary/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ export class ReportSummary extends Component {
label={ label }
prevLabel={
'previous_period' === compare
? __( 'Previous Period:', 'wc-admin' )
: __( 'Previous Year:', 'wc-admin' )
? __( 'Previous Period:', 'woocommerce-admin' )
: __( 'Previous Year:', 'woocommerce-admin' )
}
prevValue={ prevValue }
selected={ isSelected }
Expand Down
2 changes: 1 addition & 1 deletion client/analytics/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default class extends Component {
render() {
return (
<Fragment>
<Header sections={ [ __( 'Analytics', 'wc-admin' ) ] } />
<Header sections={ [ __( 'Analytics', 'woocommerce-admin' ) ] } />
</Fragment>
);
}
Expand Down
2 changes: 1 addition & 1 deletion client/analytics/report/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The core reports offered by WooCommerce live in this folder. The Header is added

## Extending Reports

New reports can be added by third-parties without altering `wc-admin`, by hooking into the reports filter, `woocommerce-reports-list`. For example:
New reports can be added by third-parties without altering `woocommerce-admin`, by hooking into the reports filter, `woocommerce-reports-list`. For example:

```js
addFilter( 'woocommerce-reports-list', 'wc-example/my-report', pages => {
Expand Down
26 changes: 13 additions & 13 deletions client/analytics/report/categories/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ import { getCategoryLabels } from 'lib/async-requests';
export const charts = [
{
key: 'items_sold',
label: __( 'Items Sold', 'wc-admin' ),
label: __( 'Items Sold', 'woocommerce-admin' ),
order: 'desc',
orderby: 'items_sold',
type: 'number',
},
{
key: 'net_revenue',
label: __( 'Net Revenue', 'wc-admin' ),
label: __( 'Net Revenue', 'woocommerce-admin' ),
order: 'desc',
orderby: 'net_revenue',
type: 'currency',
},
{
key: 'orders_count',
label: __( 'Orders Count', 'wc-admin' ),
label: __( 'Orders Count', 'woocommerce-admin' ),
order: 'desc',
orderby: 'orders_count',
type: 'number',
Expand All @@ -35,14 +35,14 @@ export const charts = [

export const filters = [
{
label: __( 'Show', 'wc-admin' ),
label: __( 'Show', 'woocommerce-admin' ),
staticParams: [],
param: 'filter',
showFilters: () => true,
filters: [
{ label: __( 'All Categories', 'wc-admin' ), value: 'all' },
{ label: __( 'All Categories', 'woocommerce-admin' ), value: 'all' },
{
label: __( 'Single Category', 'wc-admin' ),
label: __( 'Single Category', 'woocommerce-admin' ),
value: 'select_category',
chartMode: 'item-comparison',
subFilters: [
Expand All @@ -56,26 +56,26 @@ export const filters = [
param: 'categories',
getLabels: getCategoryLabels,
labels: {
placeholder: __( 'Type to search for a category', 'wc-admin' ),
button: __( 'Single Category', 'wc-admin' ),
placeholder: __( 'Type to search for a category', 'woocommerce-admin' ),
button: __( 'Single Category', 'woocommerce-admin' ),
},
},
},
],
},
{
label: __( 'Comparison', 'wc-admin' ),
label: __( 'Comparison', 'woocommerce-admin' ),
value: 'compare-categories',
chartMode: 'item-comparison',
settings: {
type: 'categories',
param: 'categories',
getLabels: getCategoryLabels,
labels: {
helpText: __( 'Select at least two categories to compare', 'wc-admin' ),
placeholder: __( 'Search for categories to compare', 'wc-admin' ),
title: __( 'Compare Categories', 'wc-admin' ),
update: __( 'Compare', 'wc-admin' ),
helpText: __( 'Select at least two categories to compare', 'woocommerce-admin' ),
placeholder: __( 'Search for categories to compare', 'woocommerce-admin' ),
title: __( 'Compare Categories', 'woocommerce-admin' ),
update: __( 'Compare', 'woocommerce-admin' ),
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions client/analytics/report/categories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ export default class CategoriesReport extends Component {

const mode = isCompareView || isSingleCategoryView ? 'item-comparison' : 'time-comparison';
const itemsLabel = isSingleCategoryView
? __( '%d products', 'wc-admin' )
: __( '%d categories', 'wc-admin' );
? __( '%d products', 'woocommerce-admin' )
: __( '%d categories', 'woocommerce-admin' );

return {
isSingleCategoryView,
Expand Down
24 changes: 12 additions & 12 deletions client/analytics/report/categories/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,34 +32,34 @@ class CategoriesReportTable extends Component {
getHeadersContent() {
return [
{
label: __( 'Category', 'wc-admin' ),
label: __( 'Category', 'woocommerce-admin' ),
key: 'category',
required: true,
isSortable: true,
isLeftAligned: true,
},
{
label: __( 'Items sold', 'wc-admin' ),
label: __( 'Items sold', 'woocommerce-admin' ),
key: 'items_sold',
required: true,
defaultSort: true,
isSortable: true,
isNumeric: true,
},
{
label: __( 'Net Revenue', 'wc-admin' ),
label: __( 'Net Revenue', 'woocommerce-admin' ),
key: 'net_revenue',
isSortable: true,
isNumeric: true,
},
{
label: __( 'Products', 'wc-admin' ),
label: __( 'Products', 'woocommerce-admin' ),
key: 'products_count',
isSortable: true,
isNumeric: true,
},
{
label: __( 'Orders', 'wc-admin' ),
label: __( 'Orders', 'woocommerce-admin' ),
key: 'orders_count',
isSortable: true,
isNumeric: true,
Expand Down Expand Up @@ -115,19 +115,19 @@ class CategoriesReportTable extends Component {
const { items_sold = 0, net_revenue = 0, orders_count = 0 } = totals;
return [
{
label: _n( 'category', 'categories', totalResults, 'wc-admin' ),
label: _n( 'category', 'categories', totalResults, 'woocommerce-admin' ),
value: numberFormat( totalResults ),
},
{
label: _n( 'item sold', 'items sold', items_sold, 'wc-admin' ),
label: _n( 'item sold', 'items sold', items_sold, 'woocommerce-admin' ),
value: numberFormat( items_sold ),
},
{
label: __( 'net revenue', 'wc-admin' ),
label: __( 'net revenue', 'woocommerce-admin' ),
value: formatCurrency( net_revenue ),
},
{
label: _n( 'order', 'orders', orders_count, 'wc-admin' ),
label: _n( 'order', 'orders', orders_count, 'woocommerce-admin' ),
value: numberFormat( orders_count ),
},
];
Expand All @@ -137,8 +137,8 @@ class CategoriesReportTable extends Component {
const { isRequesting, query } = this.props;

const labels = {
helpText: __( 'Select at least two categories to compare', 'wc-admin' ),
placeholder: __( 'Search by category name', 'wc-admin' ),
helpText: __( 'Select at least two categories to compare', 'woocommerce-admin' ),
placeholder: __( 'Search by category name', 'woocommerce-admin' ),
};

return (
Expand All @@ -158,7 +158,7 @@ class CategoriesReportTable extends Component {
order: query.order || 'desc',
extended_info: true,
} }
title={ __( 'Categories', 'wc-admin' ) }
title={ __( 'Categories', 'woocommerce-admin' ) }
columnPrefsKey="categories_report_columns"
/>
);
Expand Down
Loading

0 comments on commit 0f20052

Please sign in to comment.