Skip to content

Commit

Permalink
Fix domain string "gcf" => "gutenberg-custom-fields"
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Apr 4, 2018
1 parent 7ee9240 commit 36b11b7
Show file tree
Hide file tree
Showing 20 changed files with 54 additions and 45 deletions.
2 changes: 1 addition & 1 deletion bin/build-plugin-zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ npm install
status "Generating build..."
npm run build
status "Generating PHP file for wordpress.org to parse translations..."
npx pot-to-php ./languages/gcf.pot ./languages/gcf-translations.php gcf
npx pot-to-php ./languages/gcf.pot ./languages/gcf-translations.php gutenberg-custom-fields

# Remove any existing zip file
rm -f gcf.zip
Expand Down
4 changes: 2 additions & 2 deletions gutenberg-custom-fields.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* Plugin Name: Gutenberg Custom Fields
* Plugin URI: https://github.com/youknowriad/gcf
* Description: Custom Fields, The Gutenberg way
* Version: 1.4.1
* Text Domain: gcf
* Version: 1.4.2
* Text Domain: gutenberg-custom-fields
* Domain Path: /languages
* Author: Riad Benguella
*
Expand Down
6 changes: 3 additions & 3 deletions lib/i18n-script.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ function gutenberg_custom_fields_get_jed_locale_data( $domain ) {
* @since 1.4.0
*/
function gutenberg_custom_fields_i18n_register() {
$locale_data = gutenberg_custom_fields_get_jed_locale_data( 'gcf' );
$content = 'wp.i18n.setLocaleData( ' . json_encode( $locale_data ) . ', "gcf" );';
$locale_data = gutenberg_custom_fields_get_jed_locale_data( 'gutenberg-custom-fields' );
$content = 'wp.i18n.setLocaleData( ' . json_encode( $locale_data ) . ', "gutenberg-custom-fields" );';

wp_register_script( 'gcf-i18n', null, array( 'wp-i18n' ) );
wp_script_add_data( 'gcf-i18n', 'data', $content );
Expand All @@ -52,7 +52,7 @@ function gutenberg_custom_fields_i18n_register() {
*/
function gutenberg_custom_fields_load_plugin_textdomain() {
load_plugin_textdomain(
'gcf',
'gutenberg-custom-fields',
false,
plugin_basename( gutenberg_custom_fields_dir_path() ) . '/languages/'
);
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gutenberg-custom-fields",
"version": "1.4.1",
"version": "1.4.2",
"private": true,
"dependencies": {
"classnames": "^2.2.5",
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: youknowriad
Requires at least: 4.8
Tested up to: 4.9
Stable tag: 1.4.1
Stable tag: 1.4.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: gutenberg
Expand Down
2 changes: 1 addition & 1 deletion scripts/config-app/components/about/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function About({ onCreateTemplate }) {
<p>
{__(
"Gutenberg Custom Fields allows you to control the content of the Gutenberg edit screen by creating pre-filled templates.",
"gcf"
"gutenberg-custom-fields"
)}
</p>

Expand Down
2 changes: 1 addition & 1 deletion scripts/config-app/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class Layout extends Component {
!!templates.length && (
<div className="gcf-layout__templates">
<div className="gcf-layout__templates-header">
<h1>{__("Your GCF templates", "gcf")}</h1>
<h1>{__("Your GCF templates", "gutenberg-custom-fields")}</h1>
<TemplateNewButton onClick={this.onNewTemplate} />
</div>
<TemplateList
Expand Down
36 changes: 21 additions & 15 deletions scripts/config-app/components/template-form/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,18 @@ import { getRecords } from "../../store/selectors";
const LOCK_OPTIONS = [
{
value: "none",
label: __("None", "gcf")
label: __("None", "gutenberg-custom-fields")
},
{
value: "insert",
label: __("Forbid adding/removing blocks", "gcf")
label: __("Forbid adding/removing blocks", "gutenberg-custom-fields")
},
{
value: "all",
label: __("Forbid adding/removing and moving blocks", "gcf")
label: __(
"Forbid adding/removing and moving blocks",
"gutenberg-custom-fields"
)
}
];

Expand Down Expand Up @@ -160,13 +163,16 @@ class TemplateForm extends Component {
>
<h1>
{isNew
? __("Creating a new GCF template", "gcf")
: sprintf(__("Editing: %s", "gcf"), editedTemplate.title)}
? __("Creating a new GCF template", "gutenberg-custom-fields")
: sprintf(
__("Editing: %s", "gutenberg-custom-fields"),
editedTemplate.title
)}
</h1>

<div className="gcf-template-form__group">
<label htmlFor={`template-title-${instanceId}`}>
{__("Title", "gcf")}
{__("Title", "gutenberg-custom-fields")}
</label>
<input
type="text"
Expand All @@ -178,7 +184,7 @@ class TemplateForm extends Component {

<div className="gcf-template-form__group">
<label htmlFor={`template-post-type-${instanceId}`}>
{__("Post Type", "gcf")}
{__("Post Type", "gutenberg-custom-fields")}
</label>
<select
id={`template-post-type-${instanceId}`}
Expand All @@ -201,7 +207,7 @@ class TemplateForm extends Component {

<div className="gcf-template-form__group">
<label htmlFor={`template-is-locked-${instanceId}`}>
{__("Lock", "gcf")}
{__("Lock", "gutenberg-custom-fields")}
</label>
<select
id={`template-is-locked-${instanceId}`}
Expand All @@ -217,7 +223,7 @@ class TemplateForm extends Component {
</div>

<div className="gcf-template-form__group">
<label>{__("Fields", "gcf")}</label>
<label>{__("Fields", "gutenberg-custom-fields")}</label>

<div className="gcf-template-form__fields">
{map(editedTemplate.fields, field => (
Expand All @@ -232,7 +238,7 @@ class TemplateForm extends Component {
<label
htmlFor={`template-fields-name-${field.id}-${instanceId}`}
>
{__("Name", "gcf")}
{__("Name", "gutenberg-custom-fields")}
</label>
<input
type="text"
Expand All @@ -247,7 +253,7 @@ class TemplateForm extends Component {
<label
htmlFor={`template-fields-title-${field.id}-${instanceId}`}
>
{__("Title", "gcf")}
{__("Title", "gutenberg-custom-fields")}
</label>
<input
type="text"
Expand All @@ -261,7 +267,7 @@ class TemplateForm extends Component {
<label
htmlFor={`template-fields-type-${field.id}-${instanceId}`}
>
{__("Type", "gcf")}
{__("Type", "gutenberg-custom-fields")}
</label>
<select
id={`template-fields-type-${field.id}-${instanceId}`}
Expand All @@ -283,17 +289,17 @@ class TemplateForm extends Component {
icon="insert"
onClick={this.onAddField}
>
{__("Add Field", "gcf")}
{__("Add Field", "gutenberg-custom-fields")}
</IconButton>
</div>
</div>

<div className="gcf-template-form__footer">
<Button className="button" onClick={onCancel} disabled={isDisabled}>
{__("Cancel", "gcf")}
{__("Cancel", "gutenberg-custom-fields")}
</Button>
<Button type="submit" isPrimary disabled={isDisabled}>
{__("Save", "gcf")}
{__("Save", "gutenberg-custom-fields")}
</Button>
</div>
</form>
Expand Down
6 changes: 3 additions & 3 deletions scripts/config-app/components/template-list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ function TemplateList({ templates, onEdit, onRemove, onCreateTemplate }) {
<table className="wp-list-table widefat gcf-template-list">
<thead>
<tr>
<th>{__("Title", "gcf")}</th>
<th>{__("Post Type", "gcf")}</th>
<th>{__("Actions", "gcf")}</th>
<th>{__("Title", "gutenberg-custom-fields")}</th>
<th>{__("Post Type", "gutenberg-custom-fields")}</th>
<th>{__("Actions", "gutenberg-custom-fields")}</th>
</tr>
</thead>
<tbody>
Expand Down
2 changes: 1 addition & 1 deletion scripts/config-app/components/template-new-button/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { __ } from "@wordpress/i18n";
function TemplateNewButton(props) {
return (
<Button className="gcf-template-new-button" isPrimary {...props}>
{__("Create a new template", "gcf")}
{__("Create a new template", "gutenberg-custom-fields")}
</Button>
);
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/fields/fields/date.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Field from "../components/field";

const dateField = {
name: "date",
label: __("Date", "gcf"),
label: __("Date", "gutenberg-custom-fields"),
getBlockSettings(fieldConfig) {
return {
edit({ attributes, setAttributes }) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/fields/fields/datetime.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const is12HourTime = /a(?!\\)/i.test(

const datetimeField = {
name: "datetime",
label: __("Date and Time", "gcf"),
label: __("Date and Time", "gutenberg-custom-fields"),
getBlockSettings(fieldConfig) {
return {
edit({ attributes, setAttributes }) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/fields/fields/email.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Field from "../components/field";

const emailField = {
name: "email",
label: __("Email", "gcf"),
label: __("Email", "gutenberg-custom-fields"),
getBlockSettings(fieldConfig) {
return {
edit({ attributes, setAttributes }) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/fields/fields/free.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Field from "../components/field";

const freeField = {
name: "free",
label: __("Free HTML Area", "gcf"),
label: __("Free HTML Area", "gutenberg-custom-fields"),
getBlockSettings(fieldConfig) {
return {
supports: {
Expand Down
13 changes: 8 additions & 5 deletions scripts/fields/fields/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import Field from "../components/field";

const imageBlock = {
name: "image",
label: __("Image", "gcf"),
label: __("Image", "gutenberg-custom-fields"),
getBlockSettings(fieldConfig) {
return {
edit({ attributes, setAttributes, className, focus }) {
Expand Down Expand Up @@ -44,7 +44,7 @@ const imageBlock = {
onClick={open}
icon="edit"
className="components-toolbar__control"
label={__("Edit image", "gcf")}
label={__("Edit image", "gutenberg-custom-fields")}
/>
)}
/>
Expand All @@ -59,7 +59,7 @@ const imageBlock = {
key="placeholder"
instructions={__(
"Drag image here or insert from media library",
"gcf"
"gutenberg-custom-fields"
)}
icon="format-image"
label={"Image"}
Expand All @@ -73,14 +73,17 @@ const imageBlock = {
onChange={uploadFromFiles}
accept="image/*"
>
{__("Upload", "gcf")}
{__("Upload", "gutenberg-custom-fields")}
</FormFileUpload>
<MediaUpload
onSelect={onSelectImage}
type="image"
render={({ open }) => (
<Button isLarge onClick={open}>
{__("Insert from Media Library", "gcf")}
{__(
"Insert from Media Library",
"gutenberg-custom-fields"
)}
</Button>
)}
/>
Expand Down
2 changes: 1 addition & 1 deletion scripts/fields/fields/number.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Field from "../components/field";

const numberField = {
name: "number",
label: __("Number", "gcf"),
label: __("Number", "gutenberg-custom-fields"),
getBlockSettings(fieldConfig) {
return {
attributes: {
Expand Down
4 changes: 2 additions & 2 deletions scripts/fields/fields/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Field from "../components/field";

const textField = {
name: "text",
label: __("Text", "gcf"),
label: __("Text", "gutenberg-custom-fields"),
getBlockSettings(fieldConfig) {
return {
edit({ attributes, setAttributes }) {
Expand All @@ -18,7 +18,7 @@ const textField = {
onChange={event => {
setAttributes({ content: event.target.value });
}}
placeholder={__("Write", "gcf")}
placeholder={__("Write", "gutenberg-custom-fields")}
/>
)}
</Field>
Expand Down
4 changes: 2 additions & 2 deletions scripts/fields/fields/textarea.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Field from "../components/field";

const textareaField = {
name: "textarea",
label: __("Textarea", "gcf"),
label: __("Textarea", "gutenberg-custom-fields"),
getBlockSettings(fieldConfig) {
return {
edit({ attributes, setAttributes }) {
Expand All @@ -18,7 +18,7 @@ const textareaField = {
onChange={content => {
setAttributes({ content });
}}
placeholder={__("Write", "gcf")}
placeholder={__("Write", "gutenberg-custom-fields")}
/>
)}
</Field>
Expand Down
2 changes: 1 addition & 1 deletion scripts/fields/fields/time.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const is12HourTime = /a(?!\\)/i.test(

const timeField = {
name: "time",
label: __("Time", "gcf"),
label: __("Time", "gutenberg-custom-fields"),
getBlockSettings(fieldConfig) {
return {
edit({ attributes, setAttributes }) {
Expand Down

0 comments on commit 36b11b7

Please sign in to comment.