diff --git a/harbour/ChangeLog b/harbour/ChangeLog index ee696c0554..ff36048213 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,14 @@ past entries belonging to these authors: Viktor Szakats. */ +2009-05-06 20:40 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/utils/hbi18n/hbi18n.prg + % added support for optional reusing hIndex table in repeated calls + to __I18N_potArrayJoin() with the same aTrans array. + + * harbour/source/rtl/hbi18n2.prg + % reuse hIndex table in repeated calls to __I18N_potArrayJoin() + 2009-05-06 20:14 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * utils/hbmk2/hbmk2.prg * utils/hbmk2/hbmk2.hu_HU.po diff --git a/harbour/source/rtl/hbi18n2.prg b/harbour/source/rtl/hbi18n2.prg index f09f8c7705..da7554e090 100644 --- a/harbour/source/rtl/hbi18n2.prg +++ b/harbour/source/rtl/hbi18n2.prg @@ -448,16 +448,17 @@ FUNCTION __I18N_HASHJOIN( hTrans, hTrans2 ) RETURN hTrans -FUNCTION __I18N_POTARRAYJOIN( aTrans, aTrans2 ) +FUNCTION __I18N_POTARRAYJOIN( aTrans, aTrans2, hIndex ) LOCAL aItem, aDest, aSrc - LOCAL hIndex LOCAL ctx - hIndex := { => } - FOR EACH aItem in aTrans - ctx := aItem[ _I18N_CONTEXT ] + _I18N_DELIM + aItem[ _I18N_MSGID, 1 ] - hIndex[ ctx ] := aItem:__enumIndex() - NEXT + IF !HB_ISHASH( hIndex ) + hIndex := { => } + FOR EACH aItem in aTrans + ctx := aItem[ _I18N_CONTEXT ] + _I18N_DELIM + aItem[ _I18N_MSGID, 1 ] + hIndex[ ctx ] := aItem:__enumIndex() + NEXT + ENDIF FOR EACH aItem in aTrans2 ctx := aItem[ _I18N_CONTEXT ] + _I18N_DELIM + aItem[ _I18N_MSGID, 1 ] diff --git a/harbour/utils/hbi18n/hbi18n.prg b/harbour/utils/hbi18n/hbi18n.prg index 7eec9c42b2..9dbd08bf49 100644 --- a/harbour/utils/hbi18n/hbi18n.prg +++ b/harbour/utils/hbi18n/hbi18n.prg @@ -243,6 +243,7 @@ STATIC FUNCTION ExpandWildCards( aFiles ) STATIC FUNCTION LoadFiles( aFiles ) LOCAL aTrans, aTrans2 + LOCAL hIndex LOCAL cErrorMsg LOCAL n @@ -255,7 +256,7 @@ STATIC FUNCTION LoadFiles( aFiles ) IF aTrans2 == NIL ErrorMsg( cErrorMsg ) ENDIF - __I18N_potArrayJoin( aTrans, aTrans2 ) + __I18N_potArrayJoin( aTrans, aTrans2, @hIndex ) NEXT RETURN aTrans