diff --git a/code/model/Translatable.php b/code/model/Translatable.php index b6bc768..c9293e1 100755 --- a/code/model/Translatable.php +++ b/code/model/Translatable.php @@ -1107,6 +1107,17 @@ class Translatable extends DataExtension implements PermissionProvider { function extendWithSuffix($table) { return $table; } + + /** + * Provide templates with an easy way to display the languate of the content being viewed, in both native language + * and english. + * + * @param boolean $native [true] Outputs the language name in its own language if true, english string if false. + * @return string The name of the content language. + */ + public function getContentLanguage($native = true) { + return i18n::get_language_name(i18n::get_lang_from_locale(i18n::convert_rfc1766($this->owner->Locale)),$native); + } /** * Gets all related translations for the current object,