Virtual attribute returning text description of the activity
 using the activity's key to translate using i18n.
168787
def text(params = {})
      # TODO: some helper for key transformation for two supported formats
      k = key.split('.')
      k.unshift('activity') if k.first != 'activity'
      k = k.join('.')

      I18n.t(k, parameters.merge(params) || {})
    end
297008
def __get_keys_map(self, bundleId, languageId, fallback=False):
        
        return self.__get_language_data(bundleId=bundleId,
            languageId=languageId, fallback=fallback)
612480
@Nonnull
  public String getDescription (final Locale aContentLocale)
  {
    final String ret = m_eCountry == null ? null : m_eCountry.getDisplayText (aContentLocale);
    return ret != null ? ret : "undefined";
  }
47825
function contentClassAttributeCanTranslate()
    {
        if ( $this->ContentClassAttributeCanTranslate === null )
        {
            eZDebug::accumulatorStart( 'class_a_can_translate', 'Sytem overhead', 'Fetch class attribute can translate value' );

            $classAttribute = eZContentClassAttribute::fetch( $this->ContentClassAttributeID );

            $dataType = $classAttribute->dataType();

            if ( $dataType &&
                 $dataType->Attributes["properties"]["translation_allowed"] &&
                 $classAttribute->attribute( 'can_translate' ) )
                $this->ContentClassAttributeCanTranslate = 1;
            else
                $this->ContentClassAttributeCanTranslate = 0;
            eZDebug::accumulatorStop( 'class_a_can_translate' );
        }

        return $this->ContentClassAttributeCanTranslate;
    }
1140068
@HtmlSafe
    public String getText(String key, Object... arguments) {
        return I18nUtil.getText(key, getResourceBundle(), arguments);
    }
573163
def get_description(self, lang='en'):
        
        if self.fast_run:
            return list(self.fast_run_container.get_language_data(self.wd_item_id, lang, 'description'))[0]
        if 'descriptions' not in self.wd_json_representation or lang not in self.wd_json_representation['descriptions']:
            return ''
        else:
            return self.wd_json_representation['descriptions'][lang]['value']
1343959
def translate_with_annotation(key, options={})
      # default to an empty scope
      scope = []

      # In the case of a missing translation, fall back to letting TranslationHelper
      # put in span tag for a translation_missing.
      begin
        AnnoTranslate.translate_with_annotation(scope, @virtual_path, key, options.merge({:raise => true}))
      rescue AnnoTranslate::AnnoTranslateError, I18n::MissingTranslationData => exc
        # Call the original translate method
        str = translate_without_annotation(key, options)

        # View helper adds the translation missing span like:
        # In strict mode, do not allow TranslationHelper to add "translation missing" span like:
        # <span class="translation_missing">en, missing_string</span>
        if str =~ /span class\=\"translation_missing\"/
          # In strict mode, do not allow TranslationHelper to add "translation missing"
          raise if AnnoTranslate.strict_mode?

          # Invoke callback if it is defined
          AnnoTranslate.missing_translation_callback(exc, key, options)
        end

        str
      end
    end
589061
def _get_translation(self, lang):
        """"""

        try:
            return self._translations[lang]
        except KeyError:
            # The fact that `fallback=True` is not the default is a serious design flaw.
            rv = self._translations[lang] = gettext.translation(self._domain, localedir=localedir, languages=[lang],
                                                                fallback=True)
            return rv
698175
def translation_key
      key = name.gsub(/Motivation\z/, '')
      key.gsub!(/^.*::/, '')
      key.gsub!(/([A-Z\d]+)([A-Z][a-z])/,'\1_\2')
      key.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
      key.tr!("-", "_")
      key.downcase!
    end
276091
private void notifyLanguageChanged() {
        sendOnBeforeLocaleChangedEvent();
        activity.getIntent().putExtra(KEY_ACTIVITY_LOCALE_CHANGED, true);
        callDummyActivity();
        activity.recreate();
    }
19862
protected String getI18n(final String aMessageKey, final File aFile) {
        return StringUtils.normalizeWS(myBundle.get(aMessageKey, aFile.getAbsolutePath()));
    }
653056
function localizeStrict( i18nValue, optionalFallbackValue, languageTag = tags[ locale ] ) {
         if( !i18nValue || primitives[ typeof i18nValue ] ) {
            // value is not internationalized
            return i18nValue;
         }
         if( !languageTag ) {
            return optionalFallbackValue;
         }

         // Try one direct lookup before scanning the input keys,
         // assuming that language-tags are written in consistent style.
         const value = i18nValue[ languageTag ];
         if( value !== undefined ) {
            return value;
         }

         const lookupKey = normalize( languageTag );
         const availableTags = Object.keys( i18nValue );
         const n = availableTags.length;
         for( let i = 0; i < n; ++i ) {
            const t = availableTags[ i ];
            if( normalize( t ) === lookupKey ) {
               return i18nValue[ t ];
            }
         }

         return optionalFallbackValue;
      }
329284
def __get_value(self, bundleId, languageId, resourceKey, fallback=False):
        
        resourceEntryData = self.__get_resource_entry_data(bundleId=bundleId,
            languageId=languageId, resourceKey=resourceKey, fallback=fallback)

        if not resourceEntryData:
            return None

        value = resourceEntryData.get(self.__RESPONSE_TRANSLATION_KEY)

        return value
508539
def get_description(self):
        
        return DisplayText({'text': profile.DESCRIPTION,
                            'languageTypeId': profile.LANGUAGETYPEID,
                            'scriptTypeId': profile.SCRIPTTYPEID,
                            'formatTypeId': profile.FORMATTYPEID})
140654
protected String translate(String messageKey, String defaultMessage) {
        if (messages == null || Strings.isNullOrEmpty(messageKey)) {
            return Strings.emptyToNull(defaultMessage);
        }
        return Strings.emptyToNull(messages.getWithDefault(messageKey, defaultMessage, defaultLanguage));
    }
623890
protected String getI18n(final String aMessageKey, final Exception aException) {
        return StringUtils.normalizeWS(myBundle.get(aMessageKey, aException.getMessage()));
    }
393196
def translated_value(self):
        
        if self.typeof in self:
            return NATValue(self.get(self.typeof, {}).get(
                'translated_value'))