Exemplo n.º 1
0
        public virtual string GetStringByCulture(string resourceKey, CultureInfo culture, params object[] formatArguments)
        {
            if (string.IsNullOrWhiteSpace(resourceKey))
            {
                throw new ArgumentNullException(nameof(resourceKey));
            }

            if (culture == null)
            {
                throw new ArgumentNullException(nameof(culture));
            }

            var q             = new GetTranslation.Query(resourceKey, culture, ConfigurationContext.Current.EnableInvariantCultureFallback);
            var resourceValue = q.Execute();

            if (resourceValue == null)
            {
                return(null);
            }

            try
            {
                return(Format(resourceValue, formatArguments));
            }
            catch (Exception)
            {
                // TODO: log
            }

            return(resourceValue);
        }
        public virtual string GetStringByCulture(string resourceKey, CultureInfo culture, params object[] formatArguments)
        {
            var q = new GetTranslation.Query(resourceKey, culture, ConfigurationContext.Current.EnableInvariantCultureFallback);
            var resourceValue = q.Execute();

            if(resourceValue == null)
                return null;

            try
            {
                return Format(resourceValue, formatArguments);
            }
            catch (Exception)
            {
                // TODO: log
            }

            return resourceValue;
        }
Exemplo n.º 3
0
        public virtual string GetStringByCulture(string resourceKey, CultureInfo culture, params object[] formatArguments)
        {
            var q             = new GetTranslation.Query(resourceKey, culture);
            var resourceValue = q.Execute();

            if (resourceValue == null)
            {
                return(null);
            }

            try
            {
                return(Format(resourceValue, formatArguments));
            }
            catch (Exception)
            {
                // TODO: log
            }

            return(resourceValue);
        }