fix(i18n): pasang penangkap event klik dan pembuat cookie googtrans
This commit is contained in:
@@ -86,5 +86,16 @@ function edukarsa_enqueue_scripts() {
|
||||
if ( file_exists( get_template_directory() . '/assets/edukarsa.js' ) ) {
|
||||
wp_enqueue_script( 'edukarsa-global-js', get_template_directory_uri() . '/assets/edukarsa.js', array(), time(), true );
|
||||
}
|
||||
|
||||
// Memuat API Google Translate dengan dependensi ke edukarsa-global-js
|
||||
if ( get_option( 'edukarsa_tampil_bilingual', 1 ) == 1 ) {
|
||||
wp_enqueue_script(
|
||||
'google-translate-api',
|
||||
'https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit',
|
||||
array( 'edukarsa-global-js' ),
|
||||
null,
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
add_action( 'wp_enqueue_scripts', 'edukarsa_enqueue_scripts' );
|
||||
|
||||
Reference in New Issue
Block a user