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

Abstract transformer need to use translation domain for correct label translation and should be used for placeholder too #4

Closed
grimpows opened this issue Oct 25, 2017 · 1 comment

Comments

@grimpows
Copy link

grimpows commented Oct 25, 2017

Thanks for this great usefull bundle, i just got a problem, you call translator "As It" without check for any translation domain who can be specified in symfony form builder, and look like you dont use translator at all for placeholder, as i'm going to have a base project who have to be able to maintain multi-language functionality i think you just need a little change to make translator work like a charm without put all in a messages.{lang}.yml


namespace Limenius\Liform\Transformer;


abstract class AbstractTransformer {

///...

protected function addLabel($form, $schema)
    {
        if ($label = $form->getConfig()->getOption('label')) {
            $schema['title'] = $this->translator->trans($label); // <----- should be ' .... '->trans($label, [], $TranslationDomainSpecifiedFromSymfonyFormBuildler )
        } else {
            $schema['title'] = $this->translator->trans($form->getName());
        }

        return $schema;
    }

//....

}

Edit : this is related to https://github.com/Limenius/Liform i'll make a PR to solve this issue
@nacmartin
Copy link
Member

Fixed by Limenius/Liform#15

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