From c57aef04fcfb1dfecb5eb32dbad4cacde0232806 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 1 Apr 2013 13:37:33 +0200 Subject: [PATCH] 2013-04-01 13:36 UTC+0200 Viktor Szakats (harbour syenar.net) * .gitignore + added .hrb files * src/rtl/hbi18n2.prg * __i18n_potArrayClean() reverted to call transformation callback after deleting items --- .gitignore | 1 + ChangeLog.txt | 12 ++++++++++-- src/rtl/hbi18n2.prg | 26 +++++++++++++------------- 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 7f9548e364..727127c474 100755 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ obj *.hbl *.hbd *.hbr +*.hrb # 'install'-ed binaries *.exe diff --git a/ChangeLog.txt b/ChangeLog.txt index 386ce743cf..b436bca5a0 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -10,6 +10,14 @@ * Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment */ +2013-04-01 13:36 UTC+0200 Viktor Szakats (harbour syenar.net) + * .gitignore + + added .hrb files + + * src/rtl/hbi18n2.prg + * __i18n_potArrayClean() reverted to call transformation callback + after deleting items + 2013-04-01 05:35 UTC+0200 Viktor Szakats (harbour syenar.net) * utils/hbmk2/lang.hb + more automatic doctoring of translated strings @@ -36,8 +44,8 @@ ! __i18n_potArraySort() fixed to not RTE when no source is present + __i18n_potArraySort() tweaked to sort items w/o source info to always come before ones with source info - + __i18n_potArrayClean() wlll now call transformation callback before - deleting items + + __i18n_potArrayClean() will now call transformation callback before + deleting items [REVERTED] + __i18n_potArrayClean() will now remove the item in question if the callback returns any non-string value + __i18n_potArrayClean()'s second lKeepVoidTranslations = .F. option will diff --git a/src/rtl/hbi18n2.prg b/src/rtl/hbi18n2.prg index f6f4150e7c..cdfa03e04c 100644 --- a/src/rtl/hbi18n2.prg +++ b/src/rtl/hbi18n2.prg @@ -345,6 +345,19 @@ FUNCTION __i18n_potArrayClean( aTrans, lKeepSource, lKeepVoidTranslations, bTran hb_default( @lKeepVoidTranslations, .T. ) FOR EACH item IN aTrans DESCEND + IF ! lKeepVoidTranslations + lVoid := .T. + FOR EACH cString IN item[ _I18N_MSGSTR ] + IF ! Empty( cString ) .AND. !( cString == item[ _I18N_MSGID, cString:__enumIndex() ] ) + lVoid := .F. + EXIT + ENDIF + NEXT + IF lVoid + hb_ADel( aTrans, item:__enumIndex(), .T. ) + LOOP + ENDIF + ENDIF IF HB_ISEVALITEM( bTransformTranslation ) lDelete := .F. FOR EACH cString IN item[ _I18N_MSGSTR ] @@ -359,19 +372,6 @@ FUNCTION __i18n_potArrayClean( aTrans, lKeepSource, lKeepVoidTranslations, bTran LOOP ENDIF ENDIF - IF ! lKeepVoidTranslations - lVoid := .T. - FOR EACH cString IN item[ _I18N_MSGSTR ] - IF ! Empty( cString ) .AND. !( cString == item[ _I18N_MSGID, cString:__enumIndex() ] ) - lVoid := .F. - EXIT - ENDIF - NEXT - IF lVoid - hb_ADel( aTrans, item:__enumIndex(), .T. ) - LOOP - ENDIF - ENDIF IF ! lKeepSource item[ _I18N_SOURCE ] := "" ENDIF