From: miker Date: Tue, 7 Aug 2007 15:22:52 +0000 (+0000) Subject: Patch from Dan Scott to robustify current JS localization code X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7fda2ccf4c93a300d1de2277cbbe62396317c602;p=Evergreen.git Patch from Dan Scott to robustify current JS localization code git-svn-id: svn://svn.open-ils.org/ILS/trunk@7626 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/Makefile b/Open-ILS/xul/staff_client/Makefile index 9c1fb4b65f..2d7cf9a9b5 100644 --- a/Open-ILS/xul/staff_client/Makefile +++ b/Open-ILS/xul/staff_client/Makefile @@ -74,7 +74,10 @@ generated: @echo @echo '********************************************************* Grabbing lang.dtd from the OPAC code ' cp ../../../Open-ILS/web/opac/locale/en-US/lang.dtd build/chrome/locale/en-US/ + # Generate the lang.js file for the stamped build external/dtd2js.pl build/chrome/locale/en-US/lang.dtd > build/chrome/content/main/lang.js + # Generate the lang.js file for versionless as well + external/dtd2js.pl build/chrome/locale/en-US/lang.dtd > chrome/content/main/lang.js open-ils: @echo diff --git a/Open-ILS/xul/staff_client/external/dtd2js.pl b/Open-ILS/xul/staff_client/external/dtd2js.pl index 8f98925661..d7ee4e477b 100755 --- a/Open-ILS/xul/staff_client/external/dtd2js.pl +++ b/Open-ILS/xul/staff_client/external/dtd2js.pl @@ -5,11 +5,12 @@ # # # +# print "var entities = {};"; while( $line = <> ) { - if ($line =~ //) { + if ($line =~ /\s*$/) { print "entities['$1'] = $2;\n"; } else { chomp $line; diff --git a/Open-ILS/xul/staff_client/external/dtd2js.sh b/Open-ILS/xul/staff_client/external/dtd2js.sh index 29459891fe..12d8a5c4f0 100755 --- a/Open-ILS/xul/staff_client/external/dtd2js.sh +++ b/Open-ILS/xul/staff_client/external/dtd2js.sh @@ -1,2 +1,2 @@ #!/bin/bash -./dtd2js.pl ~/ILS/Open-ILS/web/opac/locale/en-US/lang.dtd > ../chrome/content/main/lang.js +./dtd2js.pl ../../../web/opac/locale/en-US/lang.dtd > ../chrome/content/main/lang.js