2013-04-02 02:43 UTC+0200 Viktor Szakats (harbour syenar.net)
* src/rtl/hbi18n2.prg
! __i18n_potArrayClean() to evaluate transformation
codeblock in normal order (was reverse)
* tests/lang2po.hb
+ made all necessary modification to allow two-way conversion
+ tests/po2lang.hb
+ added script that converts a core .po back to a lang module
* src/rtl/strc.c
* casing in comments
* config/lang.hb
+ added std script options
This commit is contained in:
@@ -344,8 +344,7 @@ FUNCTION __i18n_potArrayClean( aTrans, lKeepSource, lKeepVoidTranslations, bTran
|
||||
hb_default( @lKeepSource, .T. )
|
||||
hb_default( @lKeepVoidTranslations, .T. )
|
||||
|
||||
FOR EACH item IN aTrans DESCEND
|
||||
|
||||
FOR EACH item IN aTrans
|
||||
IF HB_ISEVALITEM( bTransformTranslation )
|
||||
FOR EACH cString IN item[ _I18N_MSGSTR ]
|
||||
tmp := Eval( bTransformTranslation, cString, item[ _I18N_MSGID, cString:__enumIndex() ] )
|
||||
@@ -354,8 +353,13 @@ FUNCTION __i18n_potArrayClean( aTrans, lKeepSource, lKeepVoidTranslations, bTran
|
||||
ENDIF
|
||||
NEXT
|
||||
ENDIF
|
||||
IF ! lKeepSource
|
||||
item[ _I18N_SOURCE ] := ""
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
IF ! lKeepVoidTranslations
|
||||
IF ! lKeepVoidTranslations
|
||||
FOR EACH item IN aTrans DESCEND
|
||||
lVoid := .T.
|
||||
FOR EACH cString IN item[ _I18N_MSGSTR ]
|
||||
IF ! Empty( cString ) .AND. !( cString == item[ _I18N_MSGID, cString:__enumIndex() ] )
|
||||
@@ -367,12 +371,8 @@ FUNCTION __i18n_potArrayClean( aTrans, lKeepSource, lKeepVoidTranslations, bTran
|
||||
hb_ADel( aTrans, item:__enumIndex(), .T. )
|
||||
LOOP
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
IF ! lKeepSource
|
||||
item[ _I18N_SOURCE ] := ""
|
||||
ENDIF
|
||||
NEXT
|
||||
NEXT
|
||||
ENDIF
|
||||
|
||||
RETURN aTrans
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
#include "hbapiitm.h"
|
||||
#include "hbapierr.h"
|
||||
|
||||
/* HB_STRDECODESCAPE( <cEscSeqStr> ) -> <cStr>
|
||||
/* hb_StrDecodEscape( <cEscSeqStr> ) -> <cStr>
|
||||
* decode string with \ escape sequences
|
||||
*/
|
||||
HB_FUNC( HB_STRDECODESCAPE )
|
||||
@@ -75,7 +75,7 @@ HB_FUNC( HB_STRDECODESCAPE )
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 1099, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
/* HB_STRCDECODE( <cStr> [, @<lCont> ] ) -> <cResult> | NIL
|
||||
/* hb_StrCDecode( <cStr> [, @<lCont> ] ) -> <cResult> | NIL
|
||||
* decode string using C compiler rules
|
||||
* if second parameter <lCont> is passed by reference then it allows
|
||||
* to decode multiline strings. In such case <lCont> is set to .T.
|
||||
|
||||
Reference in New Issue
Block a user