Skip to content

Commit 4be6853

Browse files
committed
Added tranlation filter by default in the PHP code strings
1 parent b409cfb commit 4be6853

File tree

6 files changed

+19
-10
lines changed

6 files changed

+19
-10
lines changed

src/themes/WordpressStandard/Configuration/Assets.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ final class Assets extends BaseAssets
2626
*/
2727
public function assets()
2828
{
29-
$this->addScript('app');
29+
if (WP_DEBUG) {
30+
$this->addStylesheet('app', self::CSS);
31+
$this->addScript('app');
32+
} else {
33+
$this->addStylesheet('app.min', self::CSS);
34+
$this->addScript('app.min', self::BUILD_JS);
35+
}
3036
}
3137
}

src/themes/WordpressStandard/Configuration/Menus.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace WordpressStandard\Configuration;
1313

1414
use LIN3S\WPFoundation\Configuration\Menus\Menus as BaseMenus;
15+
use LIN3S\WPFoundation\Configuration\Translations\Translations;
1516

1617
/**
1718
* Final Menu class. With menus method are registered the different menus.
@@ -29,7 +30,7 @@ final class Menus extends BaseMenus
2930
public function menus()
3031
{
3132
register_nav_menus([
32-
self::MENU_HEADER => 'Header menu'
33+
self::MENU_HEADER => Translations::trans('Header menu')
3334
]);
3435
}
3536
}

src/themes/WordpressStandard/Controller/DefaultController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace WordpressStandard\Controller;
1313

1414
use Timber;
15-
use TimberPage;
15+
use TimberPost;
1616

1717
/**
1818
* Basic controller that works in the same way of MVC frameworks like Laravel or Symfony.
@@ -55,7 +55,7 @@ public function notFoundAction()
5555
public function pageAction()
5656
{
5757
$context = Timber::get_context();
58-
$context['page'] = new TimberPage();
58+
$context['page'] = new TimberPost();
5959

6060
return Timber::render('pages/default.twig', $context);
6161
}

src/themes/WordpressStandard/PostTypes/ExamplePostType.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace WordpressStandard\PostTypes;
1313

14+
use LIN3S\WPFoundation\Configuration\Translations\Translations;
1415
use LIN3S\WPFoundation\PostTypes\PostType;
1516

1617
/**
@@ -34,8 +35,8 @@ public function postType()
3435
register_post_type(self::NAME,
3536
[
3637
'labels' => [
37-
'name' => 'Example',
38-
'singular_name' => 'Example'
38+
'name' => Translations::trans('Example'),
39+
'singular_name' => Translations::trans('Example')
3940
],
4041
'public' => true,
4142
'has_archive' => true,
@@ -51,8 +52,8 @@ public function taxonomyType()
5152
{
5253
register_taxonomy(self::TAXONOMY_TYPE_CATEGORY, self::NAME, [
5354
'labels' => [
54-
'name' => 'Example category',
55-
'singular_name' => 'Example category'
55+
'name' => Translations::trans('Example category'),
56+
'singular_name' => Translations::trans('Example category')
5657
],
5758
'sort' => true,
5859
'hierarchical' => true

src/themes/WordpressStandard/Resources/assets/scss/base/_foundation-settings.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
// @author Gorka Laucirica <gorka.lauzirika@gmail.com>
99

1010
// Allows the use of rem-calc() or lower-bound() in your settings
11-
@import "../vendor/foundation/scss/foundation/functions";
11+
@import '../vendor/foundation/scss/foundation/functions';
1212

1313
// Full foundation settings list: https://github.com/zurb/foundation/blob/master/scss/foundation/_settings.scss

src/themes/WordpressStandard/Widgets/Areas/ExampleWidgetArea.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace WordpressStandard\Widgets\Areas;
1313

14+
use LIN3S\WPFoundation\Configuration\Translations\Translations;
1415
use LIN3S\WPFoundation\Widgets\Areas\WidgetArea;
1516

1617
/**
@@ -28,7 +29,7 @@ final class ExampleWidgetArea extends WidgetArea
2829
public function widgetArea()
2930
{
3031
register_sidebar([
31-
'name' => 'Example widgets',
32+
'name' => Translations::trans('Example widgets'),
3233
'id' => 'example-widgets',
3334
'before_widget' => '<section class="">',
3435
'after_widget' => '</section>',

0 commit comments

Comments
 (0)