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

Fix DatePicker Translation #2748

Closed
wants to merge 3 commits into from
Closed

Fix DatePicker Translation #2748

wants to merge 3 commits into from

Conversation

phili67
Copy link

@phili67 phili67 commented Jul 8, 2017

closes #2717

Better localisation for data-picker.
I substitute :

<script src="/skin/fullcalendar/fullcalendar.js"></script>

to :

<script src="/skin/adminlte/plugins/datepicker/locales/bootstrap-datepicker.getLocale(),0,2) ?>.js"></script>

Better localisation for data-picker
@ghost ghost assigned phili67 Jul 8, 2017
@ghost ghost added the In Review label Jul 8, 2017
@@ -271,6 +271,8 @@
<script src="<?= SystemURLs::getRootPath() ?>/skin/adminlte/plugins/input-mask/jquery.inputmask.date.extensions.js"></script>
<script src="<?= SystemURLs::getRootPath() ?>/skin/adminlte/plugins/input-mask/jquery.inputmask.extensions.js"></script>
<script src="<?= SystemURLs::getRootPath() ?>/skin/adminlte/plugins/datepicker/bootstrap-datepicker.js"></script>
<script src="<?= SystemURLs::getRootPath() ?>/skin/adminlte/plugins/datepicker/locales/bootstrap-datepicker.<?= substr($localeInfo->getLocale(), 0, 2) ?>.js"></script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fullcalendar has nothing to do with datepicker

bootstrap-datepicker.xx.js are included in the locale file see http://demo.churchcrm.io/master/skin/locale/fr_FR.js

please let us know the issue you are trying to fix

@@ -283,6 +285,10 @@
<script src="<?= SystemURLs::getRootPath() ?>/skin/adminlte/plugins/chartjs/Chart.min.js"></script>
<script src="<?= SystemURLs::getRootPath() ?>/skin/adminlte/plugins/pace/pace.min.js"></script>
<script src="<?= SystemURLs::getRootPath() ?>/skin/adminlte/plugins/select2/select2.full.min.js"></script>
<script src="<?= SystemURLs::getRootPath() ?>/skin/adminlte/plugins/select2/i18n/<?= substr($localeInfo->getLocale(), 0, 2) ?>.js"></script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this fix as we can add that to http://demo.churchcrm.io/master/skin/locale/fr_FR.js also

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work first, it's ... buggy unfonctional :
capture d ecran 2017-07-08 a 22 34 58

Here's an example of the code :
capture d ecran 2017-07-08 a 22 36 12

Copy link
Author

@phili67 phili67 Jul 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the only way is to use the guidelines of select2 and data-picker, or to use the js.php way.
So this is the way, I follow.

@@ -283,6 +285,10 @@
<script src="<?= SystemURLs::getRootPath() ?>/skin/adminlte/plugins/chartjs/Chart.min.js"></script>
<script src="<?= SystemURLs::getRootPath() ?>/skin/adminlte/plugins/pace/pace.min.js"></script>
<script src="<?= SystemURLs::getRootPath() ?>/skin/adminlte/plugins/select2/select2.full.min.js"></script>
<script src="<?= SystemURLs::getRootPath() ?>/skin/adminlte/plugins/select2/i18n/<?= substr($localeInfo->getLocale(), 0, 2) ?>.js"></script>
<script>
$(".multiSearch").select2.defaults.set("language", "<?= substr($localeInfo->getLocale(), 0, 2) ?>");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this change?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code will translate other languages :

  • the select2
  • all the date-picker.

For us it's important.
Last this the only way in the guidelines to translate this two parts.

@phili67
Copy link
Author

phili67 commented Jul 8, 2017

So this code allows you to get this result so you can see that every code is now translated :
capture d ecran 2017-07-08 a 22 30 55
capture d ecran 2017-07-08 a 22 31 28
capture d ecran 2017-07-08 a 10 16 43
With the normal code nothing is translated.

@crossan007 crossan007 changed the title Update Footer.php Fix DatePicker Translation Jul 9, 2017
@crossan007 crossan007 self-requested a review July 9, 2017 02:46
@crossan007
Copy link
Contributor

Closing this, since #2731 actually fixes #2717

@crossan007 crossan007 closed this Jul 9, 2017
@ghost ghost removed the In Review label Jul 9, 2017
@crossan007 crossan007 deleted the phili67-patch-11 branch July 9, 2017 02:56
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

Successfully merging this pull request may close these issues.

DatePicker is not localized / translated (JavaScript)
3 participants