@@ -50,44 +50,42 @@ public function __construct($one, $many = false, $config = false)
50
50
*/
51
51
public function builder ()
52
52
{
53
- $ theme = wp_get_theme ();
54
- $ i18n = $ theme ->get ('TextDomain ' );
55
53
$ featured_image = $ this ->config ->has ('featured_image ' ) ?
56
54
$ this ->config ->get ('featured_image ' ) :
57
55
'Featured image ' ;
58
56
59
57
$ this ->labels = Arr::collect ([
60
- 'name ' => _x ($ this ->many , 'Post type general name ' , $ i18n ),
61
- 'singular_name ' => _x ($ this ->one , 'Post type singular name ' , $ i18n ),
62
- 'menu_name ' => _x ($ this ->many , 'Admin Menu text ' , $ i18n ),
63
- 'name_admin_bar ' => _x ($ this ->one , 'Add New on Toolbar ' , $ i18n ),
64
- 'add_new ' => __ ('Add New ' , $ i18n ),
65
- 'add_new_item ' => sprintf (__ ('Add New %s ' , $ i18n ), $ this ->one ),
66
- 'edit_item ' => sprintf (__ ('Edit %s ' , $ i18n ), $ this ->one ),
67
- 'new_item ' => sprintf (__ ('New %s ' , $ i18n ), $ this ->one ),
68
- 'view_item ' => sprintf (__ ('View %s ' , $ i18n ), $ this ->one ),
69
- 'view_items ' => sprintf (__ ('View %s ' , $ i18n ), $ this ->many ),
70
- 'search_items ' => sprintf (__ ('Search %s ' , $ i18n ), $ this ->many ),
71
- 'not_found ' => sprintf (__ ('No %s found. ' , $ i18n ), Str::lower ($ this ->many )),
72
- 'not_found_in_trash ' => sprintf (__ ('No %s found in trash. ' , $ i18n ), Str::lower ($ this ->many )),
73
- 'parent_item_colon ' => sprintf (__ ('Parent %s: ' , $ i18n ), $ this ->one ),
74
- 'all_items ' => sprintf (__ ('All %s ' , $ i18n ), $ this ->many ),
75
- 'archives ' => sprintf (__ ('%s Archives ' , $ i18n ), $ this ->one ),
76
- 'attributes ' => sprintf (__ ('%s Attributes ' , $ i18n ), $ this ->one ),
77
- 'insert_into_item ' => sprintf (__ ('Insert into %s ' , $ i18n ), Str::lower ($ this ->one )),
78
- 'uploaded_to_this_item ' => sprintf (__ ('Uploaded to this %s ' , $ i18n ), Str::lower ($ this ->one )),
79
- 'filter_items_list ' => sprintf (__ ('Filter %s list ' , $ i18n ), Str::lower ($ this ->many )),
80
- 'items_list_navigation ' => sprintf (__ ('%s list navigation ' , $ i18n ), $ this ->many ),
81
- 'items_list ' => sprintf (__ ('%s list ' , $ i18n ), $ this ->many ),
82
- 'item_published ' => sprintf (__ ('%s published. ' , $ i18n ), $ this ->one ),
83
- 'item_published_privately ' => sprintf (__ ('%s published privately. ' , $ i18n ), $ this ->one ),
84
- 'item_reverted_to_draft ' => sprintf (__ ('%s reverted to draft. ' , $ i18n ), $ this ->one ),
85
- 'item_scheduled ' => sprintf (__ ('%s scheduled. ' , $ i18n ), $ this ->one ),
86
- 'item_updated ' => sprintf (__ ('%s updated. ' , $ i18n ), $ this ->one ),
87
- 'featured_image ' => __ ($ featured_image , $ i18n ),
88
- 'set_featured_image ' => sprintf (__ ('Set %s ' , $ i18n ), Str::lower ($ featured_image )),
89
- 'remove_featured_image ' => sprintf (__ ('Remove %s ' , $ i18n ), Str::lower ($ featured_image )),
90
- 'use_featured_image ' => sprintf (__ ('Use as %s ' , $ i18n ), Str::lower ($ featured_image )),
58
+ 'name ' => _x ($ this ->many , 'Post type general name ' , INTERVENTION_TEXT_DOMAIN ),
59
+ 'singular_name ' => _x ($ this ->one , 'Post type singular name ' , INTERVENTION_TEXT_DOMAIN ),
60
+ 'menu_name ' => _x ($ this ->many , 'Admin Menu text ' , INTERVENTION_TEXT_DOMAIN ),
61
+ 'name_admin_bar ' => _x ($ this ->one , 'Add New on Toolbar ' , INTERVENTION_TEXT_DOMAIN ),
62
+ 'add_new ' => __ ('Add New ' , INTERVENTION_TEXT_DOMAIN ),
63
+ 'add_new_item ' => sprintf (__ ('Add New %s ' , INTERVENTION_TEXT_DOMAIN ), $ this ->one ),
64
+ 'edit_item ' => sprintf (__ ('Edit %s ' , INTERVENTION_TEXT_DOMAIN ), $ this ->one ),
65
+ 'new_item ' => sprintf (__ ('New %s ' , INTERVENTION_TEXT_DOMAIN ), $ this ->one ),
66
+ 'view_item ' => sprintf (__ ('View %s ' , INTERVENTION_TEXT_DOMAIN ), $ this ->one ),
67
+ 'view_items ' => sprintf (__ ('View %s ' , INTERVENTION_TEXT_DOMAIN ), $ this ->many ),
68
+ 'search_items ' => sprintf (__ ('Search %s ' , INTERVENTION_TEXT_DOMAIN ), $ this ->many ),
69
+ 'not_found ' => sprintf (__ ('No %s found. ' , INTERVENTION_TEXT_DOMAIN ), Str::lower ($ this ->many )),
70
+ 'not_found_in_trash ' => sprintf (__ ('No %s found in trash. ' , INTERVENTION_TEXT_DOMAIN ), Str::lower ($ this ->many )),
71
+ 'parent_item_colon ' => sprintf (__ ('Parent %s: ' , INTERVENTION_TEXT_DOMAIN ), $ this ->one ),
72
+ 'all_items ' => sprintf (__ ('All %s ' , INTERVENTION_TEXT_DOMAIN ), $ this ->many ),
73
+ 'archives ' => sprintf (__ ('%s Archives ' , INTERVENTION_TEXT_DOMAIN ), $ this ->one ),
74
+ 'attributes ' => sprintf (__ ('%s Attributes ' , INTERVENTION_TEXT_DOMAIN ), $ this ->one ),
75
+ 'insert_into_item ' => sprintf (__ ('Insert into %s ' , INTERVENTION_TEXT_DOMAIN ), Str::lower ($ this ->one )),
76
+ 'uploaded_to_this_item ' => sprintf (__ ('Uploaded to this %s ' , INTERVENTION_TEXT_DOMAIN ), Str::lower ($ this ->one )),
77
+ 'filter_items_list ' => sprintf (__ ('Filter %s list ' , INTERVENTION_TEXT_DOMAIN ), Str::lower ($ this ->many )),
78
+ 'items_list_navigation ' => sprintf (__ ('%s list navigation ' , INTERVENTION_TEXT_DOMAIN ), $ this ->many ),
79
+ 'items_list ' => sprintf (__ ('%s list ' , INTERVENTION_TEXT_DOMAIN ), $ this ->many ),
80
+ 'item_published ' => sprintf (__ ('%s published. ' , INTERVENTION_TEXT_DOMAIN ), $ this ->one ),
81
+ 'item_published_privately ' => sprintf (__ ('%s published privately. ' , INTERVENTION_TEXT_DOMAIN ), $ this ->one ),
82
+ 'item_reverted_to_draft ' => sprintf (__ ('%s reverted to draft. ' , INTERVENTION_TEXT_DOMAIN ), $ this ->one ),
83
+ 'item_scheduled ' => sprintf (__ ('%s scheduled. ' , INTERVENTION_TEXT_DOMAIN ), $ this ->one ),
84
+ 'item_updated ' => sprintf (__ ('%s updated. ' , INTERVENTION_TEXT_DOMAIN ), $ this ->one ),
85
+ 'featured_image ' => __ ($ featured_image , INTERVENTION_TEXT_DOMAIN ),
86
+ 'set_featured_image ' => sprintf (__ ('Set %s ' , INTERVENTION_TEXT_DOMAIN ), Str::lower ($ featured_image )),
87
+ 'remove_featured_image ' => sprintf (__ ('Remove %s ' , INTERVENTION_TEXT_DOMAIN ), Str::lower ($ featured_image )),
88
+ 'use_featured_image ' => sprintf (__ ('Use as %s ' , INTERVENTION_TEXT_DOMAIN ), Str::lower ($ featured_image )),
91
89
]);
92
90
93
91
$ this ->labels = $ this ->labels ->merge ($ this ->config ->toArray ());
0 commit comments