OpenTTD Source  12.0-beta2
strings.cpp File Reference
#include "stdafx.h"
#include "currency.h"
#include "station_base.h"
#include "town.h"
#include "waypoint_base.h"
#include "depot_base.h"
#include "industry.h"
#include "newgrf_text.h"
#include "fileio_func.h"
#include "signs_base.h"
#include "fontdetection.h"
#include "error.h"
#include "strings_func.h"
#include "rev.h"
#include "core/endian_func.hpp"
#include "date_func.h"
#include "vehicle_base.h"
#include "engine_base.h"
#include "language.h"
#include "townname_func.h"
#include "string_func.h"
#include "company_base.h"
#include "smallmap_gui.h"
#include "window_func.h"
#include "debug.h"
#include "game/game_text.hpp"
#include "network/network_content_gui.h"
#include <stack>
#include "table/strings.h"
#include "table/control_codes.h"
#include "safeguards.h"

Go to the source code of this file.

Data Structures

struct  LanguagePack
 
struct  LanguagePackDeleter
 
struct  LoadedLanguagePack
 
struct  UnitConversion
 Helper for unit conversion. More...
 
struct  Units
 Information about a specific unit system. More...
 
struct  UnitsLong
 Information about a specific unit system with a long variant. More...
 
class  LanguagePackGlyphSearcher
 Helper for searching through the language pack. More...
 

Functions

void SetDParamMaxValue (uint n, uint64 max_value, uint min_count, FontSize size)
 Set DParam n to some number that is suitable for string size computations. More...
 
void SetDParamMaxDigits (uint n, uint count, FontSize size)
 Set DParam n to some number that is suitable for string size computations. More...
 
void CopyInDParam (int offs, const uint64 *src, int num)
 Copy num string parameters from array src into the global string parameter array. More...
 
void CopyOutDParam (uint64 *dst, int offs, int num)
 Copy num string parameters from the global string parameter array to the dst array. More...
 
void CopyOutDParam (uint64 *dst, const char **strings, StringID string, int num)
 Copy num string parameters from the global string parameter array to the dst array. More...
 
static char * StationGetSpecialString (char *buff, int x, const char *last)
 
static char * GetSpecialTownNameString (char *buff, int ind, uint32 seed, const char *last)
 
static char * GetSpecialNameString (char *buff, int ind, StringParameters *args, const char *last)
 
static char * FormatString (char *buff, const char *str_arg, StringParameters *args, const char *last, uint case_index, bool game_script, bool dry_run)
 Parse most format codes within a string and write the result to a buffer. More...
 
const char * GetStringPtr (StringID string)
 
char * GetStringWithArgs (char *buffr, StringID string, StringParameters *args, const char *last, uint case_index, bool game_script)
 Get a parsed string with most special stringcodes replaced by the string parameters. More...
 
char * GetString (char *buffr, StringID string, const char *last)
 
std::string GetString (StringID string)
 Resolve the given StringID into a std::string with all the associated DParam lookups and formatting. More...
 
void SetDParamStr (uint n, const char *str)
 This function is used to "bind" a C string to a OpenTTD dparam slot. More...
 
void SetDParamStr (uint n, const std::string &str)
 This function is used to "bind" the C string of a std::string to a OpenTTD dparam slot. More...
 
static char * FormatNumber (char *buff, int64 number, const char *last, const char *separator, int zerofill=1, int fractional_digits=0)
 Format a number into a string. More...
 
static char * FormatCommaNumber (char *buff, int64 number, const char *last, int fractional_digits=0)
 
static char * FormatNoCommaNumber (char *buff, int64 number, const char *last)
 
static char * FormatZerofillNumber (char *buff, int64 number, int64 count, const char *last)
 
static char * FormatHexNumber (char *buff, uint64 number, const char *last)
 
static char * FormatBytes (char *buff, int64 number, const char *last)
 Format a given number as a number of bytes with the SI prefix. More...
 
static char * FormatYmdString (char *buff, Date date, const char *last, uint case_index)
 
static char * FormatMonthAndYear (char *buff, Date date, const char *last, uint case_index)
 
static char * FormatTinyOrISODate (char *buff, Date date, StringID str, const char *last)
 
static char * FormatGenericCurrency (char *buff, const CurrencySpec *spec, Money number, bool compact, const char *last)
 
static int DeterminePluralForm (int64 count, int plural_form)
 Determine the "plural" index given a plural form and a number. More...
 
