Index
Design and Requirements
keyphrases was designed to generate language independent templates for the UNIDO. Therefore it requires the UNIDO Content Package to be pre-installed (actually it only uses the languages-table, so perhaps in later versions we will fix this dependency). For any string you wish to have language independant you create a keyphrase set (having a unique keyphrase_id). Each keyphrase set can have a keyphrase for each language. The only restriction for keyphrases is, that there MUST NOT BE two keyphrases being equal and of the same language.
Also implemented are SmartURLs for language preferences. Like your.server.com/en/some_dir will link to your.server.com/some_dir and set the language preference (ad_conn language) to en (English).
Back to top
Syntax
Directly put into ADP-pages: @!where_particle;what_particle!@
where_particle will be a string searched for in language_code or # (then specifying the number). what_particle will be the number or string found in the database. The whole thing will be substituted by the keyphrase of corresponding language with the same number as specified or as the specified keyphrase has.
Alternatively you may specify [template::get_keyword where_particle what_particle] in TCL code.
examples:
\@!#;{1234}!@
will be substituted by a keyphrase of keyphrase set #1234.
\@!en;{contact}!@
will be substituted by a keyphrase of the same keyphrase set where the English keyphrase is "contact".
[template::get_keyword fr lunedi]
will be substituted by a keyphrase of the same keyphrase set where the French keyphrase is "lunedi".
Note: Because of OACS 4.7 i18n, the syntax me be changed in subsequent versions!
Back to top
Templates
If the syntax above does not provide for enough flexibility for the page (e. g. for Arabic the page has to be changed completely), then use language specific templates.
For every language you wish to have an independant template, just add a file called "file.language", where "file" is the filename and "language" is an abbreviation like en, fr, de etc (e. g. test.fr). If ServeLanguageSpecificTemplateP is set to 1, then this feature becomes active. If "file.current_language" where "current_language" is the abbreviation for the language the user prefers exists, this file is served as template. Else the standard "file.adp" will be served as template.
All language specific templates, will be treated exactly as if they where an adp page.
Note: Such language specific templates also may be defined for any master template.
Back to top
Parameters
There are three parameters for this package:
- ThrowErrorP
- DefaultLanguage
- ServeLanguageSpecificTemplateP
ThrowErrorP can have the values 0 (deactivated) and 1 (activated). If ThrowErrorP is active, then every keyphrase that is not found in the database will result in an TCL error. If deactivated the site will load and be displayed, but error messages will fill the spaces, where the keyphrases that produced errors were.
DefaultLanguage If no language preference can be identified, than the value for DefaultLanguage is used. Make sure DefaultLanguage is a correct language abbreviation (e. g. en, de, fr, it) like in the table languages.language_code
IMPORTANT! If you use the parameters screen to change the DefaultLanguage this will have only a partially effect. Use the option in the index or run the update script from the index afterwards!
ServeLanguageSpecificTemplateP can have the values 0 (deactivated) and 1 (activated). If active, the request processor will try to serve file.language as template. See Templates for details.
Back to top