Closed ismetsener closed 3 years ago
Hi @ismetsener in every config file loaded by Symfony container. In Pimcore 6.8 and Symfony 4.x default config file is:
app/config/config.yml
so I have to add this:
api_key: 12334 source_lang: EN
to app/config/config.yml ??
I get this error: There is no extension able to load the configuration for "api_key" (in "/opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml"). Looked for namespace "api_key", found ""framework", "twig", "monolog", "swiftmailer", "doctrine", "sensio_framework_extra", "cmf_routing", "presta_sitemap", "scheb_two_factor", "fos_js_routing", "security", "debug", "web_profiler", "pimcore_admin", "pimcore", "pimcore_generator", "pimcore_ecommerce_framework", "pimcore_customer_management_framework", "output_data_config_toolkit", "web2_print_tools", "pimcore_data_hub", "number_sequence_generator", "workflow_gui", "app", "httplug", "hwi_oauth"" in /opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml (which is being imported from "/opt/pimcore-6/apps/pimcore/htdocs/app/config/config_dev.yml").
Did you remove the commented fragment (####divante_google_translate: )? This is necessary, please have a look here https://github.com/DivanteLtd/pimcore-google-translate/blob/master/src/GoogleTranslateBundle/Service/ConfigurationService.php
divante_google_translate: api_key: 12334 source_lang: EN
still not work
The file "/opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml" does not contain valid YAML: Unable to parse in "/opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml" at line 22 (near "divante_google_translate") in /opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml (which is being imported from "/opt/pimcore-6/apps/pimcore/htdocs/app/config/config_dev.yml").
ivante_google_translate api_key: source_lang: EN
line 21: divante_google_translate line 22 :api_key: line 23: source_lang: EN
divante_google_translate:
api_key: xxx
source_lang: xxx
Check indents, api_key
and source_lang
are under divante_google_translate
key.
where can I find these values: api_key: ???? source_lang -> should be English (en_EN or EN)
You can follow this guide to generate API Key: https://github.com/eddiesigner/sketch-translate-me/wiki/Generate-a-Google-API-Key
I created a API KEY, but still same error divante_google_translate api_key: AI..........ss -> here i put my API_KEY source_lang: en_US
error: The file "/opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml" does not contain valid YAML: Unable to parse in "/opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml" at line 22 (near "divante_google_translate") in /opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml (which is being imported from "/opt/pimcore-6/apps/pimcore/htdocs/app/config/config_dev.yml").
do I have add some other things to the config.yml file: imports:
{ resource: parameters.yml }
{ resource: security.yml }
{ resource: services.yml }
{ resource: 'local/' }
{ resource: ecommerce/base-ecommerce.yml }
{ resource: cmf.yml }
{ resource: /opt/pimcore-6/apps/pimcore/htdocs/var/bundles/workflow-gui/workflow.yml }
divante_google_translate api_key: AI..........ss source_lang: en_US
You have clear information that your yml file isnt valid. Use validator example: https://codebeautify.org/yaml-validator
Error : Unable to parse. Line : 14 divante_google_translate
You have missing colon character on the end. Should be:
divante_google_translate:
OK I DID now I got other error:
There is no extension able to load the configuration for "divante_google_translate" (in "/opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml"). Looked for namespace "divante_google_translate", found ""framework", "twig", "monolog", "swiftmailer", "doctrine", "sensio_framework_extra", "cmf_routing", "presta_sitemap", "scheb_two_factor", "fos_js_routing", "security", "debug", "web_profiler", "pimcore_admin", "pimcore", "pimcore_generator", "pimcore_ecommerce_framework", "pimcore_customer_management_framework", "output_data_config_toolkit", "web2_print_tools", "pimcore_data_hub", "number_sequence_generator", "workflow_gui", "app", "httplug", "hwi_oauth"" in /opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml (which is being imported from "/opt/pimcore-6/apps/pimcore/htdocs/app/config/config_dev.yml").
You didnt enabled bundle, check readme and section: "Installing/Getting started"
Enable the Bundle:
./bin/console pimcore:bundle:enable GoogleTranslateBundle
and I get
Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: There is no extension able to load the configuration for "divante_google_translate" (in "/opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml"). Looked for namespace "divante_google_translate", found ""framework", "twig", "monolog", "swiftmailer", "doctrine", "sensio_framework_extra", "cmf_routing", "presta_sitemap", "scheb_two_factor", "fos_js_routing", "security", "debug", "web_profiler", "pimcore_admin", "pimcore", "pimcore_generator", "pimcore_ecommerce_framework", "pimcore_customer_management_framework", "output_data_config_toolkit", "web2_print_tools", "pimcore_data_hub", "number_sequence_generator", "workflow_gui", "app", "httplug", "hwi_oauth"". in /opt/pimcore-6/apps/pimcore/htdocs/vendor/symfony/symfony/src/Symfony/Component/Config/Loader/FileLoader.php on line 180
Symfony\Component\Config\Exception\LoaderLoadException: There is no extension able to load the configuration for "divante_google_translate" (in "/opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml"). Looked for namespace "divante_google_translate", found ""framework", "twig", "monolog", "swiftmailer", "doctrine", "sensio_framework_extra", "cmf_routing", "presta_sitemap", "scheb_two_factor", "fos_js_routing", "security", "debug", "web_profiler", "pimcore_admin", "pimcore", "pimcore_generator", "pimcore_ecommerce_framework", "pimcore_customer_management_framework", "output_data_config_toolkit", "web2_print_tools", "pimcore_data_hub", "number_sequence_generator", "workflow_gui", "app", "httplug", "hwi_oauth"" in /opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml (which is being imported from "/opt/pimcore-6/apps/pimcore/htdocs/app/config/config_dev.yml"). in /opt/pimcore-6/apps/pimcore/htdocs/vendor/symfony/symfony/src/Symfony/Component/Config/Loader/FileLoader.php on line 180
Call Stack: 0.6032 23584880 1. Symfony\Component\Debug\ErrorHandler->handleException() /opt/pimcore-6/apps/pimcore/htdocs/vendor/symfony/symfony/src/Symfony/Component/Debug/ErrorHandler.php:0
Read error, first remove your configuration next enable bundle and add configuration again.
I DID:
here is no extension able to load the configuration for "divante_google_translate" (in "/opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml"). Looked for namespace "divante_google_translate", found ""framework", "twig", "monolog", "swiftmailer", "doctrine", "sensio_framework_extra", "cmf_routing", "presta_sitemap", "scheb_two_factor", "fos_js_routing", "security", "debug", "web_profiler", "pimcore_admin", "pimcore", "pimcore_generator", "pimcore_ecommerce_framework", "pimcore_customer_management_framework", "output_data_config_toolkit", "web2_print_tools", "pimcore_data_hub", "number_sequence_generator", "workflow_gui", "app", "httplug", "hwi_oauth"" in /opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml (which is being imported from "/opt/pimcore-6/apps/pimcore/htdocs/app/config/config_dev.yml").
No you didnt. Error says that you have still bundle configuration in file app/config/config.yml
I have deleted the bundle in app/config/config.yml: i removed 👍 divante_google_translate: api_key: AI...s source_lang: en_US
after I enabled: Enable the Bundle:
./bin/console pimcore:bundle:enable GoogleTranslateBundle
after I added the 👍 divante_google_translate: api_key: AI...s source_lang: en_US
again in the config file, but still get the SAME error
there is no extension able to load the configuration for "divante_google_translate" (in "/opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml")
maybe I miss a config.yml file of divante-google-translate: when I look for config.yml (locate config.yml)
/opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml /opt/pimcore-6/apps/pimcore/htdocs/vendor/hwi/oauth-bundle/Tests/App/config.yml /opt/pimcore-6/apps/pimcore/htdocs/vendor/pimcore/customer-management-framework-bundle/frontend-samples/sso_client/src/AppBundle/Resources/config/pimcore/config.yml /opt/pimcore-6/apps/pimcore/htdocs/vendor/pimcore/customer-management-framework-bundle/src/Resources/config/pimcore/config.yml /opt/pimcore-6/apps/pimcore/htdocs/vendor/pimcore/data-hub/src/Resources/config/config.yml /opt/pimcore-6/apps/pimcore/htdocs/vendor/pimcore/output-data-config-toolkit-bundle/src/Resources/config/pimcore/config.yml /opt/pimcore-6/apps/pimcore/htdocs/vendor/pimcore/pimcore/.github/ci/files/app/config/config.yml /opt/pimcore-6/apps/pimcore/htdocs/vendor/pimcore/pimcore/bundles/CoreBundle/Resources/config/pimcore/config.yml /opt/pimcore-6/apps/pimcore/htdocs/vendor/pimcore/pimcore/bundles/EcommerceFrameworkBundle/Resources/config/pimcore/config.yml /opt/pimcore-6/apps/pimcore/htdocs/vendor/pimcore/pimcore/bundles/InstallBundle/Resources/config/config.yml /opt/pimcore-6/apps/pimcore/htdocs/vendor/pimcore/web2print-tools-bundle/src/Resources/config/pimcore/config.yml /opt/pimcore-6/apps/pimcore/htdocs/vendor/symfony-cmf/routing-bundle/tests/Fixtures/App/config/config.yml /opt/pimcore-6/apps/pimcore/htdocs/vendor/symfony-cmf/routing-bundle/tests/Fixtures/fixtures/config/config.yml
I do not see the config file of Divante-Google-Translate
i followed this advice: "first remove your configuration next enable bundle and add configuration again."
i removed this from config.yml: divante_google_translate: api_key: AI...s source_lang: en_US
I enabled the bundle
after I put this configuration to config.yml: divante_google_translate: api_key: AI...s source_lang: en_US
BUT AGAIN ERROR: here is no extension able to load the configuration for "divante_google_translate" (in "/opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml"). Looked for namespace "divante_google_translate", found ""framework", "twig", "monolog", "swiftmailer", "doctrine", "sensio_framework_extra", "cmf_routing", "presta_sitemap", "scheb_two_factor", "fos_js_routing", "security", "debug", "web_profiler", "pimcore_admin", "pimcore", "pimcore_generator", "pimcore_ecommerce_framework", "pimcore_customer_management_framework", "output_data_config_toolkit", "web2_print_tools", "pimcore_data_hub", "number_sequence_generator", "workflow_gui", "app", "httplug", "hwi_oauth"" in /opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml (which is being imported from "/opt/pimcore-6/apps/pimcore/htdocs/app/config/config_dev.yml").
PLEASE HELP. What I have to do?
/opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml
imports:
- { resource: parameters.yml }
- { resource: security.yml }
- { resource: services.yml }
- { resource: 'local/' }
- { resource: ecommerce/base-ecommerce.yml }
- { resource: cmf.yml }
- { resource: /opt/pimcore-6/apps/pimcore/htdocs/var/bundles/workflow-gui/workflow.yml }
pimcore:
# IMPORTANT Notice!
# Following there are only some examples listed, for a full list of possible options, please run the following command:
# ./bin/console debug:config pimcore
# you can also filter them by path, eg.
# ./bin/console debug:config pimcore assets
# or even more specific:
# ./bin/console debug:config pimcore assets.image
divante_google_translate:
api_key: "A...LN"
source_lang: "en_US"
#### TRANSLATIONS
# translations:
# case_insensitive: true
#### REDIS CACHE
# cache:
# pools:
# redis:
# enabled: true
# connection:
# server: localhost
# database: 14
#### FEATURE FLAGS
# flags:
# zend_date: true
#### CLASS OVERRIDES EXAMPLES
# models:
# class_overrides:
# 'Pimcore\Model\DataObject\News': 'AppBundle\Model\DataObject\News'
# 'Pimcore\Model\DataObject\News\Listing': 'AppBundle\Model\DataObject\News\Listing'
# 'Pimcore\Model\DataObject\Folder': 'AppBundle\Model\DataObject\Folder'
# 'Pimcore\Model\Asset\Folder': 'AppBundle\Model\Asset\Folder'
# 'Pimcore\Model\Asset\Image': 'AppBundle\Model\Asset\Image'
# 'Pimcore\Model\Document\Page': 'AppBundle\Model\Document\Page'
# 'Pimcore\Model\Document\Link': 'AppBundle\Model\Document\Link'
# 'Pimcore\Model\Document\Listing': 'AppBundle\Model\Document\Listing'
#### CUSTOM DOCUMENT EDITABLES
# documents:
# tags:
# map:
# markdown: \AppBundle\Model\Document\Tag\Markdown
#### CUSTOM OBJECT DATA TYPES
# objects:
# class_definitions:
# data:
# map:
# myDataType: \AppBundle\Model\DataObject\Data\MyDataType
#### ASSET CUSTOM SETTINGS
# assets:
# versions:
# use_hardlinks: false
# image:
# low_quality_image_preview:
# enabled: false
# generator: imagick
# thumbnails:
# webp_auto_support: false
#### SYMFONY OVERRIDES
framework:
#### USE SESSION HANDLER CONFIGURED IN php.ini
# session:
# handler_id: null
my config file looks like: what is wrong? /opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml
imports:
{ resource: parameters.yml }
{ resource: security.yml }
{ resource: services.yml }
{ resource: 'local/' }
{ resource: ecommerce/base-ecommerce.yml }
{ resource: cmf.yml }
{ resource: /opt/pimcore-6/apps/pimcore/htdocs/var/bundles/workflow-gui/workflow.yml }
pimcore:
possible options, please run the following command:
divante_google_translate: api_key: "A...LN" source_lang: "en_US"
'AppBundle\Model\DataObject\News'
'AppBundle\Model\DataObject\News\Listing'
'AppBundle\Model\DataObject\Folder'
'AppBundle\Model\Document\Listing'
framework:
Op wo 17 feb. 2021 om 22:01 schreef Piotr Rugala notifications@github.com:
No you didnt. Error says that you have still bundle configuration in file app/config/config.yml
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DivanteLtd/pimcore-google-translate/issues/5#issuecomment-780850407, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARJXO3A56YKJ7VMIYJCTAPLS7QVDDANCNFSM4XYPG2QQ .
This my error:
There is no extension able to load the configuration for "divante_google_translate" (in "/opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml"). Looked for namespace "divante_google_translate", found ""framework", "twig", "monolog", "swiftmailer", "doctrine", "sensio_framework_extra", "cmf_routing", "presta_sitemap", "scheb_two_factor", "fos_js_routing", "security", "debug", "web_profiler", "pimcore_admin", "pimcore", "pimcore_generator", "pimcore_ecommerce_framework", "pimcore_customer_management_framework", "output_data_config_toolkit", "web2_print_tools", "pimcore_data_hub", "number_sequence_generator", "workflow_gui", "app", "httplug", "hwi_oauth"" in /opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml (which is being imported from "/opt/pimcore-6/apps/pimcore/htdocs/app/config/config_dev.yml").
From: Ismet Sener ismet.sener@gmail.com Sent: zondag 21 februari 2021 01:29 To: DivanteLtd/pimcore-google-translate reply@reply.github.com Subject: Re: [DivanteLtd/pimcore-google-translate] how to configure (#5)
my config file looks like: what is wrong?
/opt/pimcore-6/apps/pimcore/htdocs/app/config/config.yml
imports:
{ resource: parameters.yml }
{ resource: security.yml }
{ resource: services.yml }
{ resource: 'local/' }
{ resource: ecommerce/base-ecommerce.yml }
{ resource: cmf.yml }
{ resource: /opt/pimcore-6/apps/pimcore/htdocs/var/bundles/workflow-gui/workflow.yml }
pimcore:
divante_google_translate: api_key: "A...LN" source_lang: "en_US"
framework:
Op wo 17 feb. 2021 om 22:01 schreef Piotr Rugala <notifications@github.com mailto:notifications@github.com >:
No you didnt. Error says that you have still bundle configuration in file app/config/config.yml
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DivanteLtd/pimcore-google-translate/issues/5#issuecomment-780850407 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ARJXO3A56YKJ7VMIYJCTAPLS7QVDDANCNFSM4XYPG2QQ . https://ci3.googleusercontent.com/proxy/QKJr9XPkNxG1C1F7BrpC9OldEXCOg4VNM9HXceuZlc9VTx5VV_STfwTwGxpmtil1dQ0uUrGzgYsV6gKgBYDJq8updZqmGXeeUUpXe8Fi9F0IcM6iZYZ-g40mjhw7FhAZp2_lHP3XGpr0xZsZkrKmJKeuvDyDFHdaQArg4aHNeGcE0uSOKlRONWDFj4_0-OZWw-Td-U7va6odNFa2hjSWwvS
From your last message, the error is clear that the bundle is not correctly configured/installed
1st you should run the command:
./bin/console pimcore:bundle:enable GoogleTranslateBundle
Then you should add the configurations
divante_google_translate:
api_key: "A...LN"
source_lang: "en_US"
See that the indentation is important for your YAML configuration file to be valid
I've tried to install this bundle and unfortunately it doesn't work. If I will find some free time in week, I will fix bundle. Problem is with loading configuration (wrong Extension file name).
THANKS Prugala, any news?
@ismetsener hi, please download version 1.0.0. :)
I merged my Merge Request which included:
Remember to use new configuration options (you can find info in readme).
If all will work please close issue. Thanks
Dear Prugala,
I installed, when I translate I get the next error:No alive nodes found in your cluster
Timestamp: Mon Apr 05 2021 21:21:45 GMT+0200 (Midden-Europese zomertijd) Status: 500 | Internal Server Error URL: /admin/object/save?task=publish Method: PUT Message: No alive nodes found in your cluster Trace: in /opt/pimcore-6/apps/pimcore/htdocs/vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/StaticNoPingConnectionPool.php:64
@ismetsener error isnt related with this bundle. You have problem with connection to Elastic Search. Check your Elastic Search connection.
but it does not translate also
Open Browser developer tools (F12) > tab: Network. Click on translate and show me response from translate request.
{success: false, message: "Something went wrong"} message: "Something went wrong" success: fals
Do you use Xdebug? If yes please add breaking point on line 56:
https://github.com/DivanteLtd/pimcore-translation-bundle/blob/master/src/DivanteTranslationBundle/Controller/ObjectController.php#L56
and after click translate get $exception->getMessage()
when xDebug stops.
if not, add before return in line 56:
var_dump($exception->getMessage());
and copy var dump value from response after translate.
/opt/pimcore-6/apps/pimcore/htdocs/vendor/divante-ltd/pimcore-google-translate/src/DivanteTranslationBundle/Controller/ObjectController.php:56:string 'Provider default google_translate is not implemented.' (length=53){"success":false,"message":"Something went wrong"}
I see, I have to add new provider but how?
How to add new provider Create Provider and implement interface
DivanteTranslationBundle\Provider\ProviderInterface
ok :)
So in your config remove provider: default google_translate
or change it on provider: google_translate
You set wrong provider name. I wrote that default value for provider is google_translate
I did, it seems to work, but strange translation: english text: The Aston Martin DB5 is a British luxury grand tourer (GT) that was made by Aston Martin and designed by the Italian coachbuilder Carrozzeria Touring Superleggera. Released in 1963, it was an evolution of the final series of DB4. The DB series was named honouring Sir David Brown (the owner of Aston Martin from 1947 to 1972).
Although not the first in the DB series, the DB5 is the best-known cinematic James Bond car, first appearing in the James Bond film Goldfinger (1964).
translated in German: % 3Cp% 3Die% 20Aston% 20Martin% 20DB5% 20is% 20a% 20British% 20luxury% 20grand% 20tourer% 20% 28GT% 29% 20at% 20was% 20made% 20by% 20Aston% 20Martin% 20und% 20designed% 20by% 20the% 20Italian % 20coachbuilder% 20Carrozzeria% 20Touring% 20Superleggera.% 20Released% 20in% 201963% 2C% 20it% 20was% 20an% 20evolution% 20of% 20the% 20final% 20series% 20of% 20DB4.% 20The% 20DB% 20series% 20was% % 20Sir% 20David% 20Brown% 20% 28the% 20owner% 20of% 20Aston% 20Martin% 20from% 201947% 20to% 201972% 29.% 3C% 2Fp% 3E% 0A% 0A% 3Cp% 3Abwohl% 20not% 20the% 20first% 20in% 20the% 20DB% 20series% 2C% 20the% 20DB5% 20is% 20the% 20best-% 20cinematic% 20James% 20Bond% 20car% 2C% 20first% 20appearing% 20in% 20the% 20James% 20Bond% 20film% 20Goldfinger% 20% 281964% 29.% 3C% 2Fp% 3E% 0A
OK I will close this issue. Please open one new about wrong translation.
Provider in new issue:
ok,, thanks for helping at this time at :) I wil open new issue
I installed this bundle/extension on my Pimcore 6.8.8 in which file can I configure: divante_google_translate: api_key: xxx source_lang: xxx
with kind regards, Ismet