How can I translate Date Picker in Wilcity?

In this tutorial, I will show you how to translate Date Picker in Wilcity. Firstly, please make sure that you are using Wilcity Child theme, if you are using the Wilcity Theme, please go to http://themeforest.net/downloads -> Get to the latest version of Wilcity -> Extract it, you will see wilcity-childtheme is included in the package. Next, log into your site -> Appearance -> Themes -> Add New -> Activate the theme.

Now, please follow these steps below to translate Date Picker in Wilcity

  1. Go to https://github.com/jquery/jquery-ui/tree/master/ui/i18n -> Download your language
  2. Upload it to your WordPress folder -> wp-content -> themes -> wilcity-childtheme -> vendor folder
  3. Put the following code to wilcity-childtheme -> functions.php
    function wilcityTranslateDatePicker(){
      wp_enqueue_script('yourDatePickerLanguage', get_stylesheet_directory_uri() . '/vendor/yourDatePickerFileName.js', array('jquery', 'jquery-ui-datepicker'), '1.0', true);
      wp_localize_script('jquery-migrate', 'WILCITY_DATE_PICKER', 'YourLocalization');
    }
    add_action('wp_enqueue_scripts', 'wilcityTranslateDatePicker');
    

YourLocalization: Eg if your date picker file name is datepicker-vi.js, vi is your localization.

Leave A Comment?