Abp.Localization.Sources.ILocalizationSource.GetString(string, System.Globalization.CultureInfo)

Here are the examples of the csharp api class Abp.Localization.Sources.ILocalizationSource.GetString(string, System.Globalization.CultureInfo) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

6 Examples 7

1. Example

View license
public static string GetString(this ILocalizationManager localizationManager, string sourceName, string name, CultureInfo culture)
        {
            return localizationManager.GetSource(sourceName).GetString(name, culture);
        }

2. Example

View license
[Fact]
        public void Should_Get_Localized_Strings()
        {
            var names = Assembly.GetAssembly(typeof(AbpWebModule)).GetManifestResourceNames();

            var source = _localizationManager.GetSource(AbpWebConsts.LocalizaionSourceName);
            source.GetString("Yes", new CultureInfo("en-US")).ShouldBe("Yes");
            source.GetString("Yes", new CultureInfo("tr-TR")).ShouldBe("Evet");
        }

3. Example

View license
private static string LocalizeErrorMessage(string identityErrorMessage, ILocalizationManager localizationManager)
        {
            var localizationSource = localizationManager.GetSource(AbpZeroConsts.LocalizationSourceName);

            foreach (var identityLocalization in IdentityLocalizations)
            {
                string[] values;
                if (FormattedStringValueExtracter.IsMatch(identityErrorMessage, identityLocalization.Key, out values))
                {
                    return localizationSource.GetString(identityLocalization.Value, values.Cast<object>().ToArray());
                }
            }

            return localizationSource.GetString("Identity.DefaultError");
        }

4. Example

View license
private static string LocalizeErrorMessage(string identityErrorMessage, ILocalizationManager localizationManager)
        {
            var localizationSource = localizationManager.GetSource(AbpZeroConsts.LocalizationSourceName);

            foreach (var identityLocalization in IdentityLocalizations)
            {
                string[] values;
                if (FormattedStringValueExtracter.IsMatch(identityErrorMessage, identityLocalization.Key, out values))
                {
                    return localizationSource.GetString(identityLocalization.Value, values.Cast<object>().ToArray());
                }
            }

            return localizationSource.GetString("Identity.DefaultError");
        }

5. Example

View license
private static string LocalizeErrorMessage(string identityErrorMessage, ILocalizationManager localizationManager)
        {
            var localizationSource = localizationManager.GetSource(AbpZeroConsts.LocalizationSourceName);

            foreach (var identityLocalization in IdentityLocalizations)
            {
                string[] values;
                if (FormattedStringValueExtracter.IsMatch(identityErrorMessage, identityLocalization.Key, out values))
                {
                    return localizationSource.GetString(identityLocalization.Value, values.Cast<object>().ToArray());
                }
            }

            return localizationSource.GetString("Identity.DefaultError");
        }

6. Example

View license
private static string LocalizeErrorMessage(string identityErrorMessage, ILocalizationManager localizationManager)
        {
            var localizationSource = localizationManager.GetSource(AbpZeroConsts.LocalizationSourceName);

            foreach (var identityLocalization in IdentityLocalizations)
            {
                string[] values;
                if (FormattedStringValueExtracter.IsMatch(identityErrorMessage, identityLocalization.Key, out values))
                {
                    return localizationSource.GetString(identityLocalization.Value, values.Cast<object>().ToArray());
                }
            }

            return localizationSource.GetString("Identity.DefaultError");
        }