Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin localization didn't fallback to language if locale is specified #1874

Closed
7 tasks done
miketsoft opened this issue Dec 9, 2024 · 1 comment
Closed
7 tasks done

Comments

@miketsoft
Copy link
Contributor

Prerequisites

  • I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
  • The issue still exists against the latest master branch of bootstrap-fileinput.
  • This is not an usage question. I confirm having read the plugin documentation and demos.
  • This is not a general programming / coding question. (Those should be directed to the webtips Q & A forum).
  • I have attempted to find the simplest possible steps to reproduce the issue.
  • I have included a failing test as a pull request (Optional).

Steps to reproduce the issue

We have a multi-language Yii2 application and use FileInput widget. But when the application language (locale to be more precise) Yii::$app->language is set, for example, to uk-UA, the plugin on the page is rendered with the default language (English).

While method \kartik\base\BaseAssetBundle::addLanguage attach to asset correct l10n file (uk.js), widget \kartik\file\FileInput register plugin with "language": "uk-UA". So, variable $.fn.fileinputLocales has key uk, but the plugin requests uk-UA and fallbacks to en.

The same problem is described in comment

Expected behavior and actual behavior

I was expecting, that when I set the locale for the plugin, it'll correctly fallback to the language part of the locale if possible.

Isolating the problem

  • I can reproduce this bug in a jsbin
@kartik-v
Copy link
Owner

Fixed via #1875

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants