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> |