MockLocale
public sealed class MockLocaleImmutable locale identity with lazily initialized, attributed generation data.
Methods
Section titled “Methods”
GetCoverage(SimpleDataType)
Section titled “GetCoverage(SimpleDataType)”public MockLocaleCoverage GetCoverage(SimpleDataType type)Reports generator support and whether its data or presentation uses a fallback for this profile.
Parameters
| Name | Type | Description |
|---|---|---|
type | MockMagic.SimpleDataType | The generator whose locale coverage to inspect. |
Returns
MockMagic.MockLocaleCoverage: Support and fallback flags with a description of the selected data or regional convention.
ToString()
Section titled “ToString()”public override string ToString()Returns
System.String
GetLabels(LabelPreset)
Section titled “GetLabels(LabelPreset)”public IReadOnlyList<string> GetLabels(LabelPreset preset)Returns the preset’s read-only label choices, using Default choices when this profile has none.
Parameters
| Name | Type | Description |
|---|---|---|
preset | MockMagic.LabelPreset | The finite label preset to retrieve. |
Returns
System.Collections.Generic.IReadOnlyList{System.String}: Cached label choices, or an empty list when the preset has no stored choices, such as generated or custom labels.
GetLabelCoverage(LabelPreset)
Section titled “GetLabelCoverage(LabelPreset)”public MockLocaleCoverage GetLabelCoverage(LabelPreset preset)Describes a label preset’s locale support and any English fallback used by its labels or generated prefixes.
Parameters
| Name | Type | Description |
|---|---|---|
preset | MockMagic.LabelPreset | The label preset whose locale coverage to inspect. |
Returns
MockMagic.MockLocaleCoverage: Support and fallback flags with a description of the label source; custom labels remain verbatim.
GetLabelPrefix(LabelPreset)
Section titled “GetLabelPrefix(LabelPreset)”public string GetLabelPrefix(LabelPreset preset)Returns the English prefix used to generate labels for a preset.
Parameters
| Name | Type | Description |
|---|---|---|
preset | MockMagic.LabelPreset | The preset that selects the prefix. |
Returns
System.String: Product, Category, or Team for those presets; otherwise Item.
GetQuarterLabel(int, int)
Section titled “GetQuarterLabel(int, int)”public string GetQuarterLabel(int quarter, int year)Formats a one-based quarter and year using this profile’s quarter names.
Parameters
| Name | Type | Description |
|---|---|---|
quarter | System.Int32 | The quarter number, from 1 through 4. |
year | System.Int32 | The year to append using invariant numeric formatting. |
Returns
System.String: The quarter name followed by the year, using Q1 through Q4 if four localized names are unavailable.
GetCycleSuffix(int, bool)
Section titled “GetCycleSuffix(int, bool)”public string GetCycleSuffix(int cycle, bool week = false)Formats an English week or set suffix for a repeated label cycle.
Parameters
| Name | Type | Description |
|---|---|---|
cycle | System.Int32 | The cycle number to append using invariant numeric formatting. |
week | System.Boolean | Whether to use Week instead of the default Set prefix. |
Returns
System.String: Week or Set followed by the supplied cycle number.
Properties
Section titled “Properties”
public string Id { get; }Returns
System.String
DisplayName
Section titled “DisplayName”public string DisplayName { get; }Returns
System.String
NativeName
Section titled “NativeName”public string NativeName { get; }Returns
System.String
CountryCode
Section titled “CountryCode”public string CountryCode { get; }Returns
System.String
DataRevision
Section titled “DataRevision”public string DataRevision { get; }Returns
System.String
IsDefault
Section titled “IsDefault”public bool IsDefault { get; }Returns
System.Boolean
IsRightToLeft
Section titled “IsRightToLeft”public bool IsRightToLeft { get; }Returns
System.Boolean
Aliases
Section titled “Aliases”public IReadOnlyList<string> Aliases { get; }Returns
System.Collections.Generic.IReadOnlyList{System.String}