Ukukhangela Okulungiselelweyo

Masithathe indawo i18n-demo.github.io njengomzekelo ukucacisa indlela yokwenza ukukhangela.

Iifayile ezihambelana neendawo ezineenombolo kulo mzobo ungasentla zezi zilandelayo:

  1. Ekhohlo .i18n/htm/t1.pug
  2. Ekunene .i18n/htm/t2.pug

pug lulwimi lwetemplate oluvelisa HTML 's.

➔ Cofa apha ukuze ufunde igrama ye pug

Umtya wefomathi ${I18N.sponsor} usetyenziswa kwifayile ukuphumeza ukwenziwa kwamazwe ngamazwe, kwaye umxholo wayo uya kutshintshwa ngombhalo ohambelanayo kwi-directory yolwimi lwemvelaphi i18n.yml

Ifayile ehambelana nesimbo sebha yokukhangela ngu : .i18n/htm/topbar.css

[!WARN] Ungabhali css no js ngo pug , kungenjalo kuya kubakho impazamo.

Amacandelo Ewebhu

js ayikwazi ukubhalwa kwi pug Ukuba intsebenziswano iyafuneka, inokufezekiswa ngokudala icandelo lewebhu.

Amacandelo angachaza icandelo lephepha lewebhu kwi md/.i18n/htm/index.js kwaye emva koko asebenzise icandelo kwi foot.pug .

Kulula ukwenza amacandelo ewebhu, afana <x-img> zesiko0.

customElements.define(
  'x-img',
  class extends HTMLElement {
    constructor() {
      super();
      var img = document.createElement('img');
      img.src = '//p.3ti.site/i18n.svg';
      img.style = "height:99px;width:99px;";
      this.append(img);
    }
  }
)

Okwangoku x/i-h.js ibhekiswa ku md/.i18n/htm/index.js , elilungu lewebhu elisetyenziselwa ukuhanjiswa kwamazwe ngamazwe kunye nokubhaliweyo okubhalwe phantsi okwenziwa ngokwezifiso Bona ikhowudi yemvelaphi 18x/src/i-h.js