Skip to content
Snippets Groups Projects
Commit 1efa1b11 authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

fix language keyword

parent 9ec62ebe
No related branches found
No related tags found
No related merge requests found
......@@ -265,4 +265,47 @@ KeywordAttribute.prototype.getValue = function(pKeyId)
.buildSql("select " + this.dbField + " from AB_KEYWORD_ENTRY join AB_KEYWORD_ATTRIBUTERELATION on AB_KEYWORD_ENTRY.AB_KEYWORD_ENTRYID = AB_KEYWORD_ATTRIBUTERELATION.AB_KEYWORD_ENTRY_ID");
return db.cell(sql);
}
\ No newline at end of file
}
/**
* provides methods for interactions with the sepcial-keywords "LANGUAGE"
*
* @class
*/
function LanguageKeywordUtils(){}
/**
* resolves Languagecode into the latin name
*
* @param {String} pDbFieldName name fo the database field where the ISO3-value is stored
* @param {String} [pLocale=current client language] specifies the locale for translating the title; can be false if nothing shalle be translated
*
* @return {String} a SQL-expression (case-when-statement)
*/
LanguageKeywordUtils.getResolvedTitleSqlPart = function(pDbFieldName, pLocale)
{
var data = LanguageData.getData();
var resSql = SqlUtils.getResolvingCaseWhen(data, pDbFieldName, pLocale);
return db.translateStatement(resSql);
};
/**
* returns a specific name (translated) - this is normally the view-value of a language
*
* @param {String} key id value of the language where the view-value shall be searched
* @param {String} [locale=locale depending on current client/servercontext] Language-value for translations
*
* @return {String} representation of the translated name
*
*/
LanguageKeywordUtils.getViewValue = function(key, locale)
{
if (!key)
return "";
var languageMap = LanguageData.getIso3Map(locale);
var title = languageMap[key];
if (title == undefined)
return "";
return title;
};
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment