MOVED pgsql/i18n_function.sql to pgsql/i18n_translate.sql
authorAlan Knowles <alan@roojs.com>
Fri, 11 Oct 2013 09:30:29 +0000 (17:30 +0800)
committerAlan Knowles <alan@roojs.com>
Fri, 11 Oct 2013 09:30:29 +0000 (17:30 +0800)
pgsql/i18n_translate.sql [new file with mode: 0644]

diff --git a/pgsql/i18n_translate.sql b/pgsql/i18n_translate.sql
new file mode 100644 (file)
index 0000000..e075fb0
--- /dev/null
@@ -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