+ bin/check.hb
+ new source verifier. Able to all documented (and more)
required text file and filename properties.
* bin/commit.hb
+ added feature to verify all files to be committed to
conform with certain naming and text file content rules
+ added some more feedback
* config/postinst.hb
+ include commit.hb and check.hb in 'install'
* include/extend.h
* contrib/hbcairo/paths.c
* contrib/hbcairo/png.c
* contrib/hbcairo/util.c
* contrib/hbtpathy/readme.txt
* tests/harbour.ini
* tests/parseins.ini
! multiple EOL at EOF
* contrib/hbhpdf/tests/files/cp932.txt
* contrib/hbhpdf/tests/files/cp936.txt
* contrib/hbhpdf/tests/files/elic_jp.txt
! line ending spaces
! missing EOL at EOF
* contrib/hbhttpd/tests/tpl/app/account/edit.tpl
* contrib/hbhttpd/tests/tpl/app/login.tpl
* contrib/hbhttpd/tests/tpl/app/logout.tpl
* contrib/hbhttpd/tests/tpl/app/main.tpl
* contrib/hbhttpd/tests/tpl/app/register.tpl
* lib/3rd/win/bcc/unicows_license.txt
* lib/3rd/win/mingw/libunicows_license.txt
! missing EOL at EOF
* COPYING.txt
* src/rtl/gtcrs/hb-charmap.def
* tests/big5_gen.prg
! tabs
* extras/gfspell/spell.prg
* src/rtl/gtwin/gtwin.c
! ASCII 127
* src/codepage/cp_tpl.c
! converted to UTF-8 (just guessing what the original CP was)
* src/pp/hbpp.c
! do not generate SVN header in hbverbld.h
+ avoid SVN header string in source as is to miss matched
in source verifier
* src/vm/extrap.c
! do not generate whitespace at EOL in output
* tests/lang2po.hb
* tests/po2lang.hb
+ minor improvements
! fixed to generate consistent EOL
* bin/3rdpatch.hb
* newline at top deleted
* extras/hbdoc/hbdoc.hbp
* extras/hbdoc/hbdoc.prg
* extras/hbdoc/_tmplates.prg -> extras/hbdoc/_tmplate.prg
* contrib/hbcairo/tests/lightning.prg -> contrib/hbcairo/tests/lightnin.prg
! long filename
* .gitattributes
* extras/guestbk/guestbk.prg
* extras/guestbk/guestbk.txt
* extras/guestbk/guestbk.htm -> extras/guestbk/guestbk.html
* deleted .htm file, now all HTML has extension .html
* .exe references in doc made OS neutral
; Can only be used on non-MS-DOS systems, so it's okay
109 lines
2.7 KiB
Plaintext
109 lines
2.7 KiB
Plaintext
|
|
#pragma -w3
|
|
#pragma -km+
|
|
#pragma -ko+
|
|
|
|
#include "hblang.ch"
|
|
|
|
PROCEDURE Main()
|
|
|
|
LOCAL cFileIn := "hu.po"
|
|
LOCAL cFileOut := "l_hu.c"
|
|
|
|
PO_2_C( cFileIn, cFileOut )
|
|
|
|
RETURN
|
|
|
|
STATIC FUNCTION PO_2_C( cFileIn, cFileOut, ... )
|
|
|
|
LOCAL aTrans
|
|
LOCAL cErrorMsg
|
|
|
|
LOCAL cContent
|
|
LOCAL cTranslator
|
|
LOCAL cID
|
|
LOCAL nPos
|
|
|
|
IF ( aTrans := __i18n_potArrayLoad( cFileIn, @cErrorMsg ) ) != NIL
|
|
|
|
cContent := StrTran( _begin(), e"\n", hb_eol() )
|
|
nPos := 0
|
|
|
|
__i18n_potArrayClean( aTrans,,, {| cTrs, cOri | ProcessTrs( @cContent, cTrs, cOri, @cTranslator, @cID, @nPos ) } )
|
|
|
|
cContent := "/* Last Translator: " + cTranslator + " */" + hb_eol() + ;
|
|
Left( cContent, Len( cContent ) - Len( "," ) - Len( hb_eol() ) ) + hb_eol() + ;
|
|
StrTran( StrTran( _end(), e"\n", hb_eol() ), "{LNG}", Upper( cID ) )
|
|
|
|
hb_MemoWrit( cFileOut, cContent )
|
|
|
|
RETURN .T.
|
|
ENDIF
|
|
|
|
? "i18n error", cErrorMsg
|
|
|
|
RETURN .F.
|
|
|
|
STATIC FUNCTION ProcessTrs( /* @ */ cContent, cTrs, cOri, /* @ */ cTranslator, /* @ */ cID, /* @ */ nPos )
|
|
|
|
LOCAL tmp, tmp1
|
|
|
|
SWITCH nPos
|
|
CASE HB_LANG_ITEM_BASE_ID ; tmp := "/* Identification */" ; EXIT
|
|
CASE HB_LANG_ITEM_BASE_MONTH ; tmp := "/* Month names */" ; EXIT
|
|
CASE HB_LANG_ITEM_BASE_DAY ; tmp := "/* Day names */" ; EXIT
|
|
CASE HB_LANG_ITEM_BASE_NATMSG ; tmp := "/* CA-Cl*pper compatible natmsg items */" ; EXIT
|
|
CASE HB_LANG_ITEM_BASE_ERRDESC ; tmp := "/* Error description names */" ; EXIT
|
|
CASE HB_LANG_ITEM_BASE_ERRINTR ; tmp := "/* Internal error names */" ; EXIT
|
|
CASE HB_LANG_ITEM_BASE_TEXT ; tmp := "/* Texts */" ; EXIT
|
|
OTHERWISE ; tmp := NIL
|
|
ENDSWITCH
|
|
|
|
IF tmp != NIL
|
|
cContent += iif( nPos > 0, hb_eol(), "" ) + Space( 6 ) + tmp + hb_eol() + hb_eol()
|
|
ENDIF
|
|
|
|
IF nPos == 0
|
|
cTranslator := hb_regexAll( "Last-Translator: ([^\n]*)", cTrs,,,,, .T. )[ 1 ][ 2 ]
|
|
IF cTranslator == "a b <a.b@c.d>"
|
|
cTranslator := ""
|
|
ENDIF
|
|
FOR tmp := 0 TO 5
|
|
cContent += Space( 6 ) + ConvToC( tmp1 := hb_regexAll( hb_StrFormat( "Harbour-Lang-Meta-%1$d: ([\S]*)", tmp ), cTrs,,,,, .T. )[ 1 ][ 2 ] ) + "," + hb_eol()
|
|
++nPos
|
|
IF tmp == 0
|
|
cID := tmp1
|
|
ENDIF
|
|
NEXT
|
|
ELSE
|
|
IF Len( cTrs ) == 0
|
|
cTrs := cOri
|
|
ENDIF
|
|
cContent += Space( 6 ) + ConvToC( cTrs ) + "," + hb_eol()
|
|
++nPos
|
|
ENDIF
|
|
|
|
RETURN NIL
|
|
|
|
STATIC FUNCTION ConvToC( cStr )
|
|
RETURN '"' + hb_StrReplace( cStr, { '"' => '\"' } ) + '"'
|
|
|
|
STATIC FUNCTION _begin()
|
|
#pragma __cstream | RETURN %s
|
|
|
|
#include "hbapilng.h"
|
|
|
|
static HB_LANG s_lang =
|
|
{
|
|
{
|
|
#pragma __endtext
|
|
|
|
STATIC FUNCTION _end()
|
|
#pragma __cstream | RETURN %s
|
|
}
|
|
};
|
|
|
|
#define HB_LANG_ID {LNG}
|
|
#include "hbmsgreg.h"
|
|
#pragma __endtext
|