Comments (10)
Feel free to make a PR. 👍
With concrete samples, before / after etc...
from sonataintlbundle.
I think this PR will be break compatibility for sure because it introduces a new parameter in all Twig filters. Is this ok? We could add the parameter to the end of the list instead of before the locale
argument, but it wouldn't be so nice.
public function formatDecimal($number, array $attributes = array(), array $textAttributes = array(), $locale = null)
would be
public function formatDecimal($number, array $attributes = array(), array $textAttributes = array(), symbolAttributes = array(), $locale = null)
from sonataintlbundle.
Yes I understand the local.
Maybe we could find another way to keep bc like a new method with old one deprecation.
If not, this feature will be for next major version.
In any case, any PR is welcome.
from sonataintlbundle.
I will try to work on a PR (I already overridden a few classes to support this feature in my project) when I have some spare time, but I'm not an expert of PRs so be patient. About using a new method, I'm not sure it would be a good solution because there would be two filters for each formatter that differs only in parameters. I saw Symfony couting the number of args in some cases to maintain BC break while attending a new major version. Maybe we could do the same?
from sonataintlbundle.
I saw Symfony couting the number of args in some cases to maintain BC break while attending a new major version. Maybe we could do the same?
I'm curious. Could you provide a code sample link of this?
from sonataintlbundle.
Here it is. As you can see from the comment, they use the func_num_args
function to support different function signatures and keep the compatibility with older versions.
from sonataintlbundle.
Seems to be a good alternative, let's try it.
from sonataintlbundle.
I've submitted a PR, although I noticed a few things that I have to fix before merging. Btw, if you want to do a code review and tell me what you think about how I tried to manage the BC it would be great
from sonataintlbundle.
@ste93cry would be good if you could prefix your PR with [WIP]
if you work on it
thank you! 👍
from sonataintlbundle.
@rande I don't want to sound rude, but can you please check my PR and eventually approve/disapprove it?
from sonataintlbundle.
Related Issues (20)
- Add a tag for symfony 3 support HOT 5
- Cache number and date formatters? HOT 5
- Drop support for old php / symfony versions
- Region ignored in language filter HOT 3
- Allow Twig 2 HOT 6
- Why intl bundle conflicts with user bundle ? HOT 1
- Conflict issue with user-bundle HOT 13
- Deprecate some Twig extensions HOT 2
- Provide autowiring for DateTimeHelper HOT 3
- Strict type checking introduced in 2.6.0 throws error on Doctrine decimal type HOT 1
- Problem with twig datetime extension for twig 2.10
- Deprecate this bundle HOT 14
- Conflict with sonata-project/intl-bundle HOT 11
- Incompatible with php8 HOT 4
- Strict type checking throws error on formatting Doctrine decimal type as number HOT 11
- sonata.intl.templating.helper.number service does not exist
- RequestStackDetector does not have the default locale anymore. HOT 2
- Make Templating Dependency Optional
- Sonata\IntlBundle\Helper\BaseHelper::getLocale() problem HOT 11
- default for locale must not null in list_decimal.html.twig HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sonataintlbundle.