When using Text Flow lucene indexes, a database query needs to be used to filter out untranslated results. An updatable cache needs to be added so that this query is run the least possible number of times. This is an expensive query as it probably scans the whole table.
Added a Translation Memory helper component that caches the translated text flow ids for each locale. This cache is updated every time a translation occurs. Testing Notes: Test scenarios where a text flow target changes to all states (fuzzy, approved, not translated). See: https://github.com/zanata/zanata/commit/e937a9120ed977904995c56f898c62b47b6ed89b https://github.com/zanata/zanata/commit/4b868b54b444fa2e2cf158f367ceddf0f8530cbd https://github.com/zanata/zanata/commit/2fda4c7823a16b1a5e1b8c0effa7accd2ba193b8
Revised list of commits: https://github.com/zanata/zanata/commit/d9c8535efab3f7009d0ef1e8ec6a4d38c0d81971 https://github.com/zanata/zanata/commit/59aecbf3c642b60ff33fcf4f500aa1530b9c2f87 https://github.com/zanata/zanata/commit/ba8806fae0bd53df36a84fdb03b0408646c1bda8 https://github.com/zanata/zanata/commit/9df744785f3b15072d6fd0f4369e24ea63698d83
VERIFIED with Zanata version 2.1-SNAPSHOT (20121206-1113)