feat(i18n): kustomisasi pilihan bahasa tambahan dan sembunyikan topbar google translate

This commit is contained in:
Mas Budi Kusuma
2026-09-15 23:42:39 +07:00
parent 7ba6d951bf
commit 9dd84e2c23
3 changed files with 120 additions and 110 deletions
+27 -7
View File
@@ -44,7 +44,8 @@ add_action( 'admin_bar_menu', 'edukarsa_admin_bar_shortcut', 80 );
function edukarsa_register_settings() {
$options = array(
'edukarsa_font_choice', 'edukarsa_primary_color', 'edukarsa_secondary_color', 'edukarsa_heading_color',
'edukarsa_tampil_bilingual', 'edukarsa_tampil_slider', 'edukarsa_tampil_stats', 'edukarsa_tampil_about', 'edukarsa_tampil_milestone', 'edukarsa_tampil_program', 'edukarsa_tampil_video', 'edukarsa_tampil_keunggulan', 'edukarsa_tampil_cta', 'edukarsa_tampil_faq', 'edukarsa_tampil_news',
'edukarsa_tampil_bilingual', 'edukarsa_lang_en', 'edukarsa_lang_ar', 'edukarsa_lang_zh', 'edukarsa_lang_ja',
'edukarsa_tampil_slider', 'edukarsa_tampil_stats', 'edukarsa_tampil_about', 'edukarsa_tampil_milestone', 'edukarsa_tampil_program', 'edukarsa_tampil_video', 'edukarsa_tampil_keunggulan', 'edukarsa_tampil_cta', 'edukarsa_tampil_faq', 'edukarsa_tampil_news',
'edukarsa_header_logo',
'edukarsa_milestone_subtitle', 'edukarsa_milestone_title',
'edukarsa_program_subtitle', 'edukarsa_program_title',
@@ -141,7 +142,7 @@ function edukarsa_settings_page_html() {
<div class="edukarsa-admin-layout">
<div class="edukarsa-admin-main">
<!-- 1. Header, Logo, Slider & Bilingual Switcher -->
<!-- 1. Header, Logo, Slider & Multilingual Switcher -->
<div class="edukarsa-card">
<div class="edukarsa-card-header"><h2>🏛️ 1. Header, Logo & Slider</h2></div>
<div class="edukarsa-card-body">
@@ -153,21 +154,40 @@ function edukarsa_settings_page_html() {
</div>
</div>
<!-- Opsi Bilingual -->
<!-- Opsi Fitur Bahasa -->
<div class="switch-row" style="margin-top: 18px; background: #eef2ff; border-color: #c7d2fe;">
<div class="switch-label-wrap">
<div class="switch-label" style="color: #3730a3;">
<span>🌐 Fitur Bilingual (Bahasa Indonesia & Inggris)</span>
<span class="tooltip-hint">?<span class="tooltip-text">Menampilkan tombol switcher ID | EN di header dengan sistem translasi instan otomatis.</span></span>
<span>🌐 Fitur Bahasa (Penerjemah Instan)</span>
<span class="tooltip-hint">?<span class="tooltip-text">Menampilkan tombol pemilih bahasa di header situs.</span></span>
</div>
<span style="font-size: 11px; color: #4338ca;">Penerjemah instan untuk mempermudah pengunjung internasional tanpa membebani operator.</span>
<span style="font-size: 11px; color: #4338ca;">Bahasa Indonesia (ID) aktif sebagai bahasa utama. Pilih bahasa tambahan di bawah:</span>
</div>
<label class="edukarsa-switch">
<input type="checkbox" name="edukarsa_tampil_bilingual" value="1" <?php checked(1, get_option('edukarsa_tampil_bilingual', 1)); ?>>
<input type="checkbox" class="section-toggle" data-target="#lang-options-box" name="edukarsa_tampil_bilingual" value="1" <?php checked(1, get_option('edukarsa_tampil_bilingual', 1)); ?>>
<span class="slider-round"></span>
</label>
</div>
<!-- Checkbox Pilihan Bahasa Tambahan -->
<div id="lang-options-box" style="background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 14px 18px; margin-bottom: 16px;">
<span style="font-weight: 700; font-size: 12px; color: #475569; display: block; margin-bottom: 10px;">Bahasa Tambahan yang Diaktifkan:</span>
<div style="display: flex; gap: 20px; flex-wrap: wrap;">
<label style="font-size: 13px; font-weight: 600; color: #334155; cursor: pointer;">
<input type="checkbox" name="edukarsa_lang_en" value="1" <?php checked(1, get_option('edukarsa_lang_en', 1)); ?>> 🇬🇧 English (EN)
</label>
<label style="font-size: 13px; font-weight: 600; color: #334155; cursor: pointer;">
<input type="checkbox" name="edukarsa_lang_ar" value="1" <?php checked(1, get_option('edukarsa_lang_ar', 0)); ?>> 🇸🇦 العربية (AR)
</label>
<label style="font-size: 13px; font-weight: 600; color: #334155; cursor: pointer;">
<input type="checkbox" name="edukarsa_lang_zh" value="1" <?php checked(1, get_option('edukarsa_lang_zh', 0)); ?>> 🇨🇳 中文 (ZH)
</label>
<label style="font-size: 13px; font-weight: 600; color: #334155; cursor: pointer;">
<input type="checkbox" name="edukarsa_lang_ja" value="1" <?php checked(1, get_option('edukarsa_lang_ja', 0)); ?>> 🇯🇵 日本語 (JA)
</label>
</div>
</div>
<div class="switch-row-inline" style="margin-top: 15px;">
<div class="switch-row">
<div class="switch-label-wrap">