File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -820,11 +820,28 @@ class to convert English words from/to singular/plural with confidence::
820
820
The value returned by both methods is always an array because sometimes it's not
821
821
possible to determine a unique singular/plural form for the given word.
822
822
823
+ Symfony also provides inflectors for other languages::
824
+
825
+ use Symfony\Component\String\Inflector\FrenchInflector;
826
+
827
+ $inflector = new FrenchInflector();
828
+ $result = $inflector->singularize('souris'); // ['souris']
829
+ $result = $inflector->pluralize('hôpital'); // ['hôpitaux']
830
+
831
+ use Symfony\Component\String\Inflector\SpanishInflector;
832
+
833
+ $inflector = new SpanishInflector();
834
+ $result = $inflector->singularize('aviones'); // ['avión']
835
+ $result = $inflector->pluralize('miércoles'); // ['miércoles']
836
+
837
+ .. versionadded :: 7.2
838
+
839
+ The ``SpanishInflector `` class was introduced in Symfony 7.2.
840
+
823
841
.. note ::
824
842
825
- Symfony also provides a :class: `Symfony\\ Component\\ String\\ Inflector\\ FrenchInflector `
826
- and an :class: `Symfony\\ Component\\ String\\ Inflector\\ InflectorInterface ` if
827
- you need to implement your own inflector.
843
+ Symfony provides a :class: `Symfony\\ Component\\ String\\ Inflector\\ InflectorInterface `
844
+ in case you need to implement your own inflector.
828
845
829
846
.. _`ASCII` : https://en.wikipedia.org/wiki/ASCII
830
847
.. _`Unicode` : https://en.wikipedia.org/wiki/Unicode
You can’t perform that action at this time.
0 commit comments