static const char * ParseStringChoice (const char *b, uint form, char **dst, const char *last)
 
uint ConvertSpeedToDisplaySpeed (uint speed)
 Convert the given (internal) speed to the display speed. More...
 
uint ConvertDisplaySpeedToSpeed (uint speed)
 Convert the given display speed to the (internal) speed. More...
 
uint ConvertKmhishSpeedToDisplaySpeed (uint speed)
 Convert the given km/h-ish speed to the display speed. More...
 
uint ConvertDisplaySpeedToKmhishSpeed (uint speed)
 Convert the given display speed to the km/h-ish speed. More...
 
static char * GenAndCoName (char *buff, uint32 arg, const char *last)
 
static char * GenPresidentName (char *buff, uint32 x, const char *last)
 
bool ReadLanguagePack (const LanguageMetadata *lang)
 Read a particular language. More...
 
const char * GetCurrentLocale (const char *param)
 Determine the current charset based on the environment First check some default values, after this one we passed ourselves and if none exist return the value for $LANG. More...
 
bool StringIDSorter (const StringID &a, const StringID &b)
 
const LanguageMetadataGetLanguage (byte newgrflangid)
 Get the language with the given NewGRF language ID. More...
 
static bool GetLanguageFileHeader (const char *file, LanguagePackHeader *hdr)
 Reads the language file header and checks compatibility. More...
 
static void GetLanguageList (const char *path)
 Gets a list of languages from the given directory. More...
 
void InitializeLanguagePacks ()
 Make a list of the available language packs. More...
 
const char * GetCurrentLanguageIsoCode ()
 Get the ISO language code of the currently loaded language. More...
 
void CheckForMissingGlyphs (bool base_font, MissingGlyphSearcher *searcher)
 Check whether the currently loaded language pack uses characters that the currently loaded font does not support. More...
 

Variables

std::string _config_language_file
 The file (name) stored in the configuration.
 
LanguageList _languages
 The actual list of language meta data.
 
const LanguageMetadata_current_language = nullptr
 The currently loaded language.
 
TextDirection _current_text_dir
 Text direction of the currently selected language.
 
std::unique_ptr< icu::Collator > _current_collator
 Collator for the language currently in use.
 
static uint64 _global_string_params_data [20]
 Global array of string parameters. To access, use SetDParam.
 
static WChar _global_string_params_type [20]
 Type of parameters stored in #_global_string_params.
 
StringParameters _global_string_params (_global_string_params_data, 20, _global_string_params_type)
 
static LoadedLanguagePack _langpack
 
static bool _scan_for_gender_data = false
 Are we scanning for the gender of the current string? (instead of formatting it)
 
static const Units _units_velocity []
 Unit conversions for velocity. More...
 
static const Units _units_power []
 Unit conversions for velocity. More...
 
static const UnitsLong _units_weight []
 Unit conversions for weight. More...
 
static const UnitsLong _units_volume []
 Unit conversions for volume. More...
 
static const Units _units_force []
 Unit conversions for force. More...
 
static const Units _units_height []
 Unit conversions for height. More...
 
static const char *const _silly_company_names []
 
static const char *const _surname_list []
 
static const char *const _silly_surname_list []
 
static const char _initial_name_letters []
 

Detailed Description

Handling of translated strings.

Definition in file strings.cpp.

Function Documentation

◆ CheckForMissingGlyphs()

void CheckForMissingGlyphs ( bool  base_font,
MissingGlyphSearcher searcher 
)

Check whether the currently loaded language pack uses characters that the currently loaded font does not support.

If this is the case an error message will be shown in English. The error message will not be localized because that would mean it might use characters that are not in the font, which is the whole reason this check has been added.

Parameters
base_fontWhether to look at the base font as well.
searcherThe methods to use to search for strings to check. If nullptr the loaded language pack searcher is used.

Definition at line 2110 of file strings.cpp.

References MissingGlyphSearcher::FindMissingGlyphs().

Referenced by GameOptionsWindow::OnDropdownSelect().

◆ ConvertDisplaySpeedToKmhishSpeed()

uint ConvertDisplaySpeedToKmhishSpeed ( uint  speed)

Convert the given display speed to the km/h-ish speed.

Parameters
speedthe speed to convert
Returns
the converted speed.

Definition at line 784 of file strings.cpp.

References _settings_game, _units_velocity, Units::c, UnitConversion::FromDisplay(), GameSettings::locale, and LocaleSettings::units_velocity.

