andywer / andywer/laravel-js-localization

Lang.get("") returns whole object of translations

Ouverte
#61 0 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
Langage dominant
PHP
Étoiles
143
Forks
53
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

When adding an empty string to `Lang.get()`, it returns the whole translation object for your locale.

Would expect it to just return an empty string?

E.g. `Lang.get("")` => `{ key1: "foo" ... }` (object)
Expected: `Lang.get("")` => `""` (string)

I know there is code that checks if the first argument to `Lang.get()` is the key name for one of the translation files and returns that object, but I am not sure if this is the intended behaviour.

Simple fix/PR would probably just be a `if (key === '') { return '' }`. Can provide if bug is confirmed.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.