Skip to content
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

[10.x] Add localization support to the Number::forHumans helper #49106

Commits on Nov 23, 2023

  1. Add localization support for the Number::forHumans helper

    This has been requested by a large number of people after laravel#48845. My attempt at implementing localization support for this method is using translation helpers.
    
    ```php
    // Example language setup
    
    'sv' => [
        'thousand' => 'tusen',
        'million' => 'miljon',
        'billion' => 'miljard',
        'trillion' => 'biljon',
        'quadrillion' => 'biljard',
    ],
    ```
    caendesilva committed Nov 23, 2023
    Configuration menu
    Copy the full SHA
    c3b7ba1 View commit details
    Browse the repository at this point in the history
  2. Update Number::forHumans helper to support pluralized localization

    I just want to preface this with saying that language is complex. Like really complex. It's doubtful that a relatively short and simple method can contain all the edge cases needed for full support of something as complex as this. I totally understand if this is not something that's worth merging, but I wanted to try it out so here it is. We can always revert the commit.
    caendesilva committed Nov 23, 2023
    Configuration menu
    Copy the full SHA
    d08a707 View commit details
    Browse the repository at this point in the history