fix(i18n): pasang penangkap event klik dan pembuat cookie googtrans

This commit is contained in:
Mas Budi Kusuma
2026-09-18 08:02:16 +07:00
parent 157c63eaff
commit 12eda8a5a0
2 changed files with 86 additions and 4 deletions
+11
View File
@@ -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' );