Referenced by TimetableWindow::OnQueryTextFinished().

◆ ConvertDisplaySpeedToSpeed()

uint ConvertDisplaySpeedToSpeed ( uint  speed)

Convert the given display speed to the (internal) speed.

Parameters
speedthe speed to convert
Returns
the converted speed.

Definition at line 764 of file strings.cpp.

References _settings_game, _units_velocity, Units::c, UnitConversion::FromDisplay(), GameSettings::locale, and LocaleSettings::units_velocity.

Referenced by OrdersWindow::OnQueryTextFinished().

◆ ConvertKmhishSpeedToDisplaySpeed()

uint ConvertKmhishSpeedToDisplaySpeed ( uint  speed)

Convert the given km/h-ish speed to the display speed.

Parameters
speedthe speed to convert
Returns
the converted speed.

Definition at line 774 of file strings.cpp.

References _settings_game, _units_velocity, Units::c, GameSettings::locale, UnitConversion::ToDisplay(), and LocaleSettings::units_velocity.

◆ ConvertSpeedToDisplaySpeed()

uint ConvertSpeedToDisplaySpeed ( uint  speed)

Convert the given (internal) speed to the display speed.

Parameters
speedthe speed to convert
Returns
the converted speed.

Definition at line 751 of file strings.cpp.

References _settings_game, _units_velocity, Units::c, GameSettings::locale, UnitConversion::ToDisplay(), and LocaleSettings::units_velocity.

◆ CopyInDParam()

void CopyInDParam ( int  offs,
const uint64 *  src,
int  num 
)

Copy num string parameters from array src into the global string parameter array.

Parameters
offsIndex in the global array to copy the first string parameter to.
srcSource array of string parameters.
numNumber of string parameters to copy.

Definition at line 128 of file strings.cpp.

References MemCpyT().

Referenced by ErrmsgWindow::DrawWidget(), ErrmsgWindow::SetStringParameters(), QueryWindow::SetStringParameters(), and ErrmsgWindow::UpdateWidgetSize().

◆ CopyOutDParam() [1/2]

void CopyOutDParam ( uint64 *  dst,
const char **  strings,
StringID  string,
int  num 
)

Copy num string parameters from the global string parameter array to the dst array.

Furthermore clone raw string parameters into strings and amend the data in dst.

Parameters
dstDestination array of string parameters.
stringsDestination array for clone of the raw strings. Must be of same length as dst. Deallocation left to the caller.
stringThe string used to determine where raw strings are and where there are no raw strings.
numNumber of string parameters to copy.

Definition at line 152 of file strings.cpp.

References DRAW_STRING_BUFFER, GetString(), lastof, and MemCpyT().

◆ CopyOutDParam() [2/2]

void CopyOutDParam ( uint64 *  dst,
int  offs,
int  num 
)

Copy num string parameters from the global string parameter array to the dst array.

Parameters
dstDestination array of string parameters.
offsIndex in the global array to copy the first string parameter from.
numNumber of string parameters to copy.

Definition at line 139 of file strings.cpp.

References MemCpyT().

Referenced by ErrorMessageData::CopyOutDParams(), and NewsItem::NewsItem().

◆ DeterminePluralForm()

static int DeterminePluralForm ( int64  count,
int  plural_form 
)
static

Determine the "plural" index given a plural form and a number.

Parameters
countThe number to get the plural index of.
plural_formThe plural form we want an index for.
Returns
The plural index for the given form.

Definition at line 523 of file strings.cpp.

References abs().

◆ FormatBytes()

static char* FormatBytes ( char *  buff,
int64  number,
const char *  last 
)
static

Format a given number as a number of bytes with the SI prefix.

Parameters
buffthe buffer to write to
numberthe number of bytes to write down
lastthe last element in the buffer
Returns
till where we wrote

Definition at line 391 of file strings.cpp.

References _settings_game, LocaleSettings::digit_decimal_separator, GameSettings::locale, and StrEmpty().

◆ FormatNumber()

static char* FormatNumber ( char *  buff,
int64  number,
const char *  last,
const char *  separator,
int  zerofill = 1,
int  fractional_digits = 0 
)
static

Format a number into a string.

Parameters
buffthe buffer to write to
numberthe number to write down
lastthe last element in the buffer
separatorthe thousands-separator to use
zerofillminimum number of digits to print for the integer part. The number will be filled with zeros at the front if necessary.
fractional_digitsnumber of fractional digits to display after a decimal separator. The decimal separator is inserted in front of the fractional_digits last digit of number.
Returns
till where we wrote

Definition at line 323 of file strings.cpp.

References _settings_game, LocaleSettings::digit_decimal_separator, GameSettings::locale, seprintf(), and StrEmpty().

◆ FormatString()

static char * FormatString ( char *  buff,
const char *  str_arg,
StringParameters args,
const char *  last,
uint  case_index,
bool  game_script,
bool  dry_run 
)
static

Parse most format codes within a string and write the result to a buffer.

Parameters
buffThe buffer to write the final string to.
str_argThe original string with format codes.
argsPointer to extra arguments used by various string codes.
lastPointer to just past the end of the buff array.
dry_runTrue when the argt array is not yet initialized.

Definition at line 796 of file strings.cpp.

References CreateTextRefStackBackup(), StringParameters::HasTypeInformation(), StringParameters::offset, RestoreTextRefStackBackup(), and UsingNewGRFTextStack().

◆ GetCurrentLanguageIsoCode()

const char* GetCurrentLanguageIsoCode ( )

Get the ISO language code of the currently loaded language.

Returns
the ISO code.

Definition at line 2003 of file strings.cpp.

Referenced by GameOptionsWindow::DrawWidget(), and GameOptionsWindow::UpdateWidgetSize().

◆ GetCurrentLocale()

const char* GetCurrentLocale ( const char *  param)

Determine the current charset based on the environment First check some default values, after this one we passed ourselves and if none exist return the value for $LANG.

Parameters
paramenvironment variable to check conditionally if default ones are not set. Pass nullptr if you don't want additional checks.
Returns
return string containing current charset, or nullptr if not-determinable

Definition at line 1849 of file strings.cpp.

◆ GetLanguage()

const LanguageMetadata* GetLanguage ( byte  newgrflangid)

Get the language with the given NewGRF language ID.

Parameters
newgrflangidNewGRF languages ID to check.
Returns
The language's metadata, or nullptr if it is not known.

Definition at line 1885 of file strings.cpp.

References _languages.

◆ GetLanguageFileHeader()

static bool GetLanguageFileHeader ( const char *  file,
LanguagePackHeader hdr 
)
static

Reads the language file header and checks compatibility.

Parameters
filethe file to read
hdrthe place to write the header information to
Returns
true if and only if the language file is of a compatible version

Definition at line 1900 of file strings.cpp.

References LanguagePackHeader::IsValid(), and LanguagePackHeader::missing.

◆ GetLanguageList()

static void GetLanguageList ( const char *  path)
static

Gets a list of languages from the given directory.

Parameters
paththe base directory to search in

Definition at line 1922 of file strings.cpp.

References ttd_opendir().

◆ GetString()

std::string GetString ( StringID  string)

Resolve the given StringID into a std::string with all the associated DParam lookups and formatting.

Parameters
stringThe unique identifier of the translatable string.
Returns
The std::string of the translated string.

Definition at line 284 of file strings.cpp.

References DRAW_STRING_BUFFER, GetString(), and lastof.

Referenced by CopyOutDParam(), and GetString().

◆ GetStringWithArgs()

char* GetStringWithArgs ( char *  buffr,
StringID  string,
StringParameters args,
const char *  last,
uint  case_index,
bool  game_script 
)

Get a parsed string with most special stringcodes replaced by the string parameters.

Parameters
buffrPointer to a string buffer where the formatted string should be written to.
string
argsArguments for the string.
lastPointer just past the end of buffr.
case_indexThe "case index". This will only be set when FormatString wants to print the string in a different case.
game_scriptThe string is coming directly from a game script.
Returns
Pointer to the final zero byte of the formatted string.

Definition at line 221 of file strings.cpp.

References GetStringIndex(), GetStringTab(), and GetStringWithArgs().

Referenced by GetStringWithArgs(), and GetTownName().

◆ InitializeLanguagePacks()

void InitializeLanguagePacks ( )

Make a list of the available language packs.

Put the data in _languages list.

< Matching the language in the configuration file or the current locale

< Using pt_PT for pt_BR locale when pt_BR is not available

< Fallback when no locale-matching language has been found

Definition at line 1954 of file strings.cpp.

◆ ReadLanguagePack()

bool ReadLanguagePack ( const LanguageMetadata lang)

Read a particular language.

Parameters
langThe metadata about the language.
Returns
Whether the loading went okay or not.

Definition at line 1736 of file strings.cpp.

References LanguageMetadata::file, ReadFileToMem(), and TEXT_TAB_END.

Referenced by GameOptionsWindow::OnDropdownSelect().

◆ SetDParamMaxDigits()

void SetDParamMaxDigits ( uint  n,
uint  count,
FontSize  size 
)

Set DParam n to some number that is suitable for string size computations.

Parameters
nIndex of the string parameter.
countNumber of digits which shall be displayable.
sizeFont of the number

Definition at line 110 of file strings.cpp.

References GetBroadestDigit(), and SetDParam().

Referenced by SetDParamMaxValue(), DepotWindow::UpdateWidgetSize(), TownDirectoryWindow::UpdateWidgetSize(), and ScanProgressWindow::UpdateWidgetSize().

◆ SetDParamMaxValue()

void SetDParamMaxValue ( uint  n,
uint64  max_value,
uint  min_count,
FontSize  size 
)

Set DParam n to some number that is suitable for string size computations.

Parameters
nIndex of the string parameter.
max_valueThe biggest value which shall be displayed. For the result only the number of digits of max_value matter.
min_countMinimum number of digits independent of max.
sizeFont of the number

Definition at line 94 of file strings.cpp.

References SetDParamMaxDigits().

Referenced by OrdersWindow::DrawWidget(), SetDateWindow::UpdateWidgetSize(), StatusBarWindow::UpdateWidgetSize(), TimetableWindow::UpdateWidgetSize(), NewGRFParametersWindow::UpdateWidgetSize(), BaseGraphWindow::UpdateWidgetSize(), GenerateLandscapeWindow::UpdateWidgetSize(), DepotWindow::UpdateWidgetSize(), CreateScenarioWindow::UpdateWidgetSize(), GenerateProgressWindow::UpdateWidgetSize(), VehicleDetailsWindow::UpdateWidgetSize(), and ScanProgressWindow::UpdateWidgetSize().

◆ SetDParamStr() [1/2]

void SetDParamStr ( uint  n,
const char *  str 
)

This function is used to "bind" a C string to a OpenTTD dparam slot.

Parameters
nslot of the string
strstring to bind

Definition at line 296 of file strings.cpp.

References SetDParam().

Referenced by GameOptionsWindow::DrawWidget(), GoalQuestionWindow::DrawWidget(), MusicWindow::DrawWidget(), AIConfigWindow::DrawWidget(), ErrorUnknownCallbackResult(), StoryBookWindow::GetHeadHeight(), StoryBookWindow::GetPageElementHeight(), GetSavegameFormat(), GetSaveLoadErrorString(), GRFLoadConfig(), BuildIndustryWindow::MakeCargoListString(), NetworkClientListWindow::OnClick(), IConsoleWindow::OnPaint(), GoalListWindow::OnPaint(), SaveFileError(), SetDParamStr(), ContentTextfileWindow::SetStringParameters(), BaseSetTextfileWindow< TBaseSet >::SetStringParameters(), NetworkChatWindow::SetStringParameters(), MusicTrackSelectionWindow::SetStringParameters(), AboutWindow::SetStringParameters(), NewGRFTextfileWindow::SetStringParameters(), ScriptTextfileWindow::SetStringParameters(), StoryBookWindow::SetStringParameters(), NewGRFWindow::SetStringParameters(), AIDebugWindow::SetStringParameters(), NetworkClientListWindow::SetStringParameters(), NetworkAskRelayWindow::SetStringParameters(), CustomCurrencyWindow::SetStringParameters(), ShowNewGrfVehicleError(), LandInfoWindow::UpdateWidgetSize(), GameOptionsWindow::UpdateWidgetSize(), GoalQuestionWindow::UpdateWidgetSize(), MusicTrackSelectionWindow::UpdateWidgetSize(), MusicWindow::UpdateWidgetSize(), StoryBookWindow::UpdateWidgetSize(), and WarnCorruptSprite().

◆ SetDParamStr() [2/2]

void SetDParamStr ( uint  n,
const std::string &  str 
)

This function is used to "bind" the C string of a std::string to a OpenTTD dparam slot.

The caller has to ensure that the std::string reference remains valid while the string is shown.

Parameters
nslot of the string
strstring to bind

Definition at line 307 of file strings.cpp.

