diff --git a/components/rx/trunk/languages/rxconst.es.po b/components/rx/trunk/languages/rxconst.es.po index bf4422bba..2968b1a55 100644 --- a/components/rx/trunk/languages/rxconst.es.po +++ b/components/rx/trunk/languages/rxconst.es.po @@ -203,10 +203,22 @@ msgstr "" msgid "Error. Expected value for field %s." msgstr "" +#: rxconst.srxbyte +msgid "B" +msgstr "" + #: rxconst.srxcloseformvalidatoreditor msgid "Rx close form validator editor" msgstr "" +#: rxconst.srxgigabyte +msgid "GB" +msgstr "" + +#: rxconst.srxkilobyte +msgid "KB" +msgstr "" + #: rxconst.srxlogindlgbtnmore msgid "More >>" msgstr "" @@ -215,10 +227,18 @@ msgstr "" msgid "Database" msgstr "" +#: rxconst.srxmegabyte +msgid "MB" +msgstr "" + #: rxconst.srxstrholdertexteditor msgid "Rx string holder editor" msgstr "" +#: rxconst.srxterrabyte +msgid "TB" +msgstr "" + #: rxconst.srxtextfolderitem msgid "Item " msgstr "" diff --git a/components/rx/trunk/languages/rxconst.pl.po b/components/rx/trunk/languages/rxconst.pl.po index 271629f77..e4ae38c08 100644 --- a/components/rx/trunk/languages/rxconst.pl.po +++ b/components/rx/trunk/languages/rxconst.pl.po @@ -211,10 +211,22 @@ msgstr "" msgid "Error. Expected value for field %s." msgstr "Błąd. Spodziewano wartości dla pola %s." +#: rxconst.srxbyte +msgid "B" +msgstr "" + #: rxconst.srxcloseformvalidatoreditor msgid "Rx close form validator editor" msgstr "" +#: rxconst.srxgigabyte +msgid "GB" +msgstr "" + +#: rxconst.srxkilobyte +msgid "KB" +msgstr "" + #: rxconst.srxlogindlgbtnmore msgid "More >>" msgstr "Więcej >>" @@ -223,10 +235,18 @@ msgstr "Więcej >>" msgid "Database" msgstr "Baza danych" +#: rxconst.srxmegabyte +msgid "MB" +msgstr "" + #: rxconst.srxstrholdertexteditor msgid "Rx string holder editor" msgstr "" +#: rxconst.srxterrabyte +msgid "TB" +msgstr "" + #: rxconst.srxtextfolderitem msgid "Item " msgstr "" diff --git a/components/rx/trunk/languages/rxconst.ru.po b/components/rx/trunk/languages/rxconst.ru.po index 1d7ee2beb..16ce5f762 100644 --- a/components/rx/trunk/languages/rxconst.ru.po +++ b/components/rx/trunk/languages/rxconst.ru.po @@ -211,10 +211,22 @@ msgstr "Вопрос" msgid "Error. Expected value for field %s." msgstr "Поле %s. Требуется значение" +#: rxconst.srxbyte +msgid "B" +msgstr "" + #: rxconst.srxcloseformvalidatoreditor msgid "Rx close form validator editor" msgstr "Редактор RxCloseFormValidator" +#: rxconst.srxgigabyte +msgid "GB" +msgstr "" + +#: rxconst.srxkilobyte +msgid "KB" +msgstr "" + #: rxconst.srxlogindlgbtnmore msgid "More >>" msgstr "Больше >>" @@ -223,10 +235,18 @@ msgstr "Больше >>" msgid "Database" msgstr "База данных" +#: rxconst.srxmegabyte +msgid "MB" +msgstr "" + #: rxconst.srxstrholdertexteditor msgid "Rx string holder editor" msgstr "Редактор RxStrHolder" +#: rxconst.srxterrabyte +msgid "TB" +msgstr "" + #: rxconst.srxtextfolderitem msgid "Item " msgstr "Строка " diff --git a/components/rx/trunk/languages/rxconst.uk.po b/components/rx/trunk/languages/rxconst.uk.po index f76f0e3a2..be55f121e 100644 --- a/components/rx/trunk/languages/rxconst.uk.po +++ b/components/rx/trunk/languages/rxconst.uk.po @@ -215,10 +215,22 @@ msgstr "" msgid "Error. Expected value for field %s." msgstr "Поле %s. Вимагається значення" +#: rxconst.srxbyte +msgid "B" +msgstr "" + #: rxconst.srxcloseformvalidatoreditor msgid "Rx close form validator editor" msgstr "" +#: rxconst.srxgigabyte +msgid "GB" +msgstr "" + +#: rxconst.srxkilobyte +msgid "KB" +msgstr "" + #: rxconst.srxlogindlgbtnmore msgid "More >>" msgstr "" @@ -227,10 +239,18 @@ msgstr "" msgid "Database" msgstr "" +#: rxconst.srxmegabyte +msgid "MB" +msgstr "" + #: rxconst.srxstrholdertexteditor msgid "Rx string holder editor" msgstr "" +#: rxconst.srxterrabyte +msgid "TB" +msgstr "" + #: rxconst.srxtextfolderitem msgid "Item " msgstr "" diff --git a/components/rx/trunk/rxtools/rxconst.pas b/components/rx/trunk/rxtools/rxconst.pas index 3d104ef1b..a6077ff86 100644 --- a/components/rx/trunk/rxtools/rxconst.pas +++ b/components/rx/trunk/rxtools/rxconst.pas @@ -157,6 +157,12 @@ resourcestring sPressTheKey = 'Press the key'; sShortCut = 'ShortCut'; + { Pretty names for Size} + sRxTerraByte = 'TB'; + sRxGigaByte = 'GB'; + sRxMegaByte = 'MB'; + sRxKiloByte = 'KB'; + sRxByte = 'B'; implementation end. diff --git a/components/rx/trunk/rxtools/rxstrutils.pas b/components/rx/trunk/rxtools/rxstrutils.pas index 926c02907..a18aba551 100644 --- a/components/rx/trunk/rxtools/rxstrutils.pas +++ b/components/rx/trunk/rxtools/rxstrutils.pas @@ -233,16 +233,18 @@ function RomanToInt(const S: string): Longint; deprecated; //use this function f procedure StrToStrings(const S:string; const List:TStrings; const Delims:Char); function FileToString(const AFileName:string):string; +function RxPrettySizeName(ASize:Int64):string; const DigitChars = ['0'..'9']; Brackets = ['(',')','[',']','{','}']; StdWordDelims = [#0..' ',',','.',';','/','\',':','''','"','`'] + Brackets; implementation - +uses {$IFDEF WINDOWS} -uses Windows; + Windows, {$ENDIF} + rxconst; function StrToOem(const AnsiStr: string): string; begin @@ -1149,4 +1151,21 @@ begin Result:=''; end; +function RxPrettySizeName(ASize: Int64): string; +begin + if ASize div (1024 * 1024 * 1024 * 1024) > 0 then + Result := IntToStr(ASize div (1024 * 1024 * 1024 * 1024)) + ' ' +sRxTerraByte + else + if ASize div (1024 * 1024 * 1024) > 0 then + Result := IntToStr(ASize div (1024 * 1024 * 1024)) + ' ' +sRxGigaByte + else + if ASize div (1024 * 1024) > 0 then + Result := IntToStr(ASize div (1024 * 1024)) + ' ' +sRxMegaByte + else + if ASize div 1024 > 0 then + Result := IntToStr(ASize div (1024)) + ' ' +sRxKiloByte + else + Result := IntToStr(ASize div (1024)) + ' ' +sRxByte; +end; + end.