r6174 - in trunk: lib ui/gwt

6 views
Skip to first unread message

subve...@svn.freemedsoftware.org

unread,
Nov 16, 2011, 1:03:09 AM11/16/11
to freemed-d...@googlegroups.com
Author: jeff
Date: 2011-11-16 01:03:09 -0500 (Wed, 16 Nov 2011)
New Revision: 6174

Added:
trunk/ui/gwt/dump-interface.xsl
Modified:
trunk/lib/i18n.php
trunk/ui/gwt/Makefile
trunk/ui/gwt/dump-messages.sh
Log:
Include interface strings in i18n list.


Modified: trunk/lib/i18n.php
===================================================================
--- trunk/lib/i18n.php 2011-11-16 06:00:54 UTC (rev 6173)
+++ trunk/lib/i18n.php 2011-11-16 06:03:09 UTC (rev 6174)
@@ -46,4 +46,11 @@
_textdomain ( $_v );
}

+function get_translation_matrix( $domain ) {
+ global $default_domain;
+ $default_domain = $domain;
+ $l10n = _get_reader();
+ return $l10n->cache_translations;
+} // end method get_translation_matrix
+
?>

Modified: trunk/ui/gwt/Makefile
===================================================================
--- trunk/ui/gwt/Makefile 2011-11-16 06:00:54 UTC (rev 6173)
+++ trunk/ui/gwt/Makefile 2011-11-16 06:03:09 UTC (rev 6174)
@@ -24,11 +24,15 @@

all: interface

-interface:
- ( cd lib ; ./install-deps.sh )
+interface: maven-deps maven-build
+
+maven-build:
rm -Rf src/main/webapp/FreemedInterface 2>&1 > /dev/null
mvn gwt:compile war:exploded

+maven-deps:
+ ( cd lib ; ./install-deps.sh )
+
install: interface
mkdir -p $(INSTDIR)/$(THISDIR)
cp -rvf www $(INSTDIR)/$(THISDIR)

Added: trunk/ui/gwt/dump-interface.xsl
===================================================================
--- trunk/ui/gwt/dump-interface.xsl (rev 0)
+++ trunk/ui/gwt/dump-interface.xsl 2011-11-16 06:03:09 UTC (rev 6174)
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!--
+
+XSL transform to pull strings out of the interface definitions
+
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/xpath-functions" version="1.0">
+ <xsl:output method="text" />
+ <xsl:template match="/">
+ <xsl:for-each select="//SimpleUIBuilder/Elements/Element/@title">
+ <xsl:value-of select="concat(., '=', '&#xA;')"/>
+ </xsl:for-each>
+ <xsl:for-each select="//SimpleUIBuilder/Elements/Element/@help">
+ <xsl:value-of select="concat(., '=', '&#xA;')"/>
+ </xsl:for-each>
+ </xsl:template>
+</xsl:stylesheet>

Modified: trunk/ui/gwt/dump-messages.sh
===================================================================
--- trunk/ui/gwt/dump-messages.sh 2011-11-16 06:00:54 UTC (rev 6173)
+++ trunk/ui/gwt/dump-messages.sh 2011-11-16 06:03:09 UTC (rev 6174)
@@ -27,5 +27,25 @@

D="$( cd "$(dirname "$0")"; pwd )"

-( cd "$D" ; xgettext -c -k'_' -o ../../locale/gwt.pot $(find src | grep '\.java$' | grep -v svn) )
+(
+ cd "$D"

+ # Convert everything to java properties files
+ find src | grep '\.module\.xml$' | grep -v svn | \
+ while read X; do
+ Y=$( echo "$X" | sed -e 's/\.module\.xml$/.properties/;' )
+ echo "$X => $Y"
+ xsltproc dump-interface.xsl $X | sed -e 's/ /\\ /g;' | \
+ sed -e 's/:/\\:/g;' > $Y
+ done
+
+ # Extract all strings
+ xgettext -c -k'_' -o ../../locale/gwt.pot \
+ $(find src | grep '\.java$' | grep -v svn) \
+ $(find src | grep '\.properties$' | grep -v svn)
+
+ # Remove any old build files
+ rm -f src/main/webapp/resources/interface/*.properties 2>&1 >> /dev/null
+
+)
+

Reply all
Reply to author
Forward
0 new messages