diff --git a/README.md b/README.md index 83f306d9a..da3c526c0 100644 --- a/README.md +++ b/README.md @@ -166,6 +166,11 @@ These are the translations used in Bolt. We rely on the community to expand on n translations, and keep them up to date. If you wish to participate, read the [instructions here][translations]. +Several translation-related Console commands are available: +- `bin/console translation:download` - Download translations from Loco (replaces all local ones) +- `bin/console translation:sync bolt down` - Download translations from Loco (replaces local changes if there is a conflict) +- `bin/console translation:sync bolt up` - Send updated translations to Loco + [fowler]: https://martinfowler.com/articles/practical-test-pyramid.html [translations]: https://github.com/bolt/four/wiki/Contribute-on-translations diff --git a/composer.json b/composer.json index 7848ec55d..7793fad9b 100644 --- a/composer.json +++ b/composer.json @@ -14,26 +14,25 @@ "doctrine/annotations": "^1.0", "doctrine/doctrine-bundle": "^1.8", "doctrine/doctrine-cache-bundle": "^1.3.1", - "doctrine/doctrine-migrations-bundle": "^1.3", "doctrine/orm": "^2.5.11", "easycorp/easy-log-handler": "^1.0.7", "embed/embed": "^3.3", "erusev/parsedown": "^1.7", "ezyang/htmlpurifier": "^4.10", "fzaninotto/faker": "^1.8", + "gedmo/doctrine-extensions": "^2.4.4", "guzzlehttp/guzzle": "^6.3", "knplabs/knp-menu-bundle": "^2.0", "league/glide-symfony": "^1.0", "miljar/php-exif": "^0.6.4", "nelmio/cors-bundle": "^1.5", "nesbot/carbon": "^1.34", - "php-translation/symfony-bundle": "^0.8", "phpdocumentor/reflection-docblock": "^4.2", + "php-translation/symfony-bundle": "^0.8", "sensio/framework-extra-bundle": "^5.1", "sensiolabs/security-checker": "^5.0", "siriusphp/upload": "^2.1", "stof/doctrine-extensions-bundle": "^1.3", - "gedmo/doctrine-extensions": "^2.4.4", "symfony/asset": "^4.2", "symfony/console": "^4.2", "symfony/dependency-injection": "^4.2", @@ -60,24 +59,24 @@ "white-october/pagerfanta-bundle": "^1.2" }, "require-dev": { - "ext-pdo_sqlite": "*", "ext-curl": "*", + "ext-pdo_sqlite": "*", "behat/behat": "^3.5", "behat/mink": "dev-master@dev", "behat/mink-extension": "^2.3", "behat/mink-goutte-driver": "^1.2", "behatch/contexts": "^3.2", - "coduo/php-matcher": "dev-feature/array-universal-key@dev", + "coduo/php-matcher": "^3.1.2", "dama/doctrine-test-bundle": "^5.0", "doctrine/doctrine-fixtures-bundle": "^3.1", "lakion/mink-debug-extension": "^1.2", "php-http/httplug-pack": "^1.1", - "php-translation/loco-adapter": "^0.8.0", + "php-translation/loco-adapter": "^0.8", "phpspec/phpspec": "^5.1", "phpspec/prophecy": "^1.8", "phpstan/phpstan": "^0.11", - "phpstan/phpstan-doctrine": "^0.11.0", - "phpstan/phpstan-symfony": "^0.11.0", + "phpstan/phpstan-doctrine": "^0.11", + "phpstan/phpstan-symfony": "^0.11", "phpunit/phpunit": "^7.0", "roave/security-advisories": "dev-master@dev", "symfony/browser-kit": "^4.2", @@ -88,11 +87,8 @@ "symfony/stopwatch": "^4.2", "symfony/web-profiler-bundle": "^4.2", "symfony/web-server-bundle": "^4.2", - "symplify/easy-coding-standard": "^5.4.6" + "symplify/easy-coding-standard": "^5.4.14" }, - "repositories": [ - { "type": "vcs", "url": "https://github.com/jarjak/php-matcher", "no-api": true } - ], "minimum-stability": "stable", "prefer-stable": true, "config": { @@ -134,8 +130,7 @@ }, "conflict": { "symfony/symfony": "*", - "api-platform/core": "v2.4.0-beta.2", - "symplify/coding-standard": "5.4.13" + "api-platform/core": "v2.4.0-beta.2" }, "extra": { "symfony": { diff --git a/config/bundles.php b/config/bundles.php index 491a6ef72..a168b1b76 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -6,7 +6,8 @@ Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], Doctrine\Bundle\DoctrineCacheBundle\DoctrineCacheBundle::class => ['all' => true], Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['dev' => true, 'test' => true, 'local' => true], - Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], + Http\HttplugBundle\HttplugBundle::class => ['dev' => true, 'local' => true], + Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true], Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true], Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true], Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true], @@ -17,12 +18,10 @@ Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle::class => ['all' => true], Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], + Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'local' => true], Symfony\Bundle\WebServerBundle\WebServerBundle::class => ['dev' => true, 'test' => true, 'local' => true], - WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle::class => ['all' => true], - Knp\Bundle\MenuBundle\KnpMenuBundle::class => ['all' => true], Translation\Bundle\TranslationBundle::class => ['all' => true], - Symfony\WebpackEncoreBundle\WebpackEncoreBundle::class => ['all' => true], Translation\PlatformAdapter\Loco\Bridge\Symfony\TranslationAdapterLocoBundle::class => ['dev' => true, 'local' => true], - Http\HttplugBundle\HttplugBundle::class => ['dev' => true, 'local' => true], + WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle::class => ['all' => true], ]; diff --git a/config/packages/dev/httplug.yaml b/config/packages/dev/httplug.yaml deleted file mode 100644 index 2aadcd137..000000000 --- a/config/packages/dev/httplug.yaml +++ /dev/null @@ -1,14 +0,0 @@ -httplug: - plugins: - redirect: - preserve_header: true - - discovery: - client: 'auto' - - clients: - app: - http_methods_client: true - plugins: - - 'httplug.plugin.content_length' - - 'httplug.plugin.redirect' diff --git a/config/packages/dev/php_translation.yaml b/config/packages/dev/php_translation.yaml deleted file mode 100644 index 53398fbca..000000000 --- a/config/packages/dev/php_translation.yaml +++ /dev/null @@ -1,5 +0,0 @@ -translation: - symfony_profiler: - enabled: true - webui: - enabled: true diff --git a/config/packages/dev/translation.yaml b/config/packages/dev/translation.yaml index 032643dfe..88151f8da 100644 --- a/config/packages/dev/translation.yaml +++ b/config/packages/dev/translation.yaml @@ -1,25 +1,15 @@ -framework: - default_locale: '%locale%' - translator: - fallbacks: - - 'en' - # php_translation translation: - locales: ['en', 'nl', 'es', 'fr', 'de', 'pl', 'it', 'pt_BR'] - edit_in_place: - enabled: false - config_name: app + symfony_profiler: + enabled: true configs: - app: - dirs: ["%kernel.project_dir%/templates", "%kernel.project_dir%/src"] - output_dir: "%kernel.project_dir%/translations" + bolt: remote_storage: ["php_translation.adapter.loco"] # php_translation_adapter_loco_adapter translation_adapter_loco: index_parameter: 'id' # 'text' or 'name'. Leave blank for "auto" See https://localise.biz/api/docs/export/exportlocale projects: - my_project: + bolt: api_key: '%env(LOCO_PROJECT_API_KEY)%' domains: ['messages'] diff --git a/config/packages/doctrine_migrations.yaml b/config/packages/doctrine_migrations.yaml deleted file mode 100644 index c40143a64..000000000 --- a/config/packages/doctrine_migrations.yaml +++ /dev/null @@ -1,5 +0,0 @@ -doctrine_migrations: - dir_name: '%kernel.project_dir%/src/Migrations' - # namespace is arbitrary but should be different from Bolt\Migrations - # as migrations classes should NOT be autoloaded - namespace: DoctrineMigrations diff --git a/config/packages/translation.yaml b/config/packages/translation.yaml index d8cc35e08..442adac91 100644 --- a/config/packages/translation.yaml +++ b/config/packages/translation.yaml @@ -6,12 +6,12 @@ framework: # php_translation translation: + webui: + enabled: true locales: ['en', 'nl', 'es', 'fr', 'de', 'pl', 'it', 'pt_BR'] edit_in_place: enabled: false - config_name: app configs: - app: + bolt: dirs: ["%kernel.project_dir%/templates", "%kernel.project_dir%/src"] output_dir: "%kernel.project_dir%/translations" - diff --git a/config/routes/dev/php_translation.yaml b/config/routes/dev/php_translation.yaml deleted file mode 100644 index d8461a3f8..000000000 --- a/config/routes/dev/php_translation.yaml +++ /dev/null @@ -1,6 +0,0 @@ -#_translation_webui: -# resource: "@TranslationBundle/Resources/config/routing_webui.yml" -# prefix: /admin - -_translation_profiler: - resource: '@TranslationBundle/Resources/config/routing_symfony_profiler.yml' diff --git a/config/routes/dev/translation.yaml b/config/routes/dev/translation.yaml new file mode 100644 index 000000000..100ace880 --- /dev/null +++ b/config/routes/dev/translation.yaml @@ -0,0 +1,2 @@ +_translation_profiler: + resource: '@TranslationBundle/Resources/config/routing_symfony_profiler.yml' diff --git a/config/routes/php_translation.yaml b/config/routes/php_translation.yaml deleted file mode 100644 index 77e881abf..000000000 --- a/config/routes/php_translation.yaml +++ /dev/null @@ -1,28 +0,0 @@ -_translation_edit_in_place: - resource: '@TranslationBundle/Resources/config/routing_edit_in_place.yml' - prefix: /bolt - -translation_index: - path: /bolt/trans/{configName} - methods: [GET] - defaults: { _controller: Translation\Bundle\Controller\WebUIController::indexAction, configName: null } - -translation_show: - path: /bolt/trans/{configName}/{locale}/{domain} - methods: [GET] - defaults: { _controller: Translation\Bundle\Controller\WebUIController::showAction } - -translation_create: - path: /bolt/trans/{configName}/{locale}/{domain}/new - methods: [POST] - defaults: { _controller: Translation\Bundle\Controller\WebUIController::createAction } - -translation_edit: - path: /bolt/trans/{configName}/{locale}/{domain} - methods: [POST] - defaults: { _controller: Translation\Bundle\Controller\WebUIController::editAction } - -translation_delete: - path: /bolt/trans/{configName}/{locale}/{domain} - methods: [DELETE] - defaults: { _controller: Translation\Bundle\Controller\WebUIController::deleteAction } diff --git a/config/routes/translation.yml b/config/routes/translation.yml new file mode 100644 index 000000000..3b9105cd9 --- /dev/null +++ b/config/routes/translation.yml @@ -0,0 +1,3 @@ +_translation_webui: + resource: "@TranslationBundle/Resources/config/routing_webui.yml" + prefix: '%bolt.backend_url%' diff --git a/public/theme/skeleton/partials/_recordfooter.twig b/public/theme/skeleton/partials/_recordfooter.twig index 613668e19..99e2614ef 100644 --- a/public/theme/skeleton/partials/_recordfooter.twig +++ b/public/theme/skeleton/partials/_recordfooter.twig @@ -4,7 +4,7 @@ {{ __('general.phrase.edit') }} - {% endif %} {{ __('general.phrase.written-by-on', { - '%name%': record.author.displayname|default(__('Unknown')), + '%name%': record.author.displayName|default(__('Unknown')), '%date%': record.publishedAt|localedatetime("%A %B %e, %Y") }) }}
diff --git a/src/Form/UserType.php b/src/Form/UserType.php index 4bb94a635..5301ae44d 100644 --- a/src/Form/UserType.php +++ b/src/Form/UserType.php @@ -34,7 +34,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void 'disabled' => true, ]) ->add('displayName', TextType::class, [ - 'label' => 'label.displayname', + 'label' => 'label.display_name', ]) ->add('email', EmailType::class, [ 'label' => 'label.email', diff --git a/src/Menu/BackendMenuBuilder.php b/src/Menu/BackendMenuBuilder.php index befb893b7..7995baf57 100644 --- a/src/Menu/BackendMenuBuilder.php +++ b/src/Menu/BackendMenuBuilder.php @@ -223,7 +223,7 @@ private function createAdminMenu(): ItemInterface ], ]); - $menu->getChild('Maintenance')->addChild('Translations: Messages', [ + $menu->getChild('Maintenance')->addChild('Translations', [ 'uri' => $this->urlGenerator->generate('translation_index'), 'extras' => [ 'name' => $t->trans('caption.translations'), diff --git a/src/Migrations/.gitignore b/src/Migrations/.gitignore deleted file mode 100644 index e69de29bb..000000000 diff --git a/symfony.lock b/symfony.lock index 3369dbd5e..c3c0a5f7d 100644 --- a/symfony.lock +++ b/symfony.lock @@ -113,15 +113,6 @@ "src/DataFixtures/AppFixtures.php" ] }, - "doctrine/doctrine-migrations-bundle": { - "version": "1.2", - "recipe": { - "repo": "github.com/symfony/recipes", - "branch": "master", - "version": "1.2", - "ref": "c1431086fec31f17fbcfe6d6d7e92059458facc1" - } - }, "doctrine/event-manager": { "version": "v1.0.0" }, @@ -134,9 +125,6 @@ "doctrine/lexer": { "version": "v1.0.1" }, - "doctrine/migrations": { - "version": "v1.6.0" - }, "doctrine/orm": { "version": "v2.5.12" }, diff --git a/templates/bundles/TwigBundle/Exception/error.html.twig b/templates/bundles/TwigBundle/Exception/error.html.twig index 77d42148d..64297adb4 100644 --- a/templates/bundles/TwigBundle/Exception/error.html.twig +++ b/templates/bundles/TwigBundle/Exception/error.html.twig @@ -18,7 +18,7 @@ {{ 'http_error.description'|trans({ '%status_code%': status_code }) }}- {{ 'http_error.suggestion'|trans({ '%url%': path('blog_index') })|raw }} + {{ 'http_error.suggestion'|trans({ '%url%': path('homepage') })|raw }}
{% endblock %} diff --git a/templates/bundles/TwigBundle/Exception/error404.html.twig b/templates/bundles/TwigBundle/Exception/error404.html.twig index 80b451c3a..3de9bf55b 100644 --- a/templates/bundles/TwigBundle/Exception/error404.html.twig +++ b/templates/bundles/TwigBundle/Exception/error404.html.twig @@ -18,7 +18,7 @@ {{ 'http_error_404.description'|trans }}- {{ 'http_error_404.suggestion'|trans({ '%url%': path('blog_index') })|raw }} + {{ 'http_error_404.suggestion'|trans({ '%url%': path('homepage') })|raw }}
{% endblock %} diff --git a/templates/bundles/TwigBundle/Exception/error500.html.twig b/templates/bundles/TwigBundle/Exception/error500.html.twig index a4982e4b5..2c691f401 100644 --- a/templates/bundles/TwigBundle/Exception/error500.html.twig +++ b/templates/bundles/TwigBundle/Exception/error500.html.twig @@ -18,7 +18,7 @@ {{ 'http_error_500.description'|trans }}- {{ 'http_error_500.suggestion'|trans({ '%url%': path('blog_index') })|raw }} + {{ 'http_error_500.suggestion'|trans({ '%url%': path('homepage') })|raw }}
{% endblock %} diff --git a/templates/users/edit.html.twig b/templates/users/edit.html.twig index 512cbc622..30d6cc669 100644 --- a/templates/users/edit.html.twig +++ b/templates/users/edit.html.twig @@ -21,7 +21,7 @@ } %} {% include '@bolt/_partials/fields/text.html.twig' with { - 'label' : 'label.displayname'|trans, + 'label' : 'label.display_name'|trans, 'name' : 'displayName', 'value' : user.displayName, 'disabled' : false, diff --git a/translations/messages.en.xlf b/translations/messages.en.xlf index 0c1cc3ad0..b43ab5cd9 100644 --- a/translations/messages.en.xlf +++ b/translations/messages.en.xlf @@ -927,6 +927,12 @@