Git Product home page Git Product logo

Comments (4)

renky avatar renky commented on September 17, 2024 1

Thanks 👍

from publisher.

andrey-helldar avatar andrey-helldar commented on September 17, 2024

Laravel does convert passed names, but not all of them:

image

This feature is documented: https://laravel.com/docs/10.x/localization#replacing-parameters-in-translation-strings

Next, regarding the transformation. Based on the Str::ucfirst() function that Laravel calls for variables like :Attribute, it capitalizes only the first letter without touching the rest:

Str::ucfirst('e-mail addresse')  // E-mail addresse
Str::ucfirst('e-Mail Addresse')  // E-Mail Addresse
Str::ucfirst('E-Mail Addresse'); // E-Mail Addresse
return [
    'email' => 'The :attribute field must be a valid email address.'
            // :Attribute muss eine gültige E-Mail-Adresse sein.
];
__(':Attribute muss eine gültige E-Mail-Adresse sein.', ['attribute' => 'E-Mail Addresse'])
// E-Mail Addresse muss eine gültige E-Mail-Adresse sein.

You also specified the version "Laravel Lang 3.1.1". In fact, I can suggest that this is a version of the laravel-lang/common package, which, among other things, installs the laravel-lang/attributes dependency.

Also a feature of Laravel is that the field names can be automatically renamed, and this is where we are faced with the fact that you get "E-mail addresse" instead of "E-Mail Addresse" for the German language because the file contains incorrect, from the point of view German grammars, translations.

@sotten, @WhereIsLucas, can you help update the locales/de/php.json file in the Laravel Lang: Attributes project?

from publisher.

renky avatar renky commented on September 17, 2024

Ok, got it - then in fact this was "broken" when switching to the new structure 9 months ago... in the old validation.php files all attributes had capital letters - maybe this was done by a script? In meanwhile a few arguments have already been fixed but not all...

from publisher.

andrey-helldar avatar andrey-helldar commented on September 17, 2024

Indeed, I did not pay attention to it. My apologies.

I updated the values to match the previous version and released the hotfix. Update the dependencies with the composer update command and check again. Everything should be right now.

Thanks for the help!

from publisher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.