In v0.9 we would like to add a support for multi language cms page contents

Here we are collecting some facts about this here.

First of all

  • All i18n stuff should be easy to use
  • it should not be too much work it to implement
  • too much to configure works against "easy to use"
  • we should try to give the user a straight workflow
  • Easy to update for a existing installation

the facts

  • default language:
    • the user must set a default language. How? (see below)
    • A page must at least exist in the default language
    • A new page is provided first in the default language, after this a user can create the page content in a other language
  • split "Page" table into text content and meta data: All continuous data remain in the PAGE table. All language specific data went into a separated model.
  • The shortcuts are always in the default language.
  • menu/sitemap:
    • items change the language
    • pages which don't exists in requested language, should show up in default language

open facts

  • How can the user specify the "other language" of a new page? Should we get him a list of all possible language? The django global_settings.py holds a list of language.
  • How can the user specify the default language? Should we use settings.LANGUAGE_CODE for this?
  • language separation for templates too? (make sense if the user has some text in the template)
  • Use the language specific PageContent class for the page archive, too?
  • How to update? Ideas:
    • Only rename the old model class and add the new models. So we can access both models the old and new and migrate the data.
  • shortcuts/permalinks:
    • Build shortcuts/permalinks only in the default language: The URL line and every permalink is always the same
    • use the requested/existing language: URL line/permalinks exists in different language.
  • How to cache?
    • We have two i18n things:
      • i18n page content
      • i18n gettext strings in templates/plugin output (django has over 40 translations)
    • solutions:
      • Bad idea, blow up the cache with all variants: cache_key = url + cms_page_lang + client_lang
      • Other idea: Use the cms page language for gettext translation: connect cms_page_lang with client_lang

current implementation:

  • urls:
    • The current urls build from the page shortcut: domain.tld/shortcut1/shortcut2/
    • There exist no filename in a url
    • Only the last existing shortcut used to get the current page. All other parts of the url would be ignored (See also forum thread)
  • permalink:

The new implementation must recognize the existing language of a page.

  • variant 1 - file based on page shortcut
    • urls:
      • There exist only one language independently shortcut for a page.
    • permalink:
      • Only the id in the url use to get the current page.
      • From the "filename" only the lang code are recognized all other parts ignored
    • pros
      • relative short urls
      • default language with, e.g:
        • domain.tld/shortcut1.html or domain.tld/shortcut1/ ?
    • cons
      • complicated structure
    • urls e.g.:
      • domain.tld/shortcut1.de.html
      • domain.tld/shortcut1.en.html
      • domain.tld/shortcut1/shortcut2.de.html
      • domain.tld/shortcut1/shortcut2.en.html
    • permalink e.g.:
      • domain.tld/_goto/125/shortcut1.de.html
      • domain.tld/_goto/125/shortcut2.en.html
  • variant 2 - file based with a 'index' file
    • pros
      • default language with:
        • domain.tld/shortcut1/index.html or domain.tld/shortcut1/
    • cons
      • complicated structure
      • long
      • 404 on wrong url: domain.tld/shortcut1/ ?
    • urls e.g.:
      • domain.tld/shortcut1/index.de.html
      • domain.tld/shortcut1/index.en.html
      • domain.tld/shortcut1/shortcut2/index.de.html
      • domain.tld/shortcut1/shortcut2/index.en.html
    • permalink e.g.:
      • domain.tld/_goto/125/shortcut1/index.de.html
      • domain.tld/_goto/125/shortcut2/index.en.html
  • variant 3 - language as the first directory
    • pros:
      • short
    • cons:
      • how to get the default lang?
        • domain.tld/shortcut1/ ? (difficult to keep apart)
    • urls e.g.:
      • domain.tld/de/shortcut1/
      • domain.tld/en/shortcut1/
      • domain.tld/de/shortcut1/shortcut2/
      • domain.tld/en/shortcut1/shortcut2/
    • permalink e.g.:
      • domain.tld/_goto/125/de/shortcut1/
      • domain.tld/_goto/125/en/shortcut2/
  • variant 4 - language as the last directory
    • pros:
      • short
      • easy to get the default language:
        • domain.tld/shortcut1/
        • domain.tld/_goto/125/shortcut1/
    • cons
      • ?
    • urls e.g.:
      • domain.tld/shortcut1/de/
      • domain.tld/shortcut1/en/
      • domain.tld/shortcut1/shortcut2/de/
      • domain.tld/shortcut1/shortcut2/en/
    • permalink e.g.:
      • domain.tld/_goto/125/shortcut1/de/
      • domain.tld/_goto/125/shortcut2/en/
  • variant 5 - unique shortcuts
    • The page shortcuts are language dependent.
    • pros
      • short
      • permalink system doesn't change
    • cons
      • problem with not unique page names (e.g. anglicist pages like "links") solution: Append language code on double shourtcuts:
        • "links": links-de, links-en, links-en1, links-en2
    • urls e.g.:
      • domain.tld/contact/ - (en)
      • domain.tld/kontakt/ - (de)
    • permalink e.g.:
      • domain.tld/_goto/123/contact/
      • domain.tld/_goto/456/kontakt/

(Important: If you want to edit wiki pages, please login as guest/guest.)