super-cpt icon indicating copy to clipboard operation
super-cpt copied to clipboard

Date-picker is in simplified Chinese

Open bhhaskin opened this issue 10 years ago • 3 comments

The date picker is displaying in simplified Chinese rather than English.

bhhaskin avatar Dec 30 '14 18:12 bhhaskin

Hmm, this is not a problem for me. Can you share your code to replicate this?

mboynes avatar Dec 30 '14 19:12 mboynes

It seems to be a common issue with the jQuery UI i18n (Internationalization and Localization) date picker itself. The code is pretty simple:

// CPT
function eventCPT() {
    $event = new Super_Custom_Post_Type( 'event' );
    $event->set_icon( 'calendar' );
    $meta = new Super_Custom_Post_Meta( 'event' );
    $meta->add_meta_box(array(
        'id' => 'event_details',
        'fields' => array(
            'date' => array( 'type' => 'date', 'default' => '' ),
            'time' => array( 'type' => 'text', 'default' => '' ),
            'location_text' => array( 'type' => 'text', 'default' => '' ),
            'location_link' => array( 'type' => 'url', 'default' => '' ),
            'signup_link' => array( 'type' => 'url', 'default' => '' ),

            )
        ));
    }

    add_action( 'after_setup_theme', 'eventCPT' );

I tested it on Linux mint and Mac osx to make sure it wasn't just me.

bhhaskin avatar Dec 30 '14 19:12 bhhaskin

I have found a better solution. It auto detects the locale using the browser language setting OCG-labs/super-cpt@75865c63f348f7b23754c9960774e957c4671273

bhhaskin avatar Dec 30 '14 20:12 bhhaskin