Changeset b4f3d961


Ignore:
Timestamp:
Mar 14, 2018 11:38:00 AM (2 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
030beac
Parents:
a077245
Message:

SusDNS: Translate svg image text (ticket #1749)

Location:
apps/susidns/src
Files:
1 added
5 edited
1 moved

Legend:

Unmodified
Added
Removed
  • apps/susidns/src/WEB-INF/web-template.xml

    ra077245 rb4f3d961  
    2323        </init-param>
    2424        <load-on-startup>1</load-on-startup>
     25    </servlet>
     26
     27    <servlet>
     28      <servlet-name>i2p.susi.dns.TranslateSVGServlet</servlet-name>
     29      <servlet-class>i2p.susi.dns.TranslateSVGServlet</servlet-class>
    2530    </servlet>
    2631
     
    6469    </servlet-mapping>
    6570
     71    <servlet-mapping>
     72      <servlet-name>i2p.susi.dns.TranslateSVGServlet</servlet-name>
     73      <url-pattern>/images/*</url-pattern>
     74    </servlet-mapping>
     75
    6676    <session-config>
    6777        <session-timeout>
  • apps/susidns/src/build.xml

    ra077245 rb4f3d961  
    107107                <fileset dir=".">
    108108                        <include name="WEB-INF/**/*.class"/>
    109                      <!-- pulled out of the jar in 0.7.12
    110                         <include name="WEB-INF/lib/*.jar"/>
    111                       -->
    112                         <include name="images/*.png"/>
    113                         <include name="css.css"/>
    114109                        <include name="index.html"/>
    115                         <include name="WEB-INF/classes/${project}.properties"/>
     110                        <include name="svg/*"/>
    116111                </fileset>
    117112            <manifest>
     
    129124    <target name="warUpToDate">
    130125        <uptodate property="war.uptodate" targetfile="${project}.war">
    131             <srcfiles dir= "." includes="WEB-INF/web-out.xml WEB-INF/**/*.class images/*.png css.css index.html WEB-INF/classes/${project}.properties" />
     126            <srcfiles dir= "." includes="WEB-INF/web-out.xml WEB-INF/**/*.class svg/* index.html" />
    132127        </uptodate>
    133128        <condition property="shouldListChanges" >
     
    163158    </target>
    164159
    165     <target name="poupdate" depends="compile, precompilejsp">
     160    <target name="extractSVGTags">
     161        <mkdir dir="build/" />
     162        <java classname="net.i2p.util.TranslateReader" fork="true" failonerror="true">
     163            <classpath>
     164                <pathelement location="../../../build/i2p.jar" />
     165            </classpath>
     166            <arg value="tag" />
     167            <arg value="svg/" />
     168            <arg value="build/HowSVG.java" />
     169        </java>
     170    </target>
     171
     172    <target name="poupdate" depends="compile, precompilejsp, extractSVGTags">
    166173        <!-- Update the messages_*.po files.  -->
    167174        <!-- set if unset -->
  • apps/susidns/src/bundle-messages.sh

    ra077245 rb4f3d961  
    3333# set LG2 to the language you need in environment variables to enable this
    3434
     35#
     36# generated build/SVG.java from svg/how.svg
     37#
     38SVGFILE=build/HowSVG.java
     39
    3540# add ../src/ so the refs will work in the po file
    36 JPATHS="../src/java/ ../src/tmp/"
     41JPATHS="../src/java/ ../src/tmp/ $SVGFILE"
    3742for i in ../locale/messages_*.po
    3843do
     
    6469                # extract strings from java and jsp files, and update messages.po files
    6570                # translate calls must be one of the forms:
     71                # _("foo")
    6672                # _t("foo")
    6773                # _x("foo")
     
    7278                find $JPATHS -name *.java > $TMPFILE
    7379                xgettext -f $TMPFILE -F -L java --from-code=UTF-8 --add-comments\
    74                          --keyword=_t --keyword=_x --keyword=intl._ --keyword=intl.title \
     80                         --keyword=_ --keyword=_t --keyword=_x --keyword=intl._ --keyword=intl.title \
    7581                         -o ${i}t
    7682                if [ $? -ne 0 ]
  • apps/susidns/src/java/src/i2p/susi/dns/Messages.java

    ra077245 rb4f3d961  
    99 */
    1010public class Messages {
    11     private static final String BUNDLE_NAME = "i2p.susi.dns.messages";
     11    static final String BUNDLE_NAME = "i2p.susi.dns.messages";
    1212    private final I2PAppContext _context;
    1313
  • apps/susidns/src/jsp/index.jsp

    ra077245 rb4f3d961  
    8989</p>
    9090<div class="illustrate">
    91 <object type="image/svg+xml" data="/themes/susidns/images/how.svg">
     91<object type="image/svg+xml" data="images/how.svg">
    9292<img src="/themes/susidns/images/how.png" border="0" alt="address book working scheme" title="How the address book works" class="illustrate" />
    9393</object>
  • apps/susidns/src/svg/how.svg

    ra077245 rb4f3d961  
     1<?xml version="1.0" encoding="utf-8"?>
    12<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 960 587">
    23  <style>
     
    2122  <rect class="privatezone" width="308" height="137" x="29" y="192" ry="10"/>
    2223  <a xlink:href="/susidns/addressbook?book=published" target="_parent" class="book">
    23     <title>If SusiDNS is configured to publish your Router address book, the entries will appear in your Published address book and saved to a hosts.txt file for sharing.</title>
     24    <title>_("If SusiDNS is configured to publish your Router address book, the entries will appear in your Published address book and saved to a hosts.txt file for sharing.")</title>
    2425    <rect class="a tooltip" width="428" height="66" x="264" y="491" ry="10">
    2526    </rect>
    2627    <text class="b" x="477" y="531">
    27       <tspan class="c" x="477" y="531">PUBLISHED ADDRESSBOOK</tspan>
     28      <tspan class="c" x="477" y="531">_("Published Addressbook")</tspan>
    2829    </text>
    2930  </a>
    3031  <path class="a tooltip" d="M468 418v7h19v-7zm0 16v6h19v-6zm0 15v6h19v-6zm0 15v6h-8l9 12 9 12 9-12 9-12h-8v-6z">
    31     <title>To configure SusiDNS to push your Router address book to your Published address book, set "should_publish=true" on the configuration page.</title>
     32    <title>_("To configure SusiDNS to push your Router address book to your Published address book, set 'should_publish=true' on the configuration page.")</title>
    3233  </path>
    3334  <a xlink:href="/susidns/addressbook?book=router" target="_parent" class="book">
    34     <title>All hosts derived from subscriptions will appear in this address book, in addition to any you manually add here or to your Master address book.</title>
     35    <title>_("All hosts derived from subscriptions will appear in this address book, in addition to any you manually add here or to your Master address book.")</title>
    3536    <rect class="a tooltip" width="428" height="66" x="264" y="362" ry="10">
    3637    </rect>
    3738    <text class="b" x="477" y="403">
    38       <tspan class="c" x="477" y="403">ROUTER ADDRESSBOOK</tspan>
     39      <tspan class="c" x="477" y="403">_("Router Addressbook")</tspan>
    3940    </text>
    4041  </a>
    4142  <a xlink:href="/susidns/addressbook?book=private" target="_parent" class="pbook">
    42     <title>Hosts you manually add here will never be published. You can also add aliases to hosts in other address books here.</title>
     43    <title>_("Hosts you manually add here will never be published. You can also add aliases to hosts in other address books here.")</title>
    4344    <rect class="a private" width="279" height="66" x="44" y="228" ry="10">
    4445    </rect>
    4546    <text class="b" x="182" y="268">
    46       <tspan class="c" x="182" y="268">PRIVATE ADDRESSBOOK</tspan>
     47      <tspan class="c" x="182" y="268">_("Private Addressbook")</tspan>
    4748    </text>
    4849  </a>
    4950  <text class="d tooltip" x="243" y="51">
    50     <tspan class="e" x="243" y="51">LOCAL RECORDS</tspan>
    51     <title>I2P applications (including the HTTP proxy) use the hosts in your local address books to resolve .i2p hostnames.</title>
     51    <tspan class="e" x="243" y="51">_("Local Records")</tspan>
     52    <title>_("I2P applications (including the HTTP proxy) use the hosts in your local address books to resolve .i2p hostnames.")</title>
    5253  </text>
    5354  <a xlink:href="/help#addressbooksubs" target="_top">
    54     <title>Additional subscriptions can be found in the FAQ section of the Router help page.</title>
     55    <title>_("Additional subscriptions can be found in the FAQ section of the Router help page.")</title>
    5556    <text class="d" x="716" y="51">
    56       <tspan class="e" x="716" y="51">SUBSCRIPTIONS</tspan>
     57      <tspan class="e" x="716" y="51">_("Subscriptions")</tspan>
    5758    </text>
    5859  </a>
    5960  <g class="subscriptions hideonhover">
    6061  <a id="sublist" xlink:href="/susidns/subscriptions" target="_parent">
    61     <title>Hosts sourced from your subscriptions are added to your Router address book, and are automatically synced (by default every 12 hours).</title>
     62    <title>_("Hosts sourced from your subscriptions are added to your Router address book, and are automatically synced (by default every 12 hours).")</title>
    6263    <rect class="subs" width="419" height="66" x="506" y="230" ry="10"/>
    6364    <rect class="subs" width="419" height="66" x="506" y="204" ry="10"/>
     
    6869    <text class="b" x="715" y="132">
    6970      <tspan class="c" id="hoverhide" x="715" y="132">http://i2p-projekt.i2p/hosts.txt</tspan>
    70       <tspan class="c" id="hovershow" x="715" y="132">Configure Subscriptions</tspan>
     71      <tspan class="c" id="hovershow" x="715" y="132">_("Configure Subscriptions")</tspan>
    7172    </text>
    7273  </a>
    7374  </g>
    7475  <a xlink:href="/susidns/addressbook?book=master" target="_parent" class="book">
    75     <title>If you manually add hosts here, they will be included your Published address book (if configured).</title>
     76    <title>_("If you manually add hosts here, they will be included your Published address book (if configured).")</title>
    7677    <rect class="a tooltip" width="419" height="64" x="34" y="94" ry="10">
    7778    </rect>
    7879    <text class="b" x="243" y="134">
    79       <tspan class="c" x="243" y="134">MASTER ADDRESSBOOK</tspan>
     80      <tspan class="c" x="243" y="134">_("Master Addressbook")</tspan>
    8081    </text>
    8182  </a>
    8283  <text class="f tooltip" x="817" y="389">
    83     <tspan class="g" x="817" y="389">SEARCHABLE BY</tspan> <tspan class="g" x="817" y="416">I2P APPLICATIONS</tspan>
    84     <title>The Master, Router and Private address books collectively serve as the DNS authority for I2P applications.</title>
     84    <tspan class="g" x="817" y="389">_("Searchable by")</tspan> <tspan class="g" x="817" y="416">_("I2P applications")</tspan>
     85    <title>_("The Master, Router and Private address books collectively serve as the DNS authority for I2P applications.")</title>
    8586  </text>
    8687  <a xlink:href="/susidns/config" target="_parent">
    8788    <text class="f" x="817" y="518">
    88       <tspan class="g" x="817" y="518">OPTIONAL, FOR</tspan> <tspan class="g" x="817" y="545">EEPSITES</tspan>
    89       <title>If you configure SusiDNS to publish your Router address book, it will export a hosts.txt file containing all the hosts (by default to the root of your eepsite).</title>
     89      <tspan class="g" x="817" y="518">_("Optional,")</tspan> <tspan class="g" x="817" y="545">_("for websites")</tspan>
     90      <title>_("If you configure SusiDNS to publish your Router address book, it will export a hosts.txt file containing all the hosts (by default to the root of your eepsite).")</title>
    9091    </text>
    9192  </a>
    9293  <path class="a tooltip" d="M382 164v133h-21l22 31 22 31 23-31 22-31h-19V164h-49z">
    93     <title>Addresses manually added to your Master address book will merge with your Router address book.</title>
     94    <title>_("Addresses manually added to your Master address book will merge with your Router address book.")</title>
    9495  </path>
    9596  <path class="a tooltip" d="M553 164v133h-21l22 31 22 31 23-31 22-31h-19V164z">
    96     <title>Hosts you receive from your subscriptions will merge with your Router address book.</title>
     97    <title>_("Hosts you receive from your subscriptions will merge with your Router address book.")</title>
    9798  </path>
    9899</svg>
Note: See TracChangeset for help on using the changeset viewer.