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
Format an Area string from a number
public static string FormatArea(
area,
units,
dimStyle,
alternate
)

FormatDistanceAndTolerance

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

FormatNumber

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

FormatNumber

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

FormatNumber

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

FormatVolume

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

GetLanguages

#Since v8.0
public static bool GetLanguages()

LocalizeCommandName

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

LocalizeCommandName

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

LocalizeCommandOptionName

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

LocalizeCommandOptionName

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

LocalizeCommandOptionName

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

LocalizeCommandOptionValue

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

LocalizeCommandOptionValue

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

LocalizeDialogItem

#Since v5.5
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.
public static string LocalizeDialogItem(
assemblyOrObject,
An assembly or an object from an assembly.
key,
english
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
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.
public static void LocalizeForm(
formOrUserControl
)

LocalizeString

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

LocalizeString

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

LocalizeString

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

LogicalSort

#Since v8.32
Compares two strings. Digits in the strings are considered as numerical content rather than text. This test is not case-sensitive.
public static int LogicalSort(
string1,
First string to be compared.
string2
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
Sets the Id used for Localization in RhinoCommon. Only useful for when using RhinoCommon outside of the Rhino process
public static bool SetLanguageId(
id
)
true if the language id could be set

UnitSystemName

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