Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit live #514

Open
ArmandArthur opened this issue Dec 23, 2024 · 6 comments
Open

Edit live #514

ArmandArthur opened this issue Dec 23, 2024 · 6 comments

Comments

@ArmandArthur
Copy link

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?

@bocharsky-bw
Copy link
Member

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

@ArmandArthur
Copy link
Author

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

yes for $container.

@ArmandArthur
Copy link
Author

ArmandArthur commented Dec 23, 2024

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
Copy link
Author

ArmandArthur commented Dec 23, 2024

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....?

@bocharsky-bw
Copy link
Member

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

@ArmandArthur
Copy link
Author

ArmandArthur commented Dec 23, 2024

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"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants