Changeset ba5be74


Ignore:
Timestamp:
Jan 13, 2012 10:26:35 PM (9 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
50f270f
Parents:
4ad6d69
Message:

translation infrastructure for i2prouter script

Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • build.xml

    r4ad6d69 rba5be74  
    370370        <ant dir="apps/susimail/" target="poupdate" />
    371371        <ant dir="apps/desktopgui" target="poupdate" />
     372        <ant dir="installer/resources/locale" target="poupdate" />
     373    </target>
     374
     375    <target name="prep-script-translation" >
     376        <ant dir="installer/resources/locale" target="bundle" />
     377        <copy todir="pkg-temp/locale/">
     378            <fileset dir="installer/resources/locale/mo/" />
     379        </copy>
    372380    </target>
    373381
     
    519527        <ant dir="apps/i2psnark/java/" target="distclean" />
    520528        <ant dir="apps/jetty/" target="distclean" />
     529        <ant dir="installer/resources/locale" target="distclean" />
    521530        <!--
    522531                NOTE! We need to turn off the default excludes for these
     
    596605    </target>
    597606
    598     <target name="preppkg-unix" depends="preppkg-base">
     607    <target name="preppkg-unix" depends="preppkg-base, prep-script-translation" >
    599608        <copy file="installer/resources/runplain.sh" todir="pkg-temp/" />
    600609        <!-- <copy file="apps/i2psnark/launch-i2psnark" todir="pkg-temp/" /> old feature that per zzz isn't used-->
     
    878887    </target>
    879888
    880     <target name="prepupdate" depends="build2, prepupdateSmall, prepConsoleDocUpdates, prepCertificates">
     889    <!-- script translation added in 0.8.13, so don't need updates until .14, but put it in now so we don't forget -->
     890    <target name="prepupdate" depends="build2, prepupdateSmall, prepConsoleDocUpdates, prepCertificates, prep-script-translation">
    881891        <copy file="build/BOB.jar" todir="pkg-temp/lib/" />
    882892        <copy file="build/sam.jar" todir="pkg-temp/lib/" />
  • installer/install.xml

    r4ad6d69 rba5be74  
    189189            <executable targetfile="$INSTALL_PATH/installer/delete.jar" type="jar" stage="postinstall" keep="true" failure="warn"> <os family="windows" />
    190190                <args><arg value="$INSTALL_PATH/man" /></args></executable>
     191            <executable targetfile="$INSTALL_PATH/installer/delete.jar" type="jar" stage="postinstall" keep="true" failure="warn"> <os family="windows" />
     192                <args><arg value="$INSTALL_PATH/locale" /></args></executable>
    191193            <!-- Placeholder for an OSX 'shortcut' to the router console
    192194            <executable targetfile="$INSTALL_PATH/installer/delete.jar" type="jar" stage="postinstall" keep="true" failure="warn"> <os family="windows" />
  • installer/resources/i2prouter

    r4ad6d69 rba5be74  
    3939APP_LONG_NAME="I2P Service"
    4040
     41# gettext - todo find it in the path, default to /bin/false?
     42# fallback to echo is below, we can't set it to echo here.
     43GETTEXT=/usr/bin/gettext
     44
    4145# If specified, the Wrapper will be run as the specified user.
    4246# IMPORTANT - Make sure that the user has the required privileges to write
     
    462466
    463467gettext() {
    464     # TODO provide translations and call external gettext.
    465     # For now, don't attempt to translate via the wrapper,
     468    # Call external gettext using our own translation files.
     469    # Don't attempt to translate via the wrapper,
    466470    # it probably isn't supported in the community edition.
    467     #"$WRAPPER_CMD" --translate "$1" "$WRAPPER_CONF" 2>/dev/null
    468     #if [ $? != 0 ] ; then
     471    if [ "X${LANG#en}" = "X$LANG" ] ; then
     472        TEXTDOMAINDIR=$I2P/locale $GETTEXT -d i2prouter "$1"
     473        if [ $? != 0 ] ; then
     474            echo "$1"
     475        fi
     476    else
    469477        echo "$1"
    470     #fi
     478    fi
    471479}
    472480
Note: See TracChangeset for help on using the changeset viewer.