Multilingual Resources

To switch language, add to query part of url:

  • language= to get this resource in that language
    • example: http://www.site.org /blog/about-languages.html?language=en
  • setLanguage= to set a language for that session. All resources will respond in that language until next setLanguage or explicit request for language as as above.
    • example: http://www.site.org /blog/about-languages.html?setLanguage=en

Object

#isMultilingual

For multilingual support: override this if your domain object responds to #forLanguage: and returns an apropriate instance of itself for that language.

#forLanguage: aLanguageCodeSymbol

for multilingual support: returns an apropriate instance of itself for that language. Langage is defined by ISO 639 2-letter language code en.wikipedia.org/wiki/List_of_ISO_639-1_codes

AIDASite

#defaultLanguage, #defaultLanguage: aLanguageCodeSymbol (in settings)

2-letter language code symbol for default language of that site

#supportedLanguages, #supportedLanguages: aSetOfLangCodes

Which languages are supported on this site. Content may be in all those languages. Default language is always among supported.

WebSession

#language, #language: aLanguageCodeSymbol

Preferred language of a web user. Initially set from the last request (lazily, when first needed)

#originatorLanguageFrom: aRequest (in private-locale)

WebApplication

#printWebPage  (in private-printing)

self observee isMultilingual ifTrue: self checkObserveeLanguage.  "and change observee if needed"

#checkObserveeLanguage (in private-multilingual)

Change observee to point to domain object in right language if necessary (from session language or explicit language request in query part of Url)

Document

#language, #language: aLanguageCodeSymbol (in locale support)

in which language is content of that document. In ISO 2-letter symbol

DocGroup

DocGroup is a group of documents, which are related, multilingual for instance. We can understand this group as another dimension to subdocuments and versions.

In multilingual case every document in a group is in language, but normally for the same content. Aida/Web also treat all documents in a group as identical and all have the same Url. To define which document to show you need to change a language in web session.