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

[Form] DateIntervalType: Do not try to translate choices #20886

Merged
merged 1 commit into from Dec 13, 2016

Conversation

Projects
None yet
4 participants
@ogizanagi
Member

ogizanagi commented Dec 12, 2016

Q A
Branch? 3.2
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets N/A
License MIT
Doc PR N/A

When using choice widgets, the form type should not try to translate each options, otherwise, you'll get something like this:

screenshot 2016-12-12 a 23 37 09

screenshot 2016-12-12 a 23 37 23

@fabpot

This comment has been minimized.

Member

fabpot commented Dec 13, 2016

Thank you @ogizanagi.

@fabpot fabpot merged commit b6831d2 into symfony:3.2 Dec 13, 2016

3 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
fabbot.io Your code looks good.
Details

fabpot added a commit that referenced this pull request Dec 13, 2016

bug #20886 [Form] DateIntervalType: Do not try to translate choices (…
…ogizanagi)

This PR was merged into the 3.2 branch.

Discussion
----------

[Form] DateIntervalType: Do not try to translate choices

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | N/A

When using choice widgets, the form type should not try to translate each options, otherwise, you'll get something like this:

<img width="150" alt="screenshot 2016-12-12 a 23 37 09" src="https://cloud.githubusercontent.com/assets/2211145/21119721/25411620-c0c4-11e6-9848-95393d1d21c4.PNG">
<img width="1075" alt="screenshot 2016-12-12 a 23 37 23" src="https://cloud.githubusercontent.com/assets/2211145/21119722/2543ccf8-c0c4-11e6-9842-ae84dc895a0b.PNG">

Commits
-------

b6831d2 [Form] DateIntervalType: Do not try to translate choices

@ogizanagi ogizanagi deleted the ogizanagi:fix/form/date_interval_type/trans_choice_domain branch Dec 13, 2016

@fabpot fabpot referenced this pull request Dec 13, 2016

Merged

Release v3.2.1 #20897

@mickaelandrieu

This comment has been minimized.

Contributor

mickaelandrieu commented Dec 13, 2016

It's late but why we are not allowed to translate very option ? To me the bug was more in webprofiler than in DateIntervalType ...

@ogizanagi

This comment has been minimized.

Member

ogizanagi commented Dec 13, 2016

Not sure to understand you.
Here is what the rendering of a \DateIntervalType looks like, when using choice as value of the widget option:

screenshot 2016-12-13 a 22 45 43

As you can see, it only consists of raw integer values in <select> fields representing an amount of months, days, hours, ... There is nothing to translate in there.

If you're talking about being able to change the label of each sub-choice type, see #20887

@mickaelandrieu

This comment has been minimized.

Contributor

mickaelandrieu commented Dec 13, 2016

Yes, totaly :) just misunderstood the scope of this PR

fabpot added a commit that referenced this pull request Jan 11, 2017

feature #20887 [Form] DateIntervalType: Allow to configure labels & e…
…nhance form theme (ogizanagi)

This PR was merged into the 3.3-dev branch.

Discussion
----------

[Form] DateIntervalType: Allow to configure labels & enhance form theme

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no (unless someone relies on this non themed type)
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | N/A
| License       | MIT
| Doc PR        | Should document the new `labels` option

I just realized by using it for last fixes in #20886 and #20877 that this type was not really themed:

### before

<img width="861" alt="screenshot 2016-12-13 a 00 54 35" src="https://cloud.githubusercontent.com/assets/2211145/21121792/c589d27a-c0ce-11e6-8368-a396fda3bc7a.PNG">

At least labels should appear, but this also means being able to change them (thus the new `labels` option).

I think the form themes should provide a functional & minimalistic integration like this:

### after

<img width="862" alt="screenshot 2016-12-13 a 00 54 17" src="https://cloud.githubusercontent.com/assets/2211145/21121814/d9c4ead6-c0ce-11e6-94e1-41e6c14884a7.PNG">

---
(On screenshots above, I've only added a css rule to remove the 100% width of the `.table` class. See #20887 (comment))

Commits
-------

bfd9e50 [Form] DateIntervalType: Allow to configure labels & enhance form theme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment