Skip to content

[2.3] Added currency locale data, form type and validator#6566

Closed
mvrhov wants to merge 1 commit intosymfony:masterfrom
mvrhov:currency
Closed

[2.3] Added currency locale data, form type and validator#6566
mvrhov wants to merge 1 commit intosymfony:masterfrom
mvrhov:currency

Conversation

@mvrhov
Copy link
Copy Markdown

@mvrhov mvrhov commented Jan 5, 2013

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes
License of the code: MIT
Documentation PR: symfony/symfony-docs#2105

@pjedrzejewski
Copy link
Copy Markdown

Big 👍 for this. Thanks @mvrhov!

@mvrhov
Copy link
Copy Markdown
Author

mvrhov commented Jan 5, 2013

BTW: I have no idea why the php 5.3.x seg'faults when running tests on Travis.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should probably be:

'choices' => Locale::getDisplayCurrencies(Locale::getDefault()),

(use Symfony's Locale consistently)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All other types: Country, Language, Locale, Date, Money.. also use the one from main ns.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case I won't argue ;)

I still think we should use Symfony's Locale class. However, it should be used everywhere consistently (so if we're about to fix it, we should fix it in other types as well).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakzal It doesn't really matter which of the two you use. If you think it is better, you can create a PR that fixes appearances of \Locale::get|setDefault to Symfony's equivalent.

@mvrhov
Copy link
Copy Markdown
Author

mvrhov commented Jan 6, 2013

@fabpot: Any chances of having this in 2.2? I really need this in my next project and I would be a shame if I had to maintain a 2.2 fork just because of this feature

@francoispluchino
Copy link
Copy Markdown
Contributor

👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well the truth is that the file is almost identical to other locale based validators. So basically I'm the author of the few lines that are different.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's ok that you are the author.
To me the author is the one who had the idea/designed it conceptually or contributed large parts of the code.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mvrhov it's your decision :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still you have edited the file, so you should at least add yourself as author (there can be more than one author).

@Baachi
Copy link
Copy Markdown
Contributor

Baachi commented Feb 1, 2013

Big 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phpdoc missing

@webmozart
Copy link
Copy Markdown
Contributor

Looks good apart from a few minor issues!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds strange. Why not getCurrencyNames?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see it's because \Locale also uses getDisplay....

@mvrhov
Copy link
Copy Markdown
Author

mvrhov commented Apr 18, 2013

This has been implemented as a part of #7386

@mvrhov mvrhov closed this Apr 18, 2013
@webmozart
Copy link
Copy Markdown
Contributor

@mvrhov FYI #7386 does not contain a Currency type or validator.

@mvrhov
Copy link
Copy Markdown
Author

mvrhov commented Apr 18, 2013

Ok, I'll reopen and rebase this later today.

@mvrhov mvrhov reopened this Apr 18, 2013
@mvrhov
Copy link
Copy Markdown
Author

mvrhov commented Apr 22, 2013

This is now rebased

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing doc block

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bschussek All form types are without it. do you still want me to add it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bad examples are still bad examples :)

@webmozart
Copy link
Copy Markdown
Contributor

Thank you @mvrhov! :) 👍

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: locale -> currency

@mvrhov
Copy link
Copy Markdown
Author

mvrhov commented Apr 23, 2013

Please let me know before merging so I can cherry pick this on master and do a clean PR.
I'm afraid that even though I squashed the commits this PR will weigh a hefty 2,8M, due to currency resources data that are not needed anymore.

@webmozart
Copy link
Copy Markdown
Contributor

Looks good :) Not sure what you mean with your last comment, but do whatever you feel is necessary!

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.

8 participants