grid-js/gridjs

Empty translated fields fallback to default language.

rubycon opened this issue · 0 comments

Describe the bug
Empty translated fields fallback to default language.

To Reproduce
Setup a paginated table with FR translation and you'll see something like :

Affichage des résultats 1 à 6 sur 6 results

Expected behavior
It should display :

Affichage des résultats 1 à 6 sur 6.

Additional context
The issue comes from here :

if (translated) {

The french translation file translate results as an empty string to compensate issues with the word basis translation but the translation function fallback to the default language when dealing with an empty string.

Usually its the right behaviour for a translation system but here it conflicts with the hacky way the translation is handled.

See issue #1416 (comment)