Comments (3)
Unless I am missing something, it is not clear if this is expected behavior.
This is the expected behavior and described in the documentation: https://laravel.com/docs/11.x/localization#using-translation-strings-as-keys
JSON translations were never meant to work exactly the same as PHP translations.
from framework.
JSON translations were never meant to work exactly the same as PHP translations.
I'm aware. I fail to see in the docs where it says a key for which a translation is explicitly defined, would return the key. i.e.:
// en.json
...
"empty": "",
"zero": "0",
...
// in a PHP file
__("empty") // returns "empty"
__("zero") // returns "zero"
Maybe the docs should mention these edge cases.
Thank you.
from framework.
Feel free to send a PR to the documentation.
from framework.
Related Issues (20)
- `Queue::bulk()` does not use the target queues of the supplied jobs HOT 1
- Error with Pusher Authentication Url since 11.10.0 upgrade HOT 14
- Registered event being dispatched twice since v11.9.0 HOT 4
- Target [Illuminate\Contracts\Debug\ExceptionHandler] is not instantiable HOT 2
- Connection Variable not applied in migration down() method HOT 6
- Config stub does not match default config file. Causes error when using dontMergeFrameworkConfiguration()
- Breaking change in registration of inherited providers HOT 4
- When Batch uses the add method to add jobs, the totalJobs count of the batch is incorrect in the test after using `Bus::fake()`
- SQLite issue with default 0 columns when migrating db from schema dump since L11 upgrade HOT 7
- Laravel 10: Blade render HOT 1
- AuthenticatedLayout issue with Laravel Breeze/React HOT 1
- Laravel Horizon is scaling the wrong way (auto + max-processes) HOT 2
- Call to a member function bindTo() on null HOT 3
- Bug: Blade render HOT 2
- `migrate:fresh` artisan command does not drop schema from non-default databases in a multiple database usecase before attempting to create schema HOT 1
- Throttle middleware does not always reset after defined duration HOT 3
- Validator wildcard custom attributes break with NestedRules HOT 1
- From Address is not applied when mail is sent HOT 1
- Pivot table name does not use a plural form HOT 3
- ShouldBeUnique Does Not Universally Prevent Duplicates HOT 1
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 framework.