Show / Hide Table of Contents

Class LocalizationExtractionUtils

Utils for localization string extractions

Inheritance
System.Object
LocalizationExtractionUtils
Namespace: Eco.Shared.Localization
Assembly: Eco.Shared.dll
Syntax
public class LocalizationExtractionUtils : Object

Constructors

LocalizationExtractionUtils()

Declaration
public LocalizationExtractionUtils()

Methods

ExtractLocalizedAttr(Type, List<StringLocalizedData>, LocalizedAttribute, Boolean)

Extract localization strings from classes or enums with LocalizedAttribute

Declaration
public static void ExtractLocalizedAttr(Type type, List<StringLocalizedData> locData, LocalizedAttribute localizedAttr, bool includeFields = false)
Parameters
Type Name Description
System.Type type

type with attribute

System.Collections.Generic.List<StringLocalizedData> locData

list to add new localization data

LocalizedAttribute localizedAttr

actual attribute

System.Boolean includeFields

should also include fields

GetTypeLocName(Type, LocalizedAttribute)

Extract loc display name of type from CustomDisplayName or RemoveCamelCase

Declaration
public static string GetTypeLocName(Type type, LocalizedAttribute attr)
Parameters
Type Name Description
System.Type type
LocalizedAttribute attr
Returns
Type Description
System.String

TypesToExtract(Boolean)

Localization types to extract loc strings from

Declaration
public static IEnumerable<TypeInfo> TypesToExtract(bool excludeShared = false)
Parameters
Type Name Description
System.Boolean excludeShared

Ignore shared namespace (so it doesn't get extracted twice)

Returns
Type Description
System.Collections.Generic.IEnumerable<System.Reflection.TypeInfo>

Extension Methods

CommandLine.FeedFromCommandLine(Object)
CommandLine.ToCommandLineArgs(Object, Func<Object, Boolean>)
ListUtil.DepthFirstTraversal<T>(T, Func<T, IEnumerable<T>>)
EnumerableExtensions.SingleItemAsEnumerable<T>(T)
EventUtils.RaiseEvent<TEventArgs>(Object, String, TEventArgs)
PredicateUtils.MatchesAll<TEnumerable, T>(T, TEnumerable)
PredicateUtils.MatchesAll<T>(T, Func<T, Boolean>[])
PredicateUtils.MatchesAny<TEnumerable, T>(T, TEnumerable)
ReflectionUtils.PropertyValue<T>(Object, PropertyInfo)
ReflectionUtils.TryGetPropertyValueByName<T>(Object, String, out T)
ReflectionUtils.GetPropertyValueByName<T>(Object, String)
ReflectionUtils.SetPropertyByName(Object, String, Object)
ReflectionUtils.GetStructPropertyByName<T>(Object, String)
ReflectionUtils.GetStringPropertyByName(Object, String)
ReflectionUtils.ZipByProperty<T>(Object, Object, Object, Func<T, T, T>)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