From a7266751ce2db0ce71e00b281cb0e5dcf969d2ba Mon Sep 17 00:00:00 2001 From: eduard93 Date: Thu, 13 Apr 2017 15:49:36 +0300 Subject: [PATCH 1/2] Alway provide CONTENTTYPE = application/json --- Form/REST/Abstract.cls.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Form/REST/Abstract.cls.xml b/Form/REST/Abstract.cls.xml index d346c05..c57e5c4 100644 --- a/Form/REST/Abstract.cls.xml +++ b/Form/REST/Abstract.cls.xml @@ -7,6 +7,10 @@ %CSP.REST 64090,76470.397537 + +application/json + + Integer 1 From 2ef797d0b6618e3954e081cde312cb5e6359fee7 Mon Sep 17 00:00:00 2001 From: eduard93 Date: Thu, 13 Apr 2017 15:50:43 +0300 Subject: [PATCH 2/2] Provide translation support --- Form.inc.xml | 3 +++ Form/Generators.cls.xml | 27 ++++++++++++++++++++++ Form/Property.cls.xml | 1 + Form/Util/Translate.cls.xml | 45 +++++++++++++++++++++++++++++++++++++ 4 files changed, 76 insertions(+) create mode 100644 Form/Util/Translate.cls.xml diff --git a/Form.inc.xml b/Form.inc.xml index 6b325fc..c4cc6fa 100644 --- a/Form.inc.xml +++ b/Form.inc.xml @@ -38,5 +38,8 @@ #; Test if object variable is defined and not Null #define isDefObject(%obj) ($Data(%obj)#2&&$IsObject(%obj)) + +#define domain "RESTFORMS" +#define domainq """"_$$$domain_"""" ]]> diff --git a/Form/Generators.cls.xml b/Form/Generators.cls.xml index 30e50be..23de223 100644 --- a/Form/Generators.cls.xml +++ b/Form/Generators.cls.xml @@ -77,5 +77,32 @@ Validate FORMORDERBY parameter value if present quit sc ]]> + + + +Fill ^CacheMsg global for further translation +1 +1 +objectgenerator +generateMetadata + + diff --git a/Form/Property.cls.xml b/Form/Property.cls.xml index ef3c4f0..a8ffaf5 100644 --- a/Form/Property.cls.xml +++ b/Form/Property.cls.xml @@ -163,6 +163,7 @@ w ##class(Form.Property).getPropertyDisplayName("Form.Test.Simple", "text")%String diff --git a/Form/Util/Translate.cls.xml b/Form/Util/Translate.cls.xml new file mode 100644 index 0000000..5ff67f1 --- /dev/null +++ b/Form/Util/Translate.cls.xml @@ -0,0 +1,45 @@ + + + + +Support for metadata translation +Form +64386,54065.171182 + + + +Get translated value of a text +w ##class(Form.Util.Translate).get() +1 +text:%String + + + + + +Add text to ^CacheMsg +do ##class(Form.Util.Translate).Insert() +1 +text + + + +