# HG changeset patch # User Wuzzy # Date 1540478640 -7200 # Node ID a04c86dc685f20c84bee81ca81f502852817f753 # Parent c409af570f879fae909db8743bea3ccc65b8e7e7 Allow duplicate placeholders in engine strings diff -r c409af570f87 -r a04c86dc685f hedgewars/uLocale.pas --- a/hedgewars/uLocale.pas Thu Oct 25 17:02:56 2018 +0300 +++ b/hedgewars/uLocale.pas Thu Oct 25 16:44:00 2018 +0200 @@ -159,14 +159,14 @@ 8: curArg:= arg9; end; + repeat p:= Pos('%'+IntToStr(i+1), tempstr); - if (p = 0) then - break - else + if (p <> 0) then begin delete(tempstr, p, 2); insert(curArg, tempstr, p); end; + until (p = 0); end; Format:= tempstr; end; @@ -191,14 +191,14 @@ 8: curArg:= arg9; end; + repeat p:= Pos('%'+IntToStr(i+1), tempstr); - if (p = 0) then - break - else + if (p <> 0) then begin delete(tempstr, p, 2); insert(curArg, tempstr, p); end; + until (p = 0); end; FormatA:= tempstr; end; diff -r c409af570f87 -r a04c86dc685f tools/check_engine_locale_files.sh --- a/tools/check_engine_locale_files.sh Thu Oct 25 17:02:56 2018 +0300 +++ b/tools/check_engine_locale_files.sh Thu Oct 25 16:44:00 2018 +0200 @@ -88,18 +88,6 @@ MISSING_STRINGS=0; HAS_PROBLEMS=0; - # Find duplicate placeholders - for i in 0 1 2 3 4 5 6 7 8 9 - do - grep -G "%$i.*%$i" $CHECKED_LANG_FILE > $TEMP_CHECK; - if [ -s $TEMP_CHECK ] - then - echo "ERROR! Duplicate placeholders found:"; - cat $TEMP_CHECK; - HAS_PROBLEMS=1; - fi - done; - if [ $CHECKED_LANG_FILE != en.txt ] then grep -o "^[0-9][0-9]:[0-9][0-9]=" $CHECKED_LANG_FILE | cut -c1-5 | sort | uniq > $TEMP_SYMBOLS;