Uploaded image for project: 'Forrest (Retired)'
  1. Forrest (Retired)
  2. FOR-934

i18n language override menu

    XMLWordPrintableJSON

Details

    • Patch available

    Description

      Attached is a dispatcher contract with support files. It will return a list of alternative languages available for a given document. The list is of the form:

      <!--+ |start language list +-->
      <span>
      <a href="?locale=en">en</a>
      </span>
      <span>
      <a href="?locale=fi">fi</a>
      </span>
      <span>
      <a href="?locale=nb">nb</a>
      </span>
      <span class="selected">se</span>
      <span>
      <a href="?locale=smj">smj</a>
      </span>
      <!--+ |end language list +-->

      It handles filenames following this scheme (convention is already established for Forrest):

      document.XY.extension (XY = locale/language of document)
      document.extension (fallback document)

      If there is a fallback document, the contract will try to look inside the document to see if it can find an @xml:lang or @lang attribute to associate a language with the fallback document.

      The contract returns a list of available languages, including the one being displayed. The displayed language is marked with @class="selected" in the output html.

      If there is only one document available (=no alternating languages), the contract only returns three comments (start, end, and a comment stating that there's no alternative).

      Attachments

        1. i18n-languages.zip
          4 kB
          Sjur N. Moshagen
        2. i18n-languages.zip
          5 kB
          Sjur N. Moshagen

        Activity

          People

            Unassigned Unassigned
            moshagen Sjur N. Moshagen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: