Skip to content

Added translation to placeholder and title attributes #4194

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

Merged
merged 1 commit into from May 22, 2012
Merged

Added translation to placeholder and title attributes #4194

merged 1 commit into from May 22, 2012

Conversation

ghost
Copy link

@ghost ghost commented May 3, 2012

No description provided.

@schmittjoh
Copy link
Contributor

Better translate it where it is defined.

Dynamic translations are usually not desirable as they cannot be automatically extracted, and thus require more work.

@ruimarinho
Copy link

@schmittjoh but isn't that the same case as with labels for instance? I don't think injecting the translator service into the form type would require less work than what this PR suggests.

@schmittjoh
Copy link
Contributor

Yeah, same thing.

There might be some cases where it's fine, but in general, we should try to not translate dynamic vars.

@ruimarinho
Copy link

@schmittjoh I think that's one of those cases, since these attributes in particular (title and placeholder) are intended to aid the user with a brief description. I understand (and agree) with your concern regarding dynamic vars, but in my opinion this is a use case where it is worth it. Just my two cents :)

@stof
Copy link
Member

stof commented May 3, 2012

@schmittjoh the issue is that translating the label before the template would require injecting the translator in the form types (as the form label can be set there) and would force the user to duplicate the translation process if they pass the label explicitly in the template.

fabpot added a commit that referenced this pull request May 22, 2012
Commits
-------

23bad29 Added translation to placeholder and title attributes

Discussion
----------

Added translation to placeholder and title attributes

---------------------------------------------------------------------------

by schmittjoh at 2012-05-03T13:52:38Z

Better translate it where it is defined.

Dynamic translations are usually not desirable as they cannot be automatically extracted, and thus require more work.

---------------------------------------------------------------------------

by ruimarinho at 2012-05-03T13:57:30Z

@schmittjoh but isn't that the same case as with labels for instance? I don't think injecting the translator service into the form type would require less work than what this PR suggests.

---------------------------------------------------------------------------

by schmittjoh at 2012-05-03T14:02:02Z

Yeah, same thing.

There might be some cases where it's fine, but in general, we should try to not translate dynamic vars.

---------------------------------------------------------------------------

by ruimarinho at 2012-05-03T14:17:44Z

@schmittjoh I think that's one of those cases, since these attributes in particular (title and placeholder) are intended to aid the user with a brief description. I understand (and agree) with your concern regarding dynamic vars, but in my opinion this is a use case where it is worth it. Just my two cents :)

---------------------------------------------------------------------------

by stof at 2012-05-03T18:07:01Z

@schmittjoh the issue is that translating the label before the template would require injecting the translator in the form types (as the form label can be set there) and would force the user to duplicate the translation process if they pass the label explicitly in the template.
fabpot added a commit that referenced this pull request May 22, 2012
@fabpot fabpot merged commit 23bad29 into symfony:master May 22, 2012
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

Successfully merging this pull request may close these issues.

4 participants