মূল বিষয়ে যান
বিভাগসমূহ
Fiesta

locale-menu

রুট যে অংশগুলো নিজেরাই একটি গোটা রেসপন্স, কোনো রেসপন্সের টুকরো নয়।

ভাষা বদলানোর মেনু: এক-ফিল্ডের POST ফর্ম দিয়ে তৈরি একটি details মেনু, তাই পছন্দটি আপনার অ্যাপে যায় আর পাঠক একই পাথে থাকেন।

প্রতিটি উদাহরণ সত্যিই চলে, কিন্তু এর লিংকগুলো কোথাও নিয়ে যায় না। HTML কপি করার জন্য মার্কআপ দেখায়।

বারোটি ভাষা, বর্তমানটি চিহ্নিত।

প্রতিটি ভাষা এক-ফিল্ডের একটি ফর্ম, তাই একটি বেছে নেওয়া মানে একটি POST, যার জবাব দেয় আপনার অ্যাপ। একটি স্ট্যাটিক সাইট এর বদলে সাধারণ লিঙ্কের মেনু ব্যবহার করতে পারে।

প্রিভিউ
<footer rst-page-foot>
  <details rst-dropdown rst-locale name="rst-menus">
    <summary>
      ভাষা
      <span rst-caret aria-hidden="true">
        <svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg>
      </span>
    </summary>
    <div rst-dropdown-menu>
      <form method="post" action="/_locale">
        <input type="hidden" name="locale" value="en">
        <input type="hidden" name="return" value="/">
        <button type="submit" lang="en" aria-current="true">English</button>
      </form>
      <form method="post" action="/_locale">
        <input type="hidden" name="locale" value="ga">
        <input type="hidden" name="return" value="/">
        <button type="submit" lang="ga">Gaeilge</button>
      </form>
      <form method="post" action="/_locale">
        <input type="hidden" name="locale" value="zh-Hans">
        <input type="hidden" name="return" value="/">
        <button type="submit" lang="zh-Hans">简体中文</button>
      </form>
      <form method="post" action="/_locale">
        <input type="hidden" name="locale" value="es">
        <input type="hidden" name="return" value="/">
        <button type="submit" lang="es">Español</button>
      </form>
      <form method="post" action="/_locale">
        <input type="hidden" name="locale" value="hi">
        <input type="hidden" name="return" value="/">
        <button type="submit" lang="hi">हिन्दी</button>
      </form>
      <form method="post" action="/_locale">
        <input type="hidden" name="locale" value="pt-PT">
        <input type="hidden" name="return" value="/">
        <button type="submit" lang="pt-PT">Português</button>
      </form>
      <form method="post" action="/_locale">
        <input type="hidden" name="locale" value="bn">
        <input type="hidden" name="return" value="/">
        <button type="submit" lang="bn">বাংলা</button>
      </form>
      <form method="post" action="/_locale">
        <input type="hidden" name="locale" value="ru">
        <input type="hidden" name="return" value="/">
        <button type="submit" lang="ru">Русский</button>
      </form>
      <form method="post" action="/_locale">
        <input type="hidden" name="locale" value="ja">
        <input type="hidden" name="return" value="/">
        <button type="submit" lang="ja">日本語</button>
      </form>
      <form method="post" action="/_locale">
        <input type="hidden" name="locale" value="yue">
        <input type="hidden" name="return" value="/">
        <button type="submit" lang="yue">廣東話</button>
      </form>
      <form method="post" action="/_locale">
        <input type="hidden" name="locale" value="vi">
        <input type="hidden" name="return" value="/">
        <button type="submit" lang="vi">Tiếng Việt</button>
      </form>
      <form method="post" action="/_locale">
        <input type="hidden" name="locale" value="ar">
        <input type="hidden" name="return" value="/">
        <button type="submit" lang="ar">العربية</button>
      </form>
    </div>
  </details>
</footer>

একটি অ্যাপে এটি /_locale-এ পৌঁছাত। এখানে এর লিঙ্ক আর ফর্ম কোথাও যায় না।