From: Alan Knowles Date: Fri, 11 Oct 2013 09:30:29 +0000 (+0800) Subject: MOVED pgsql/i18n_function.sql to pgsql/i18n_translate.sql X-Git-Url: http://git.roojs.org/?p=Pman.Core;a=commitdiff_plain;h=ae58e9696a278e5d6e9d9f1e3d973e09ab09f09c MOVED pgsql/i18n_function.sql to pgsql/i18n_translate.sql --- diff --git a/pgsql/i18n_translate.sql b/pgsql/i18n_translate.sql new file mode 100644 index 00000000..e075fb04 --- /dev/null +++ b/pgsql/i18n_translate.sql @@ -0,0 +1,39 @@ + + + + + +CREATE OR REPLACE FUNCTION i18n_translate(text,text,text) + RETURNS text AS +$BODY$ +-- Copyright (c) 1999-2011 by OpenMFG LLC, d/b/a xTuple. +-- See www.xtuple.com/CPAL for the full text of the software license. +DECLARE + in_ltype ALIAS FOR $1; + in_lkey ALIAS FOR $2; + in_inlang ALIAS FOR $3; + + ret TEXT; + +BEGIN + + ret := ''; + SELECT lval INTO ret FROM i18n + WHERE ltype=in_ltype AND lkey=in_lkey and inlang=in_inlang LIMIT 1; + RETURN ret; + + + RETURN ret; + +END; +$BODY$ + LANGUAGE plpgsql VOLATILE + COST 100; + +ALTER FUNCTION i18n_translate(text,text,text) + OWNER TO admin; + + + + + \ No newline at end of file