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

Add possibility to disable entity translations #1852

Closed
soullivaneuh opened this issue Oct 12, 2017 · 8 comments
Closed

Add possibility to disable entity translations #1852

soullivaneuh opened this issue Oct 12, 2017 · 8 comments

Comments

@soullivaneuh
Copy link
Contributor

Currently, we can configure a default translation_domain, default to messages.

But if I don't want to take care of translations for this bundle, I can't disable the usage and I have this bunch or warning messages:

image

IMHO, we should have the possibility to disable it.

@javiereguiluz
Copy link
Collaborator

If you set the translation_domain option to false, the translation is disabled. The problem is that the interface translation is disabled too, so you'll see action.edit instead of Edit, etc.

Is there a simple solution to disable the translation for everything except for the EasyAdmin translation domain?

@javiereguiluz
Copy link
Collaborator

Let's close this as "fixed" because translation can be disabled per entity or for the entire backend. However, this bundle is really designed to have translation enabled (for the interface, etc.) Thanks!

@soullivaneuh
Copy link
Contributor Author

The problem is that the interface translation is disabled too, so you'll see action.edit instead of Edit, etc.
Let's close this as "fixed" because translation can be disabled per entity.

It does not disable the translation, but tries instead to translate on the false translation domain:

Translation not found.
[▼
  "id" => "Repository"
  "domain" => false
  "locale" => "en"
]

Tested on the last version.

Could you please re-open the issue?

Plus, disabling per entity may indeed works, but this is quite overkill if we don't want translation at all except the interface itself.

Maybe add a entities_translation_domain global option?

@soullivaneuh
Copy link
Contributor Author

Plus, with this configuration for entity:

    Repository:
      class: AppBundle\Entity\Repository
      translation_domain: false

Some interface translation are not translated anymore:

image

But this is maybe the place for another issue.

@javiereguiluz
Copy link
Collaborator

I don't like adding more config options ... so I'm going to think a bit more about this. About the interface ... the problem is that we translate actions with messages instead of EasyAdmin domain, so you can customize them. Not sure if we can solve that.

Moreover, this is related to some controversial Symfony feature/behavior. See symfony/symfony#21726

@javiereguiluz javiereguiluz reopened this Oct 23, 2017
@soullivaneuh
Copy link
Contributor Author

I don't like adding more config options ...

Well, the fact is the end user has to add this option on each entity to avoid translation. So this is not better IMHO.

About the interface ... the problem is that we translate actions with messages instead of EasyAdmin domain, so you can customize them.

What do you mean by "you can customize them"? What is the goal? Customize globally or per entity? If it's globally, well we can still override the EasyAdmin domain.

If it's per domain, I really don't see why we should change the "Search" words on entity level. 🤔

BTW, it's the same thing about action.show and action.edit thing.

So event if symfony/symfony#21726 is accepted, the issue will remain the same... or will be moved. 😄

Possible options to avoid even more configuration about message domain choice would be to change action.* translation ID by the english message itself (Search, Show, Edit, etc...).

@javiereguiluz
Copy link
Collaborator

I'm closing this issue because we're starting a new phase in the history of this bundle (see #2059). We've moved it into a new GitHub organization and we need to start from scratch: no past issues, no pending pull requests, etc.

I understand if you are angry or disappointed by this, but we really need to "reset" everything in order to reignite the development of this bundle.

@alfred2016decanet
Copy link

hi,
i have deployed Knp translation bundle, ans easy admin, but search input on list view don't display results associated on translated entity. How to make search view work with entity translated?

Tanks for respond quickly

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

3 participants