Localization

public static class Localization

Properties

CurrentLanguageId

#Since v6.0
public static int CurrentLanguageId { get; }

RunningAsEnglish

#Since v6.0
public static bool RunningAsEnglish { get; }

Methods

FormatArea

#Since v7.0
public static string FormatArea(double area, UnitSystem units, DimensionStyle dimStyle, bool alternate)
Format an Area string from a number
area (double)
units (UnitSystem)
dimStyle (DimensionStyle)
alternate (bool)

FormatDistanceAndTolerance

#Since v7.0
public static string FormatDistanceAndTolerance(double distance, UnitSystem units, DimensionStyle dimStyle, bool alternate)
distance (double)
units (UnitSystem)
dimStyle (DimensionStyle)
alternate (bool)primary or alternate

FormatNumber

#Since v9.0
public static string FormatNumber(double x, LengthUnit units, DistanceDisplayMode mode, int precision, bool appendUnitSystemName)
Get a string version of a number in a given unit system / display mode.
x (double)The number to format into a string.
units (LengthUnit)The length unit for the number.
mode (DistanceDisplayMode)How the number should be formatted.
precision (int)The precision of the number.
appendUnitSystemName (bool)Adds unit system name to the end of the number.
The formatted number.

FormatNumber

#Since v5.0
public static string FormatNumber(double x, UnitSystem units, DistanceDisplayMode mode, int precision, bool appendUnitSystemName)
Get a string version of a number in a given unit system / display mode.
x (double)The number to format into a string.
units (UnitSystem)The unit system for the number.
mode (DistanceDisplayMode)How the number should be formatted.
precision (int)The precision of the number.
appendUnitSystemName (bool)Adds unit system name to the end of the number.
The formatted number.

FormatNumber

#Since v8.0
public static string FormatNumber(double x)
Get a string version of a number.
x (double)The number to format into a string.
The formatted number.

FormatVolume

#Since v7.0
public static string FormatVolume(double volume, UnitSystem units, DimensionStyle dimStyle, bool alternate)
Format a Volume string from a number
volume (double)
units (UnitSystem)
dimStyle (DimensionStyle)
alternate (bool)

GetLanguages

#Since v8.0
public static bool GetLanguages(out SimpleArrayInt ids, out ClassArrayString names)
ids (out SimpleArrayInt)
names (out ClassArrayString)

LocalizeCommandName

#Since v5.0
public static string LocalizeCommandName(string english, object assemblyOrObject)
english (string)
assemblyOrObject (object)

LocalizeCommandName

#Since v5.0
public static string LocalizeCommandName(string english)
Commands that need to be localized should call this function.
english (string)The localized command name.

LocalizeCommandOptionName

#Since v5.0
public static LocalizeStringPair LocalizeCommandOptionName(string english, int contextId)
english (string)
contextId (int)

LocalizeCommandOptionName

#Since v7.0 Obsolete v7.1
public static LocalizeStringPair LocalizeCommandOptionName(string english, int wrongcontextId, int contextId)
removedDon't copy and paste context IDs
DO NOT use this function, it is a trap to determine where context IDs have been copied from other, already extracted, strings.
english (string)The text in English.
wrongcontextId (int)The copied ID.
contextId (int)The context ID.
The english string.

LocalizeCommandOptionName

#Since v5.0
public static LocalizeStringPair LocalizeCommandOptionName(string english, object assemblyOrObject, int contextId)
english (string)
assemblyOrObject (object)
contextId (int)

LocalizeCommandOptionValue

#Since v5.0
public static LocalizeStringPair LocalizeCommandOptionValue(string english, int contextId)
english (string)
contextId (int)

LocalizeCommandOptionValue

#Since v5.0
public static LocalizeStringPair LocalizeCommandOptionValue(string english, object assemblyOrObject, int contextId)
english (string)
assemblyOrObject (object)
contextId (int)

LocalizeDialogItem

#Since v5.5
public static string LocalizeDialogItem(object assemblyOrObject, string key, string english)
Look in the dialog item list for the specified key and return the translated localized string if the key is found otherwise return the English string.
assemblyOrObject (object)An assembly or an object from an assembly.
key (string)
english (string)The text in English.
Look in the dialog item list for the specified key and return the translated localized string if the key is found otherwise return the English string.

LocalizeForm

#Since v6.0
public static void LocalizeForm(object formOrUserControl)
Look in the dialog item list for the specified key and return the translated localized string if the key is found otherwise return the English string.
formOrUserControl (object)

LocalizeString

#Since v5.0
public static string LocalizeString(string english, int contextId)
Returns localized version of a given English string. This function should be auto-generated by the RmaLDotNetLocalizationProcessor application for every function that uses RMASTR.
english (string)The text in English.
contextId (int)The context ID.
The localized string.

LocalizeString

#Since v7.0 Obsolete v7.1
public static string LocalizeString(string english, int wrongcontextId, int contextId)
removedDon't copy and paste context IDs
DO NOT use this function, it is a trap to determine where context IDs have been copied from other, already extracted, strings.
english (string)The text in English.
wrongcontextId (int)The copied ID.
contextId (int)The context ID.
The english string.

LocalizeString

#Since v5.0
public static string LocalizeString(string english, object assemblyOrObject, int contextId)
Returns localized version of a given English string. This function should be auto-generated by the RmaLDotNetLocalizationProcessor application for every function that uses RMASTR.
english (string)The text in English.
assemblyOrObject (object)An assembly or an object from an assembly.
contextId (int)The context ID.
The localized string.

LogicalSort

#Since v8.32
public static int LogicalSort(string string1, string string2)
Compares two strings. Digits in the strings are considered as numerical content rather than text. This test is not case-sensitive.
string1 (string)First string to be compared.
string2 (string)Second string to be compared.
Returns zero if the strings are identical. Returns 1 if string1 has a greater value than string2. Returns -1 if string1 has a lesser value than string2.

SetLanguageId

#Since v5.0
public static bool SetLanguageId(int id)
Sets the Id used for Localization in RhinoCommon. Only useful for when using RhinoCommon outside of the Rhino process
id (int)
true if the language id could be set

UnitSystemName

#Since v5.0
public static string UnitSystemName(UnitSystem units, bool capitalize, bool singular, bool abbreviate)
Gets localized unit system name. Uses current application locale id.
units (UnitSystem)The unit system.
capitalize (bool)true if the name should be capitalized.
singular (bool)true if the name is expressed for a singular element.
abbreviate (bool)true if name should be the abbreviation.
The unit system name.