question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect returned value

See original GitHub issue

https://github.com/rmariuzzo/Lang.js/blob/31474a87dc21e4434b66b527d00944c61fc2a13d/src/lang.js#L288

if we have two lines as

    'book.btn.finish'               => 'Finish Booking',
    'book.btn'                        => 'Book Now',

and request Lang.get(‘book.btn.finish’) then _getMessage returned ‘Book Now’

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
RomeroMskcommented, Apr 16, 2018

I ran into the similar issue.

Imagine the situation when you validate an input array with the nested fields in Laravel:

$request->validate([
    ...
    'location' => 'array',
    'location.city_id' => 'required',
    ...
]);

To localize the validation messages for both location and location.city_id attributes we need to add two translation strings:

// resources/lang/en/validation.php

return [
    ...
    'attributes' => [
        ...
        'location' => 'Location',
        'location.city_id' => 'City',
        ...
    ],
];

And in this case, if we want to use the validation.php file as a source for Lang.js, we will get the Location translation result for the lang.get('validation.attributes.location.city_id') call (instead of City).

1reaction
RomeroMskcommented, Jul 24, 2018

Bump.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Incorrect return value, not getting a 'True' return, Python
I have put some print statement in the code to help debug. It shows that the 'print("Got True")' statement ran, so I know...
Read more >
CWE-253: Incorrect Check of Function Return Value
The software incorrectly checks a return value from a function, which prevents the software from detecting errors or exceptional conditions.
Read more >
wrong function return value
In I2C recepcion(), when I receive all the bytes i call a function ( Calculate_CS() ) to calculate the checksum of all my...
Read more >
Wrong return value - Python - Codecademy Forums
Your function fails on scrabble_score("pie"). It returns "3" when it should return "5". How can I fix it?
Read more >
How to correct a #VALUE! error in the IF function
Problem : The syntax is incorrect. If a function's syntax is not constructed correctly, it can return the #VALUE! error. Solution: Make sure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found