Namespace: Consultingwerk.SmartFramework.System
Class 
TranslationProvider Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object
Implements: Consultingwerk.SmartFramework.ITranslationProvider

File:TranslationProvider
Purpose:Default ITranslationProvider implementation that returns
translations for strings based on an optional scope,
the original string or a key value
Author(s):Mike Fechner / Consultingwerk Ltd.
Created:Thu Jan 10 23:09:45 CET 2013
Notes:The TranslationProvider is primarily intended to be used from
client side code. It can also be used on the AppServer,
however in those cases the caching (by the current language)
of translation records that are disposed when the language
changes may cause some overhead
The static property "UseEmptyScopeAsFallback" controls if the
translation provider uses the empty scope as a fallback when
fetching translations with a scope. This allows to use the
scope to identify a screen and use the empty scope for generic
translations
/* Mike Fechner, Consultingwerk Ltd. 13.09.2017
Preprocessor variables for SmartComponentLibrary, WinKit and SmartFramework
based on Consultingwerk/packages.i now



Top Method Summary
Options Name Purpose
+ CacheAllTranslations () Caches all translations for the current language
+ CacheTranslationsByScope (character) Caches all translations by a given scope
+ CHARACTER GetTranslationByKey (character, character) Returns a translation based on a key value and an optional scope
+ CHARACTER GetTranslationByKey (character, character, character) Returns a translation based on a key value and an optional scope
+ CHARACTER GetTranslationByString (character, character) Returns a translation for a string value and an optional scope
- LanguageKeyChangedHandler () Event handler for the LanguageKeyChanged handler of the SessionManager

Top Constructor Summary
Options Name Purpose
+ TranslationProvider () Constructor for the TranslationProvider class

Top Property Summary
Options Name Purpose
+ LOGICAL AllTranslationsCached
+ LOGICAL DontFetchTranslationsWhenAllTranslationsCached
+ LOGICAL UseEmptyScopeAsFallback


Method Detail
Top

PUBLIC CacheAllTranslations ()

Purpose: Caches all translations for the current language
Notes: Useful to avoid AppServer calls when multiple translations are
required

Top

PUBLIC CacheTranslationsByScope (character)

Purpose: Caches all translations by a given scope
Notes: Useful to avoid AppServer calls when multiple translations are
required in a row

Parameters:
pcScope CHARACTER
The scope to retrieve from the back end
Top

PUBLIC CHARACTER GetTranslationByKey (character, character)

Purpose: Returns a translation based on a key value and an optional scope
Notes: Returns ? when no translation is available

Parameters:
pcScope CHARACTER
The optional translation scope
pcKey CHARACTER
The translation key value to return
Returns CHARACTER
The translated string
Top

PUBLIC CHARACTER GetTranslationByKey (character, character, character)

Purpose: Returns a translation based on a key value and an optional scope
Notes: Returns ? when no translation is available

Parameters:
pcScope CHARACTER
The optional translation scope
pcKey CHARACTER
The translation key value to return
pcDefaultString CHARACTER
The optional default string to return when no translation is available
Returns CHARACTER
The translated string
Top

PUBLIC CHARACTER GetTranslationByString (character, character)

Purpose: Returns a translation for a string value and an optional scope
Notes: Returns the original string when no translation is available

Parameters:
pcScope CHARACTER
The optional translation scope
pcOriginalString CHARACTER
The original string to translate
Returns CHARACTER
The translated string
Top

PRIVATE LanguageKeyChangedHandler ()

Purpose: Event handler for the LanguageKeyChanged handler of the SessionManager
Notes: Cleares all translation cache



Constructor Detail
Top

PUBLIC TranslationProvider ()

Purpose: Constructor for the TranslationProvider class
Notes:



Property Detail
Top

PUBLIC LOGICAL AllTranslationsCached


Returns LOGICAL
Top

PUBLIC LOGICAL DontFetchTranslationsWhenAllTranslationsCached


Returns LOGICAL
Top

PUBLIC LOGICAL UseEmptyScopeAsFallback


Returns LOGICAL


Temp-Table Detail


©2006-2020 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       04.02.2020 23:31:05