References SetDParamStr().

Variable Documentation

◆ _initial_name_letters

const char _initial_name_letters[]
static
Initial value:
= {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J',
'K', 'L', 'M', 'N', 'P', 'R', 'S', 'T', 'W',
}

Definition at line 1626 of file strings.cpp.

◆ _silly_company_names

const char* const _silly_company_names[]
static
Initial value:
= {
"Bloggs Brothers",
"Tiny Transport Ltd.",
"Express Travel",
"Comfy-Coach & Co.",
"Crush & Bump Ltd.",
"Broken & Late Ltd.",
"Sam Speedy & Son",
"Supersonic Travel",
"Mike's Motors",
"Lightning International",
"Pannik & Loozit Ltd.",
"Inter-City Transport",
"Getout & Pushit Ltd."
}

Definition at line 1563 of file strings.cpp.

◆ _silly_surname_list

const char* const _silly_surname_list[]
static
Initial value:
= {
"Grumpy",
"Dozy",
"Speedy",
"Nosey",
"Dribble",
"Mushroom",
"Cabbage",
"Sniffle",
"Fishy",
"Swindle",
"Sneaky",
"Nutkins"
}

Definition at line 1611 of file strings.cpp.

◆ _units_force

const Units _units_force[]
static
Initial value:
= {
{ {3597, 4}, STR_UNITS_FORCE_IMPERIAL, 0 },
{ {3263, 5}, STR_UNITS_FORCE_METRIC, 0 },
{ { 1, 0}, STR_UNITS_FORCE_SI, 0 },
}

Unit conversions for force.

Definition at line 733 of file strings.cpp.

◆ _units_height

const Units _units_height[]
static
Initial value:
= {
{ { 3, 0}, STR_UNITS_HEIGHT_IMPERIAL, 0 },
{ { 1, 0}, STR_UNITS_HEIGHT_METRIC, 0 },
{ { 1, 0}, STR_UNITS_HEIGHT_SI, 0 },
}

Unit conversions for height.

Definition at line 740 of file strings.cpp.

◆ _units_power

const Units _units_power[]
static
Initial value:
= {
{ { 1, 0}, STR_UNITS_POWER_IMPERIAL, 0 },
{ {4153, 12}, STR_UNITS_POWER_METRIC, 0 },
{ {6109, 13}, STR_UNITS_POWER_SI, 0 },
}

Unit conversions for velocity.

Definition at line 712 of file strings.cpp.

◆ _units_velocity

const Units _units_velocity[]
static
Initial value:
= {
{ { 1, 0}, STR_UNITS_VELOCITY_IMPERIAL, 0 },
{ { 103, 6}, STR_UNITS_VELOCITY_METRIC, 0 },
{ { 1831, 12}, STR_UNITS_VELOCITY_SI, 0 },
{ {37888, 16}, STR_UNITS_VELOCITY_GAMEUNITS, 1 },
}

Unit conversions for velocity.

Definition at line 704 of file strings.cpp.

Referenced by ConvertDisplaySpeedToKmhishSpeed(), ConvertDisplaySpeedToSpeed(), ConvertKmhishSpeedToDisplaySpeed(), and ConvertSpeedToDisplaySpeed().

◆ _units_volume

const UnitsLong _units_volume[]
static
Initial value:
= {
{ {4227, 4}, STR_UNITS_VOLUME_SHORT_IMPERIAL, STR_UNITS_VOLUME_LONG_IMPERIAL },
{ {1000, 0}, STR_UNITS_VOLUME_SHORT_METRIC, STR_UNITS_VOLUME_LONG_METRIC },
{ { 1, 0}, STR_UNITS_VOLUME_SHORT_SI, STR_UNITS_VOLUME_LONG_SI },
}

Unit conversions for volume.

Definition at line 726 of file strings.cpp.

◆ _units_weight

const UnitsLong _units_weight[]
static
Initial value:
= {
{ {4515, 12}, STR_UNITS_WEIGHT_SHORT_IMPERIAL, STR_UNITS_WEIGHT_LONG_IMPERIAL },
{ { 1, 0}, STR_UNITS_WEIGHT_SHORT_METRIC, STR_UNITS_WEIGHT_LONG_METRIC },
{ {1000, 0}, STR_UNITS_WEIGHT_SHORT_SI, STR_UNITS_WEIGHT_LONG_SI },
}

Unit conversions for weight.

Definition at line 719 of file strings.cpp.