Esempio n. 1
0
 LocalizedString IStringLocalizer.this[string name]
 {
     get
     {
         StringToken st;
         var         tokenFound = _localizationProvider.GetAllTokens().TryGetValue(name, out st);
         var         text       = tokenFound ? _localizationProvider.GetText(st, _cultureInfo) : name;
         return(new LocalizedString(name, text, tokenFound));
     }
 }
Esempio n. 2
0
 public string GetText(StringToken stringToken, CultureInfo culture = null)
 {
     return(_localizationProvider.GetText(stringToken, culture));
 }
Esempio n. 3
0
 public IActionResult Index()
 {
     ViewBag.GermanText = _localizationProvider.GetText(L.Home.APPLICATION_USES, new CultureInfo("de"));
     return(View());
 }
Esempio n. 4
0
        public string Generate(CultureInfo culture, bool generateHash = false, bool useDefault = true)
        {
            var tokens = _localizationProvider.GetAllTokens();
            var result = GenerateXml(tokens.Select(x => new LocalString(x.Key.ToString(), useDefault ? x.Value.DefaultValue : _localizationProvider.GetText(x.Value, culture))), generateHash);

            return(result);
        }
Esempio n. 5
0
 public static string GetText(StringToken token, CultureInfo culture = null, object model = null)
 {
     return(_localizationProvider.GetText(token, culture, model));
 }