Commit b2474061 authored by kravtsov's avatar kravtsov

[-] Исправлены ошибки перевода

parent 81d01dcc
......@@ -4,12 +4,22 @@
Company : SHTRIH-M, Russia, Moscow, Masterkova 4
(495) 787-60-90, www.shtrih-m.ru
*******************************************************************
OposShtrih_1.13_491.exe
29 мая 2018 11:40
[-] Исправлены ошибки перевода
*******************************************************************
OposShtrih_1.13_490.exe
24 мая 2018 15:20
25 мая 2018 16:20
[+] Добавлен перевод
[+] Добавлена команда directIO DIO_START_CORRECTION
DIO_START_CORRECTION = 61; // start correction receipt
*******************************************************************
......
This diff is collapsed.
[CustomMessages]
; Russian
ru.AppName="-: OPOS "
ru.AppVerName="-: OPOS ${version2}"
ru.AppPublisher=-
ru.AppCopyright="Copyright, 2018 -"
ru.VersionInfoCompany="-"
ru.VersionInfoDescription="OPOS "
; English
en.AppName="SHTRIH-M: OPOS fiscal printer driver"
en.AppVerName="SHTRIH-M: OPOS fiscal printer driver ${version2}"
en.AppPublisher=SHTRIH-M
en.AppCopyright="Copyright, 2018 SHTRIH-M"
en.VersionInfoCompany="SHTRIH-M"
en.VersionInfoDescription="OPOS fiscal printer driver"
[Setup]
AppName="SHTRIH-M: OPOS fiscal printer driver"
AppVerName="SHTRIH-M: OPOS fiscal printer driver ${version2}"
AppName= {cm:AppName}
AppVerName= {cm:AppVerName}
AppPublisher= {cm:AppPublisher}
AppCopyright= {cm:AppCopyright}
VersionInfoCompany= {cm:VersionInfoCompany}
VersionInfoDescription= {cm:VersionInfoDescription}
AppVersion=${version2}
AppPublisher=SHTRIH-M
AppPublisherURL=http://www.shtrih-m.ru
AppSupportURL=http://www.shtrih-m.ru
AppUpdatesURL=http://www.shtrih-m.ru
AppContact=.(495) 787-6090
AppReadmeFile=History.txt
AppCopyright="Copyright, 2017 SHTRIH-M"
;
VersionInfoCompany="SHTRIH-M"
VersionInfoDescription="OPOS fiscal printer driver"
VersionInfoTextVersion="${version}"
VersionInfoVersion=${version}
DefaultDirName= {pf}\OPOS\SHTRIH-M\
DefaultGroupName=OPOS\SHTRIH-M\
UninstallDisplayIcon= {app}\Uninstall.exe
UsePreviousLanguage=No
AllowNoIcons=Yes
OutputDir="."
[Setup]
......@@ -25,9 +41,16 @@ OutputBaseFilename=Setup
[Components]
Name: "main"; Description: "Driver files"; Types: full compact custom; Flags: fixed
Name: "source"; Description: "Samples and source code";
[Languages]
Name: "en"; MessagesFile: "compiler:Default.isl"
Name: "ru"; MessagesFile: "compiler:Languages\Russian.isl"
[Files]
; Version history
Source: "History.txt"; DestDir: "{app}"; Flags: ignoreversion; components: main;
; Localization params
Source: "Setup\locales\SmFiscalPrinter.mo"; DestDir: "{app}\locale\en\LC_MESSAGES\"; Flags: 32bit; Components: main
Source: "Setup\Locales\ru\locale.ini"; DestDir: "{userappdata}\SHTRIH-M\OposShtrih"; DestName: "locale.ini"; Flags: 32bit; Components: main; Languages: ru
Source: "Setup\Locales\en\locale.ini"; DestDir: "{userappdata}\SHTRIH-M\OposShtrih"; DestName: "locale.ini"; Flags: 32bit; Components: main; Languages: en
; Logo files
Source: "Setup\Logo\*.*"; DestDir: "{app}\Bin\Logo"; Flags: ignoreversion; components: main;
; Drivers
......
......@@ -8,7 +8,7 @@ Uses
// Tnt
TntSysUtils, TntClasses, TntRegistry,
// Opos
Oposhi, VersionInfo;
Oposhi, VersionInfo, GNUGetText, DriverError;
type
TOposDevice = class;
......@@ -73,9 +73,6 @@ function ProgIDToFileName(const ProgID: WideString): WideString;
implementation
resourcestring
MsgKeyOpenError = 'Error opening registry key: %s';
function ExtractQuotedStr(const Src: String): String;
begin
Result := Src;
......@@ -205,7 +202,7 @@ begin
KeyName := GetRegKeyName;
if not Reg.OpenKey(KeyName, True) then
raise Exception.CreateFmt(MsgKeyOpenError, [KeyName]);
raiseOpenKeyError(KeyName);
Reg.CreateKey(DeviceName);
Reg.CloseKey;
......@@ -229,7 +226,7 @@ begin
Reg.RootKey := HKEY_LOCAL_MACHINE;
KeyName := GetRegKeyName;
if not Reg.OpenKey(KeyName, False) then
raise Exception.CreateFmt(MsgKeyOpenError, [KeyName]);
raiseOpenKeyError(KeyName);
Reg.DeleteKey(DeviceName);
finally
......@@ -313,7 +310,7 @@ begin
Reg.RootKey := HKEY_LOCAL_MACHINE;
KeyName := GetRegKeyName;
if not Reg.OpenKey(KeyName, False) then
raise Exception.CreateFmt(MsgKeyOpenError, [KeyName]);
raiseOpenKeyError(KeyName);
Reg.GetKeyNames(DeviceNames);
Reg.CloseKey;
......
......@@ -9,23 +9,23 @@ uses
Opos, OposUtils, Oposhi, OposFptr, OposFptrhi, OposException, TntSysUtils,
gnugettext;
function PrinterStateToStr(Value: Integer): string;
function EncodeOposDate(const Date: TOposDate): string;
function DecodeOposDate(const Date: string): TOposDate;
function GetFptrPropertyName(const ID: Integer): string;
function GetResultCodeExtendedText(Value: Integer): string;
function GetStatusUpdateEventText(Value: Integer): string;
function PrinterStateToStr(Value: Integer): WideString;
function EncodeOposDate(const Date: TOposDate): WideString;
function DecodeOposDate(const Date: WideString): TOposDate;
function GetFptrPropertyName(const ID: Integer): WideString;
function GetResultCodeExtendedText(Value: Integer): WideString;
function GetStatusUpdateEventText(Value: Integer): WideString;
procedure OposFptrCheck(Driver: OleVariant; ResultCode: Integer);
function OposFptrGetErrorText(Driver: OleVariant): string;
function ActualCurrencyToStr(Value: Integer): string;
function ContractorIdToStr(Value: Integer): string;
function CountryCodeToStr(Value: Integer): string;
function ErrorLevelToStr(Value: Integer): string;
function DateTypeToStr(Value: Integer): string;
function FiscalReceiptTypeToStr(Value: Integer): string;
function MessageTypeToStr(Value: Integer): string;
function TotalizerTypeToStr(Value: Integer): string;
function StationToStr(Value: Integer): string;
function OposFptrGetErrorText(Driver: OleVariant): WideString;
function ActualCurrencyToStr(Value: Integer): WideString;
function ContractorIdToStr(Value: Integer): WideString;
function CountryCodeToStr(Value: Integer): WideString;
function ErrorLevelToStr(Value: Integer): WideString;
function DateTypeToStr(Value: Integer): WideString;
function FiscalReceiptTypeToStr(Value: Integer): WideString;
function MessageTypeToStr(Value: Integer): WideString;
function TotalizerTypeToStr(Value: Integer): WideString;
function StationToStr(Value: Integer): WideString;
procedure raiseOposFptrRecEmpty;
procedure raiseOposFptrJrnEmpty;
......@@ -48,7 +48,7 @@ begin
raiseExtendedError(OPOS_EFPTR_COVER_OPEN, _('Cover is opened'));
end;
function OposFptrGetErrorText(Driver: OleVariant): string;
function OposFptrGetErrorText(Driver: OleVariant): WideString;
begin
if Driver.ResultCode = OPOS_E_EXTENDED then
Result := Tnt_WideFormat('%s %s', [
......@@ -64,7 +64,7 @@ begin
raise Exception.Create(OposFptrGetErrorText(Driver));
end;
function GetFptrPropertyName(const ID: Integer): string;
function GetFptrPropertyName(const ID: Integer): WideString;
begin
case ID of
// fiscal printer
......@@ -181,7 +181,7 @@ end;
// hh hour (0-23)
// mm minutes (0-59)
function DecodeOposDate(const Date: string): TOposDate;
function DecodeOposDate(const Date: WideString): TOposDate;
begin
Result.Day := StrToInt(Copy(Date, 1, 2));
Result.Month := StrToInt(Copy(Date, 3, 2));
......@@ -205,13 +205,13 @@ begin
raiseExtendedError(OPOS_EFPTR_BAD_DATE, _('Invalid minutes'));
end;
function EncodeOposDate(const Date: TOposDate): string;
function EncodeOposDate(const Date: TOposDate): WideString;
begin
Result := Tnt_WideFormat('%.2d%.2d%.4d%.2d%.2d',[
Date.Day, Date.Month, Date.Year, Date.Hour, Date.Min]);
end;
function GetResultCodeExtendedText(Value: Integer): string;
function GetResultCodeExtendedText(Value: Integer): WideString;
begin
case Value of
OPOS_EFPTR_COVER_OPEN : Result := 'OPOS_EFPTR_COVER_OPEN';
......@@ -243,7 +243,7 @@ begin
end;
end;
function PrinterStateTostr(Value: Integer): string;
function PrinterStateTostr(Value: Integer): WideString;
begin
case Value of
FPTR_PS_MONITOR : Result := 'FPTR_PS_MONITOR';
......@@ -261,7 +261,7 @@ begin
end;
end;
function GetStatusUpdateEventText(Value: Integer): string;
function GetStatusUpdateEventText(Value: Integer): WideString;
begin
case Value of
// fptr
......@@ -288,7 +288,7 @@ begin
end;
end;
function ActualCurrencyToStr(Value: Integer): string;
function ActualCurrencyToStr(Value: Integer): WideString;
begin
case Value of
FPTR_AC_BRC: Result := 'FPTR_AC_BRC';
......@@ -309,7 +309,7 @@ begin
end;
end;
function ContractorIdToStr(Value: Integer): string;
function ContractorIdToStr(Value: Integer): WideString;
begin
case Value of
FPTR_CID_FIRST: Result := 'FPTR_CID_FIRST';
......@@ -320,7 +320,7 @@ begin
end;
end;
function CountryCodeToStr(Value: Integer): string;
function CountryCodeToStr(Value: Integer): WideString;
begin
case Value of
FPTR_CC_BRAZIL: Result := 'FPTR_CC_BRAZIL';
......@@ -340,7 +340,7 @@ begin
end;
end;
function DateTypeToStr(Value: Integer): string;
function DateTypeToStr(Value: Integer): WideString;
begin
case Value of
FPTR_DT_CONF: Result := 'FPTR_DT_CONF';
......@@ -354,7 +354,7 @@ begin
end;
end;
function ErrorLevelToStr(Value: Integer): string;
function ErrorLevelToStr(Value: Integer): WideString;
begin
case Value of
FPTR_EL_NONE: Result := 'FPTR_EL_NONE';
......@@ -366,7 +366,7 @@ begin
end;
end;
function FiscalReceiptTypeToStr(Value: Integer): string;
function FiscalReceiptTypeToStr(Value: Integer): WideString;
begin
case Value of
FPTR_RT_CASH_IN: Result := 'FPTR_RT_CASH_IN';
......@@ -381,7 +381,7 @@ begin
end;
end;
function MessageTypeToStr(Value: Integer): string;
function MessageTypeToStr(Value: Integer): WideString;
begin
case Value of
FPTR_MT_ADVANCE: Result := 'FPTR_MT_ADVANCE';
......@@ -439,7 +439,7 @@ begin
end;
end;
function TotalizerTypeToStr(Value: Integer): string;
function TotalizerTypeToStr(Value: Integer): WideString;
begin
case Value of
FPTR_TT_DOCUMENT: Result := 'FPTR_TT_DOCUMENT';
......@@ -451,7 +451,7 @@ begin
end;
end;
function StationToStr(Value: Integer): string;
function StationToStr(Value: Integer): WideString;
begin
case Value of
FPTR_S_JOURNAL: Result := 'FPTR_S_JOURNAL';
......
......@@ -6,7 +6,7 @@ uses
// VCL
Windows, Classes, SysUtils, IniFiles,
// Tnt
TntClasses,
TntClasses, TntIniFiles,
// This
StatisticItem, OposStat, MSXML, LogFile, FileUtils;
......@@ -493,11 +493,11 @@ procedure TOposStatistics.IniLoad(const DeviceName: string);
var
i: Integer;
ItemText: string;
IniFile: TIniFile;
IniFile: TTntIniFile;
Item: TStatisticItem;
begin
try
IniFile := TIniFile.Create(GetIniFileName);
IniFile := TTntIniFile.Create(GetIniFileName);
try
for i := 0 to Items.Count-1 do
begin
......@@ -522,11 +522,11 @@ end;
procedure TOposStatistics.IniSave(const DeviceName: string);
var
i: Integer;
IniFile: TIniFile;
IniFile: TTntIniFile;
Item: TStatisticItem;
begin
try
IniFile := TIniFile.Create(GetIniFileName);
IniFile := TTntIniFile.Create(GetIniFileName);
try
for i := 0 to Items.Count-1 do
begin
......
......@@ -19,17 +19,17 @@ type
Min: Integer;
end;
function GetErrorLocusText(Value: Integer): string;
function GetResultCodeText(Value: Integer): string;
function GetErrorResponseText(Value: Integer): string;
function PowerStateToStr(PowerState: Integer): string;
function GetCommonPropertyName(const ID: Integer): string;
function GetCommonStatusUpdateEventText(Value: Integer): string;
function GetOpenResultText(Value: Integer): string;
function BinaryConversionToStr(Value: Integer): string;
function StateToStr(Value: Integer): string;
function PowerReportingToStr(Value: Integer): string;
function PowerNotifyToStr(Value: Integer): string;
function GetErrorLocusText(Value: Integer): WideString;
function GetResultCodeText(Value: Integer): WideString;
function GetErrorResponseText(Value: Integer): WideString;
function PowerStateToStr(PowerState: Integer): WideString;
function GetCommonPropertyName(const ID: Integer): WideString;
function GetCommonStatusUpdateEventText(Value: Integer): WideString;
function GetOpenResultText(Value: Integer): WideString;
function BinaryConversionToStr(Value: Integer): WideString;
function StateToStr(Value: Integer): WideString;
function PowerReportingToStr(Value: Integer): WideString;
function PowerNotifyToStr(Value: Integer): WideString;
const
CRLF = #13#10;
......@@ -94,7 +94,7 @@ const
implementation
function GetCommonPropertyName(const ID: Integer): string;
function GetCommonPropertyName(const ID: Integer): WideString;
begin
case ID of
// common
......@@ -126,7 +126,7 @@ begin
end;
end;
function GetResultCodeText(Value: Integer): string;
function GetResultCodeText(Value: Integer): WideString;
begin
case Value of
OPOS_SUCCESS : Result := 'OPOS_SUCCESS';
......@@ -160,7 +160,7 @@ begin
end;
end;
function GetErrorLocusText(Value: Integer): string;
function GetErrorLocusText(Value: Integer): WideString;
begin
case Value of
OPOS_EL_OUTPUT : Result := 'OPOS_EL_OUTPUT';
......@@ -171,7 +171,7 @@ begin
end;
end;
function GetErrorResponseText(Value: Integer): string;
function GetErrorResponseText(Value: Integer): WideString;
begin
case Value of
OPOS_ER_RETRY : Result := 'OPOS_ER_RETRY';
......@@ -182,7 +182,7 @@ begin
end;
end;
function GetCommonStatusUpdateEventText(Value: Integer): string;
function GetCommonStatusUpdateEventText(Value: Integer): WideString;
begin
case Value of
// common
......@@ -202,7 +202,7 @@ begin
end;
end;
function PowerStateToStr(PowerState: Integer): string;
function PowerStateToStr(PowerState: Integer): WideString;
begin
case PowerState of
OPOS_PS_UNKNOWN : Result := 'OPOS_PS_UNKNOWN';
......@@ -215,7 +215,7 @@ begin
end;
end;
function GetOpenResultText(Value: Integer): string;
function GetOpenResultText(Value: Integer): WideString;
begin
case Value of
OPOS_OR_ALREADYOPEN : Result := S_OPOS_OR_ALREADYOPEN;
......@@ -234,7 +234,7 @@ begin
end;
end;
function BinaryConversionToStr(Value: Integer): string;
function BinaryConversionToStr(Value: Integer): WideString;
begin
case Value of
0: Result := 'OPOS_BC_NONE';
......@@ -245,7 +245,7 @@ begin
end;
end;
function StateToStr(Value: Integer): string;
function StateToStr(Value: Integer): WideString;
begin
case Value of
OPOS_S_CLOSED: Result := 'OPOS_S_CLOSED';
......@@ -257,7 +257,7 @@ begin
end;
end;
function PowerReportingToStr(Value: Integer): string;
function PowerReportingToStr(Value: Integer): WideString;
begin
case Value of
OPOS_PR_NONE: Result := 'OPOS_PR_NONE';
......@@ -268,7 +268,7 @@ begin
end;
end;
function PowerNotifyToStr(Value: Integer): string;
function PowerNotifyToStr(Value: Integer): WideString;
begin
case Value of
OPOS_PN_DISABLED: Result := 'OPOS_PN_DISABLED';
......
......@@ -8,16 +8,17 @@ uses
// Tnt
TntSysUtils,
// This
Opos, PrinterEncoding, PrinterParameters, PrinterParametersX, DirectIOAPI,
Opos, OposFptrUtils,
PrinterEncoding, PrinterParameters, PrinterParametersX, DirectIOAPI,
OposFiscalPrinter_1_12_Lib_TLB, OposFiscalPrinter_1_13_Lib_TLB, StringUtils,
LogFile;
LogFile, WException;
type
{ TBarcodeRec }
TBarcodeRec = record
Data: string; // barcode data
Text: string; // barcode text
Data: WideString; // barcode data
Text: WideString; // barcode text
Height: Integer;
BarcodeType: Integer;
ModuleWidth: Integer;
......@@ -274,19 +275,19 @@ type
function SetBoolParameter(ParamID: Integer; Value: Boolean): Integer;
function SetParameter(ParamID: Integer; const Value: WideString): Integer; overload;
function SetParameter(ParamID: Integer; const Value: Integer): Integer; overload;
procedure PrintImage(const FileName: string);
procedure PrintImageScale(const FileName: string; Scale: Integer);
procedure PrintBarcode(const Data: string; BarcodeType: Integer);
procedure PrintImage(const FileName: WideString);
procedure PrintImageScale(const FileName: WideString; Scale: Integer);
procedure PrintBarcode(const Data: WideString; BarcodeType: Integer);
function PrintBarcode2(const Barcode: TBarcodeRec): Integer;
function PrintBarcodeHex(const Barcode: TBarcodeRec): Integer;
function PrintBarcodeHex2(const Barcode: TBarcodeRec): Integer;
function SetAdjustmentAmount(Amount: Integer): Integer;
function FSReadTicketHex(Number: Integer; var Ticket: string): Integer;
function FSReadTicketStr(Number: Integer; var Ticket: string): Integer;
function WriteFPParameter(ParamId: Integer; const Value: string): Integer;
function FSReadTicketHex(Number: Integer; var Ticket: WideString): Integer;
function FSReadTicketStr(Number: Integer; var Ticket: WideString): Integer;
function WriteFPParameter(ParamId: Integer; const Value: WideString): Integer;
function PrintFSDocument(Number: Integer): Integer;
function ReadFSDocument(Number: Integer; var S: string): Integer;
function CheckItemBarcode(const Barcode: string): Integer;
function ReadFSDocument(Number: Integer; var S: WideString): Integer;
function CheckItemBarcode(const Barcode: WideString): Integer;
property OpenResult: Integer read Get_OpenResult;
property BinaryConversion: Integer read Get_BinaryConversion write Set_BinaryConversion;
......@@ -447,7 +448,7 @@ type
Quantity: Integer; VatInfo: Integer; UnitAmount: Currency;
const UnitName: WideString): Integer; safecall;
public
function LoadLogo(const FileName: string): Integer; safecall;
function LoadLogo(const FileName: WideString): Integer; safecall;
function PrintLogo: Integer; safecall;
function PrintSeparator(Height: Integer): Integer; overload; safecall;
function PrintSeparator(Height, SeparatorType: Integer): Integer; overload; safecall;
......@@ -458,8 +459,8 @@ type
function ReadCashRegister(RegisterNumber: Integer): Int64;
procedure DisableNextHeader;
function FSWriteTLV(const Data: string): Integer;
function FSWriteTag(TagID: Integer; const Data: string): Integer;
function FSWriteTLV(const Data: WideString): Integer;
function FSWriteTag(TagID: Integer; const Data: WideString): Integer;
function WriteCustomerAddress(const Address: WideString): Integer;
function PrintText(const Text: WideString; Font: Integer): Integer;
function ReadTable(Table, Row, Field: Integer; var Value: WideString): Integer;
......@@ -470,27 +471,27 @@ type
{ FiscalPrinterError }
FiscalPrinterError = class(Exception);
FiscalPrinterError = class(WideException);
implementation
function BoolToStr(Value: Boolean): string;
function BoolToStr(Value: Boolean): WideString;
begin
if Value then Result := '1'
else Result := '0';
end;
function StrToBool(const Value: string): Boolean;
function StrToBool(const Value: WideString): Boolean;
begin
Result := Value <> '0';
end;
///////////////////////////////////////////////////////////////////////////////
//
// Wrapper class to encode - decode strings and to implement DirectIO features
// Wrapper class to encode - decode WideStrings and to implement DirectIO features
//
// Appliication -> Encode strings -> Driver
// Appliication <- Decode strings <- Driver
// Appliication -> Encode WideStrings -> Driver
// Appliication <- Decode WideStrings <- Driver
//
///////////////////////////////////////////////////////////////////////////////
......@@ -1827,7 +1828,7 @@ begin
Result := Driver.DirectIO(DIO_PRINT_SEPARATOR, pData, pString)
end;
function TSMFiscalPrinter.LoadLogo(const FileName: string): Integer;
function TSMFiscalPrinter.LoadLogo(const FileName: WideString): Integer;
var
pData: Integer;
pString: WideString;
......@@ -1850,14 +1851,16 @@ end;
procedure TSMFiscalPrinter.Check(AResultCode: Integer);
begin
if AResultCode <> OPOS_SUCCESS then
raise FiscalPrinterError.Create('');
begin
raise FiscalPrinterError.Create(OposFptrGetErrorText(Driver.OleObject));