Bug 12221 - Remove TT statement placeholders from translatable strings
Summary: Remove TT statement placeholders from translatable strings
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: I18N/L10N (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: paxed
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-09 05:25 UTC by paxed
Modified: 2017-04-03 06:09 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Remove TT statement placeholders from translatable strings (3.41 KB, patch)
2014-05-09 05:32 UTC, paxed
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description paxed 2014-05-09 05:25:28 UTC
The translation message catalogs contain a lot of Template Toolkit
statements in the messages. They bloat the message lengths, and
add unnecessary complications for translators, making errors
far more likely.
    
For example, there's no need to have "INCLUDE 'opac-bottom.inc'"
show up as a placeholder in the messages.

Using the following incantation:
grep -E '^#\. %[0-9]+\$s: ' po/xx-YY-*.po | cut -d':' -f 3- | sed -e 's/^ *\(IF\|ELSIF\|CASE\|SWITCH\|INCLUDE\|USE\|SET\|PROCESS\|BLOCK\|FOREACH\|UNLESS\) *.*$/  \1 /g' | sort | uniq -c | sort -rn

we get a list of all placeholders, sorted by # of uses. The top-5 is:

       1750   END
       1429   IF
        647   ELSE
        263   ELSIF
        252   INCLUDE
Comment 1 paxed 2014-05-09 05:32:04 UTC
Created attachment 28122 [details] [review]
Remove TT statement placeholders from translatable strings

The translation message catalogs contain a lot of Template Toolkit
statements in the messages. They bloat the message lengths, and
add unnecessary complications for translators, making errors
far more likely.

For example, there's no need to have "INCLUDE 'opac-bottom.inc'"
show up as a placeholder in the messages.

Before this patch, the top 5 placeholders in the catalogs are:
   1750   END
   1429   IF
    647   ELSE
    263   ELSIF
    252   INCLUDE

After this patch, the placeholders are only variables.
The top 5 is:
     32   total
     22   searchfield
     20   bibliotitle
     19   surname
     19   OPACBaseURL

Use the following incantation to get the stats:
 grep -E '^#\. %[0-9]+\$s: ' po/xx-YY-*.po | cut -d':' -f 3- | sed -e 's/^ *\(IF\|ELSIF\|CASE\|SWITCH\|INCLUDE\|USE\|SET\|PROCESS\|BLOCK\|FOREACH\|UNLESS\) *.*$/  \1 /g' | sort | uniq -c | sort -rn

The number of separate msgid's does not change very much:
19430 before the patch, 19995 afterwards.
Comment 2 paxed 2014-05-09 05:33:12 UTC
Yes, I know, this needs a test plan. Suggestions on what and how to test would be appreciated.