symfony-bundle icon indicating copy to clipboard operation
symfony-bundle copied to clipboard

Edit live

Open ArmandArthur opened this issue 1 year ago • 8 comments

I use your bundle. I have the page "admin/_trans"and edit in place ok :

But it's seems it's possible to edit the translation in the page (2 buttons - open edit, close edit)

in the documentation, you do reference to "container" for activating.... Symfony Edit In Place — PHP Translation 1.0.0 documentation

In symfony 7, what's mean is it, container? Do i need te create a service and inject this in my controller?

ArmandArthur avatar Dec 23 '24 15:12 ArmandArthur

Are you about this code?

$container->get('php_translation.edit_in_place.activator')->activate();

If you need that service somewhere in your PHP code, e.g. in a contrller - inject that php_translation.edit_in_place.activator service. To know the corresponding class name for typehinting you can use this command:

bin/console debug:autowiring

And search for the corresponding class name for php_translation.edit_in_place.activator to know what typehint to use

bocharsky-bw avatar Dec 23 '24 16:12 bocharsky-bw

It's no appear php_translation.edit_in_place.activator after use the bin/console debug:autowiring.

yes for $container.

ArmandArthur avatar Dec 23 '24 16:12 ArmandArthur

It's ok for injecting the service in construct controller, call the method activate in my service which call your activate method.

But no button red/green? What do i miss?

Edit: OK, jut add the translation in twig..... xD

ArmandArthur avatar Dec 23 '24 17:12 ArmandArthur

I notice your bundle is not connected to the impersonal user... when i change user, button edit keep here?µ

Edit, it's seems impossible to use your module form label form....?

ArmandArthur avatar Dec 23 '24 17:12 ArmandArthur

You should care about who is allowed to use this feature yourself. I.e. you should care about enabling this feature for admin only if you don't want your users be able to edit as well, e.g. add a check and enable this feature only for admin users

bocharsky-bw avatar Dec 23 '24 19:12 bocharsky-bw

Your bundle doesn't work for labels define in formType. Need to set up the translation in twig. Form_label (function twig) is not "raw" your x-trans element. Have to override form_label... Complex.

next, Do i need to code this feature for secure the translation edit for admins?_

Edit: Ok for the feature admin, done. Else, how can i override the template "/_trans/app/en/messages"?

ArmandArthur avatar Dec 23 '24 19:12 ArmandArthur

This does not sound like an issue with this bundle, maybe the community on StackOverflow is more active and capable of helping you with these Symfony related issues: https://stackoverflow.com/questions/tagged/symfony

rvanlaak avatar Dec 28 '24 16:12 rvanlaak

Ok but for label form, it's normal?

ArmandArthur avatar Dec 29 '24 08:12 ArmandArthur