Latihan 1 dari materi i18next Setup di i18n: praktik dengan editor kode interaktif, test case otomatis, dan hint terpandu, langsung di browser.
Kartu pesan Homestay Kabut memakai i18next dengan init ini:
i18next.use(initReactI18next).init({
lng: 'ja-JP',
fallbackLng: ['en-US', 'id-ID'],
defaultNS: 'booking',
resources, // kamus di tabel bawah
});
Key yang ada di tiap file booking:
| File | Key |
|---|---|
ja-JP |
room, perNight, checkIn, group, nights_other, total_other, thanks, payAtHomestay |
en-US |
room, perNight, checkIn, group, nights_one, nights_other, total_one, total_other, book, cancel, thanks |
id-ID |
room, perNight, checkIn, group, nights_other, total_other, book, cancel, breakfast, thanks |
ar-EG |
room, perNight, checkIn, group, nights_one, nights_two, nights_other, total_other, book, cancel |
Telusuri tiap panggilan, berurutan, dan isi dua kolom:
nights_one). Tulis - kalau gak ada yang ketemu.Baris pertama sudah diisi sebagai contoh. Selesai kalau semua baris benar.