@livinglogic/livingapi 1.32.0 → 1.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/livingapi.js CHANGED
@@ -727,6 +727,304 @@ class WithAttachments extends Base
727
727
  }
728
728
  }
729
729
 
730
+ class TranslationsType extends ul4.Type
731
+ {
732
+ instancecheck(obj)
733
+ {
734
+ return obj instanceof Translations;
735
+ }
736
+ };
737
+
738
+ let translationstype = new TranslationsType("la", "Translations", "The translations of the multilingual attributes of a LivingAPI object (one attribute per language)");
739
+
740
+
741
+ // The languages for which translations may be created
742
+ const knownlangs = new Set(["de", "en", "fr", "it", "es", "cs"]);
743
+
744
+
745
+ export class Translations extends ul4.Proto
746
+ {
747
+ constructor(owner, langs=null)
748
+ {
749
+ super();
750
+ this.owner = owner;
751
+ this.langs = langs;
752
+ }
753
+
754
+ [ul4.symbols.type]()
755
+ {
756
+ return translationstype;
757
+ }
758
+
759
+ // Return the translations for the language ``lang`` (or for the current
760
+ // language ``globals.lang`` if ``lang`` is not given); returns ``null``
761
+ // if there are none
762
+ get(lang)
763
+ {
764
+ if (lang === undefined)
765
+ {
766
+ let globals = this.owner.globals;
767
+ if (globals === null || globals === undefined)
768
+ return null;
769
+ lang = globals.lang;
770
+ }
771
+ if (this.langs === null || lang === null)
772
+ return null;
773
+ let translation = this.langs.get(lang);
774
+ return translation !== undefined ? translation : null;
775
+ }
776
+
777
+ // Return the translations for the language ``lang``, creating a new empty
778
+ // translation object if there are none yet and ``lang`` is a known
779
+ // language (for unknown languages ``null`` will be returned)
780
+ get_or_add(lang)
781
+ {
782
+ if (!knownlangs.has(lang))
783
+ return null;
784
+ if (this.langs === null)
785
+ this.langs = new Map();
786
+ let translation = this.langs.get(lang);
787
+ if (translation === undefined)
788
+ {
789
+ translation = this.owner._create_translation(lang);
790
+ this.langs.set(lang, translation);
791
+ }
792
+ return translation;
793
+ }
794
+
795
+ // One getter for each known language (must be kept in sync with
796
+ // ``knownlangs``)
797
+ get de()
798
+ {
799
+ return this.get_or_add("de");
800
+ }
801
+
802
+ get en()
803
+ {
804
+ return this.get_or_add("en");
805
+ }
806
+
807
+ get fr()
808
+ {
809
+ return this.get_or_add("fr");
810
+ }
811
+
812
+ get it()
813
+ {
814
+ return this.get_or_add("it");
815
+ }
816
+
817
+ get es()
818
+ {
819
+ return this.get_or_add("es");
820
+ }
821
+
822
+ get cs()
823
+ {
824
+ return this.get_or_add("cs");
825
+ }
826
+
827
+ [ul4.symbols.getattr](name)
828
+ {
829
+ let translation = this.get_or_add(name);
830
+ if (translation !== null)
831
+ return translation;
832
+ throw new ul4.AttributeError(this, name);
833
+ }
834
+
835
+ [ul4.symbols.repr]()
836
+ {
837
+ return "<Translations owner=" + ul4._repr(this.owner) + " langs=" + ul4._repr(this.langs !== null ? [...this.langs.keys()] : null) + ">";
838
+ }
839
+
840
+ toString()
841
+ {
842
+ return this[ul4.symbols.repr]();
843
+ }
844
+ };
845
+
846
+
847
+ export class LangBase extends Base
848
+ {
849
+ constructor(id, lang=null)
850
+ {
851
+ super(id);
852
+ this.lang = lang;
853
+ }
854
+
855
+ [ul4.symbols.setattr](name, value)
856
+ {
857
+ if (this._settableattrs.has(name))
858
+ {
859
+ if (value !== null && typeof(value) !== "string")
860
+ throw new ul4.ArgumentError(name + " must be None or a string");
861
+ this[name] = value;
862
+ }
863
+ else
864
+ super[ul4.symbols.setattr](name, value);
865
+ }
866
+ };
867
+
868
+ LangBase.prototype._ul4attrs = new Set(["id", "lang"]);
869
+ LangBase.prototype._settableattrs = new Set();
870
+
871
+
872
+ class AppLangType extends ul4.Type
873
+ {
874
+ instancecheck(obj)
875
+ {
876
+ return obj instanceof AppLang;
877
+ }
878
+ };
879
+
880
+ let applangtype = new AppLangType("la", "AppLang", "The translations of the multilingual attributes of an app for one language");
881
+
882
+
883
+ export class AppLang extends LangBase
884
+ {
885
+ constructor(id, app=null, lang=null)
886
+ {
887
+ super(id, lang);
888
+ this.app = app;
889
+ this.name = null;
890
+ this.description = null;
891
+ this.typename_grammatical_gender = null;
892
+ this.typename_nominative_singular = null;
893
+ this.typename_genitive_singular = null;
894
+ this.typename_dative_singular = null;
895
+ this.typename_accusative_singular = null;
896
+ this.typename_nominative_plural = null;
897
+ this.typename_genitive_plural = null;
898
+ this.typename_dative_plural = null;
899
+ this.typename_accusative_plural = null;
900
+ }
901
+
902
+ [ul4.symbols.type]()
903
+ {
904
+ return applangtype;
905
+ }
906
+
907
+ [ul4.symbols.repr]()
908
+ {
909
+ return "<AppLang lang=" + ul4._repr(this.lang) + " name=" + ul4._repr(this.name) + ">";
910
+ }
911
+ };
912
+
913
+ AppLang.prototype._ul4onattrs = ["app", "lang", "name", "description", "typename_grammatical_gender", "typename_nominative_singular", "typename_genitive_singular", "typename_dative_singular", "typename_accusative_singular", "typename_nominative_plural", "typename_genitive_plural", "typename_dative_plural", "typename_accusative_plural"];
914
+ AppLang.prototype._ul4attrs = new Set(["id", "app", "lang", "name", "description", "typename_grammatical_gender", "typename_nominative_singular", "typename_genitive_singular", "typename_dative_singular", "typename_accusative_singular", "typename_nominative_plural", "typename_genitive_plural", "typename_dative_plural", "typename_accusative_plural"]);
915
+ AppLang.prototype._settableattrs = new Set(["name", "description", "typename_grammatical_gender", "typename_nominative_singular", "typename_genitive_singular", "typename_dative_singular", "typename_accusative_singular", "typename_nominative_plural", "typename_genitive_plural", "typename_dative_plural", "typename_accusative_plural"]);
916
+
917
+
918
+ class AppGroupLangType extends ul4.Type
919
+ {
920
+ instancecheck(obj)
921
+ {
922
+ return obj instanceof AppGroupLang;
923
+ }
924
+ };
925
+
926
+ let appgrouplangtype = new AppGroupLangType("la", "AppGroupLang", "The translations of the multilingual attributes of an app group for one language");
927
+
928
+
929
+ export class AppGroupLang extends LangBase
930
+ {
931
+ constructor(id, appgroup=null, lang=null)
932
+ {
933
+ super(id, lang);
934
+ this.appgroup = appgroup;
935
+ this.name = null;
936
+ this.description = null;
937
+ }
938
+
939
+ [ul4.symbols.type]()
940
+ {
941
+ return appgrouplangtype;
942
+ }
943
+
944
+ [ul4.symbols.repr]()
945
+ {
946
+ return "<AppGroupLang lang=" + ul4._repr(this.lang) + " name=" + ul4._repr(this.name) + ">";
947
+ }
948
+ };
949
+
950
+ AppGroupLang.prototype._ul4onattrs = ["appgroup", "lang", "name", "description"];
951
+ AppGroupLang.prototype._ul4attrs = new Set(["id", "appgroup", "lang", "name", "description"]);
952
+ AppGroupLang.prototype._settableattrs = new Set(["name", "description"]);
953
+
954
+
955
+ class ControlLangType extends ul4.Type
956
+ {
957
+ instancecheck(obj)
958
+ {
959
+ return obj instanceof ControlLang;
960
+ }
961
+ };
962
+
963
+ let controllangtype = new ControlLangType("la", "ControlLang", "The translations of the multilingual attributes of a control for one language");
964
+
965
+
966
+ export class ControlLang extends LangBase
967
+ {
968
+ constructor(id, control=null, lang=null)
969
+ {
970
+ super(id, lang);
971
+ this.control = control;
972
+ this.label = null;
973
+ this.description = null;
974
+ }
975
+
976
+ [ul4.symbols.type]()
977
+ {
978
+ return controllangtype;
979
+ }
980
+
981
+ [ul4.symbols.repr]()
982
+ {
983
+ return "<ControlLang lang=" + ul4._repr(this.lang) + " label=" + ul4._repr(this.label) + ">";
984
+ }
985
+ };
986
+
987
+ ControlLang.prototype._ul4onattrs = ["control", "lang", "label", "description"];
988
+ ControlLang.prototype._ul4attrs = new Set(["id", "control", "lang", "label", "description"]);
989
+ ControlLang.prototype._settableattrs = new Set(["label", "description"]);
990
+
991
+
992
+ class LookupItemLangType extends ul4.Type
993
+ {
994
+ instancecheck(obj)
995
+ {
996
+ return obj instanceof LookupItemLang;
997
+ }
998
+ };
999
+
1000
+ let lookupitemlangtype = new LookupItemLangType("la", "LookupItemLang", "The translations of the multilingual attributes of a lookup item for one language");
1001
+
1002
+
1003
+ export class LookupItemLang extends LangBase
1004
+ {
1005
+ constructor(id, lookup_item=null, lang=null)
1006
+ {
1007
+ super(id, lang);
1008
+ this.lookup_item = lookup_item;
1009
+ this.label = null;
1010
+ }
1011
+
1012
+ [ul4.symbols.type]()
1013
+ {
1014
+ return lookupitemlangtype;
1015
+ }
1016
+
1017
+ [ul4.symbols.repr]()
1018
+ {
1019
+ return "<LookupItemLang lang=" + ul4._repr(this.lang) + " label=" + ul4._repr(this.label) + ">";
1020
+ }
1021
+ };
1022
+
1023
+ LookupItemLang.prototype._ul4onattrs = ["lookup_item", "lang", "label"];
1024
+ LookupItemLang.prototype._ul4attrs = new Set(["id", "lookup_item", "lang", "label"]);
1025
+ LookupItemLang.prototype._settableattrs = new Set(["label"]);
1026
+
1027
+
730
1028
  class AppType extends ul4.Type
731
1029
  {
732
1030
  instancecheck(obj)
@@ -756,6 +1054,185 @@ export class App extends WithAttachments
756
1054
  return this.appgroup;
757
1055
  }
758
1056
 
1057
+ get translations()
1058
+ {
1059
+ if (this._translations === undefined)
1060
+ this._translations = new Translations(this);
1061
+ return this._translations;
1062
+ }
1063
+
1064
+ _create_translation(lang)
1065
+ {
1066
+ return new AppLang(null, this, lang);
1067
+ }
1068
+
1069
+ get name()
1070
+ {
1071
+ let translation = this.translations.get();
1072
+ if (translation !== null && translation.name !== null)
1073
+ return translation.name;
1074
+ return this._name;
1075
+ }
1076
+
1077
+ set name(value)
1078
+ {
1079
+ this._name = value;
1080
+ }
1081
+
1082
+ get description()
1083
+ {
1084
+ let translation = this.translations.get();
1085
+ if (translation !== null && translation.description !== null)
1086
+ return translation.description;
1087
+ return this._description;
1088
+ }
1089
+
1090
+ set description(value)
1091
+ {
1092
+ this._description = value;
1093
+ }
1094
+
1095
+ get typename_grammatical_gender()
1096
+ {
1097
+ let translation = this.translations.get();
1098
+ if (translation !== null && translation.typename_grammatical_gender !== null)
1099
+ return translation.typename_grammatical_gender;
1100
+ return this._typename_grammatical_gender;
1101
+ }
1102
+
1103
+ set typename_grammatical_gender(value)
1104
+ {
1105
+ this._typename_grammatical_gender = value;
1106
+ }
1107
+
1108
+ get typename_nominative_singular()
1109
+ {
1110
+ let translation = this.translations.get();
1111
+ if (translation !== null && translation.typename_nominative_singular !== null)
1112
+ return translation.typename_nominative_singular;
1113
+ return this._typename_nominative_singular;
1114
+ }
1115
+
1116
+ set typename_nominative_singular(value)
1117
+ {
1118
+ this._typename_nominative_singular = value;
1119
+ }
1120
+
1121
+ get typename_genitive_singular()
1122
+ {
1123
+ let translation = this.translations.get();
1124
+ if (translation !== null && translation.typename_genitive_singular !== null)
1125
+ return translation.typename_genitive_singular;
1126
+ return this._typename_genitive_singular;
1127
+ }
1128
+
1129
+ set typename_genitive_singular(value)
1130
+ {
1131
+ this._typename_genitive_singular = value;
1132
+ }
1133
+
1134
+ get typename_dative_singular()
1135
+ {
1136
+ let translation = this.translations.get();
1137
+ if (translation !== null && translation.typename_dative_singular !== null)
1138
+ return translation.typename_dative_singular;
1139
+ return this._typename_dative_singular;
1140
+ }
1141
+
1142
+ set typename_dative_singular(value)
1143
+ {
1144
+ this._typename_dative_singular = value;
1145
+ }
1146
+
1147
+ get typename_accusative_singular()
1148
+ {
1149
+ let translation = this.translations.get();
1150
+ if (translation !== null && translation.typename_accusative_singular !== null)
1151
+ return translation.typename_accusative_singular;
1152
+ return this._typename_accusative_singular;
1153
+ }
1154
+
1155
+ set typename_accusative_singular(value)
1156
+ {
1157
+ this._typename_accusative_singular = value;
1158
+ }
1159
+
1160
+ get typename_nominative_plural()
1161
+ {
1162
+ let translation = this.translations.get();
1163
+ if (translation !== null && translation.typename_nominative_plural !== null)
1164
+ return translation.typename_nominative_plural;
1165
+ return this._typename_nominative_plural;
1166
+ }
1167
+
1168
+ set typename_nominative_plural(value)
1169
+ {
1170
+ this._typename_nominative_plural = value;
1171
+ }
1172
+
1173
+ get typename_genitive_plural()
1174
+ {
1175
+ let translation = this.translations.get();
1176
+ if (translation !== null && translation.typename_genitive_plural !== null)
1177
+ return translation.typename_genitive_plural;
1178
+ return this._typename_genitive_plural;
1179
+ }
1180
+
1181
+ set typename_genitive_plural(value)
1182
+ {
1183
+ this._typename_genitive_plural = value;
1184
+ }
1185
+
1186
+ get typename_dative_plural()
1187
+ {
1188
+ let translation = this.translations.get();
1189
+ if (translation !== null && translation.typename_dative_plural !== null)
1190
+ return translation.typename_dative_plural;
1191
+ return this._typename_dative_plural;
1192
+ }
1193
+
1194
+ set typename_dative_plural(value)
1195
+ {
1196
+ this._typename_dative_plural = value;
1197
+ }
1198
+
1199
+ get typename_accusative_plural()
1200
+ {
1201
+ let translation = this.translations.get();
1202
+ if (translation !== null && translation.typename_accusative_plural !== null)
1203
+ return translation.typename_accusative_plural;
1204
+ return this._typename_accusative_plural;
1205
+ }
1206
+
1207
+ set typename_accusative_plural(value)
1208
+ {
1209
+ this._typename_accusative_plural = value;
1210
+ }
1211
+
1212
+ _dumpUL4ONAttr(name)
1213
+ {
1214
+ if (name === "translations")
1215
+ return this.translations.langs;
1216
+ else
1217
+ return this[name];
1218
+ }
1219
+
1220
+ _loadUL4ONAttr(name, value)
1221
+ {
1222
+ if (name === "translations")
1223
+ this.translations.langs = value;
1224
+ else
1225
+ this[name] = value;
1226
+ }
1227
+
1228
+ _setDefaultUL4ONAttr(name)
1229
+ {
1230
+ if (name === "translations")
1231
+ this.translations.langs = null;
1232
+ else
1233
+ this[name] = null;
1234
+ }
1235
+
759
1236
  insert(values={})
760
1237
  {
761
1238
  let record = this[ul4.symbols.call](values);
@@ -954,9 +1431,9 @@ export class App extends WithAttachments
954
1431
  };
955
1432
 
956
1433
 
957
- App.prototype._ul4onattrs = ["globals", "internal_id", "name", "description", "lang", "appgroup", "typename_grammatical_gender", "typename_nominative_singular", "typename_genitive_singular", "typename_dative_singular", "typename_accusative_singular", "typename_nominative_plural", "typename_genitive_plural", "typename_dative_plural", "typename_accusative_plural",
958
- "startlink", "image", "createdby", "controls", "records", "record_start", "record_count", "record_total", "installation", "categories", "params", "views", "datamanagement_identifier", "basetable", "primarykey", "insertprocedure", "updateprocedure", "deleteprocedure", "templates", "createdat", "updatedat", "updatedby", "superid", "favorite", "_active_view", "datasource", "main", "ai_generated", "viewtemplates", "filter_default", "sort_default", "filter_owndata", "_permissions", "data_actions", "attachments"];
959
- App.prototype._ul4attrs = new Set(["id", "globals", "name", "description", "lang", "appgroup", "group", "main", "ai_generated", "typename_grammatical_gender", "typename_nominative_singular", "typename_genitive_singular", "typename_dative_singular", "typename_accusative_singular", "typename_nominative_plural", "typename_genitive_plural", "typename_dative_plural", "typename_accusative_plural", "startlink", "image", "createdat", "createdby", "updatedat", "updatedby", "controls", "layout_controls", "records", "record_start", "record_count", "record_total", "installation", "categories", "params", "views", "menus", "panels", "datasource", "datamanagement_identifier", "insert", "favorite", "_active_view", "filter_default", "sort_default", "filter_owndata", "permissions", "data_actions", "attachments", "template_url", "new_embedded_url", "new_standalone_url", "home_url", "datamanagement_url", "import_url", "tasks_url", /*"formbuilder_url", "tasks_config_url",*/ "datamanagement_config_url", "permissions_url", "datamanageview_url"]);
1434
+ App.prototype._ul4onattrs = ["globals", "internal_id", "_name", "_description", "lang", "appgroup", "_typename_grammatical_gender", "_typename_nominative_singular", "_typename_genitive_singular", "_typename_dative_singular", "_typename_accusative_singular", "_typename_nominative_plural", "_typename_genitive_plural", "_typename_dative_plural", "_typename_accusative_plural",
1435
+ "startlink", "image", "createdby", "controls", "records", "record_start", "record_count", "record_total", "installation", "categories", "params", "views", "datamanagement_identifier", "basetable", "primarykey", "insertprocedure", "updateprocedure", "deleteprocedure", "templates", "createdat", "updatedat", "updatedby", "superid", "favorite", "_active_view", "datasource", "main", "ai_generated", "viewtemplates", "filter_default", "sort_default", "filter_owndata", "_permissions", "data_actions", "attachments", "order", "translations"];
1436
+ App.prototype._ul4attrs = new Set(["id", "globals", "name", "description", "translations", "lang", "appgroup", "group", "main", "order", "ai_generated", "typename_grammatical_gender", "typename_nominative_singular", "typename_genitive_singular", "typename_dative_singular", "typename_accusative_singular", "typename_nominative_plural", "typename_genitive_plural", "typename_dative_plural", "typename_accusative_plural", "startlink", "image", "createdat", "createdby", "updatedat", "updatedby", "controls", "layout_controls", "records", "record_start", "record_count", "record_total", "installation", "categories", "params", "views", "menus", "panels", "datasource", "datamanagement_identifier", "insert", "favorite", "_active_view", "filter_default", "sort_default", "filter_owndata", "permissions", "data_actions", "attachments", "template_url", "new_embedded_url", "new_standalone_url", "home_url", "datamanagement_url", "import_url", "tasks_url", /*"formbuilder_url", "tasks_config_url",*/ "datamanagement_config_url", "permissions_url", "datamanageview_url"]);
960
1437
  ul4.expose(App.prototype[ul4.symbols.call], ["values", "**"], {"needsobject": true});
961
1438
  ul4.expose(App.prototype.insert, ["values", "**"], {"needsobject": true});
962
1439
  ul4.expose(App.prototype.template_url, ["identifier", "p", "record", "p=", null, "params", "**"]);
@@ -986,9 +1463,71 @@ export class AppGroup extends WithAttachments
986
1463
  {
987
1464
  return "<AppGroup id=" + ul4._repr(this.id) + " name=" + ul4._repr(this.name) + ">";
988
1465
  }
1466
+
1467
+ get translations()
1468
+ {
1469
+ if (this._translations === undefined)
1470
+ this._translations = new Translations(this);
1471
+ return this._translations;
1472
+ }
1473
+
1474
+ _create_translation(lang)
1475
+ {
1476
+ return new AppGroupLang(null, this, lang);
1477
+ }
1478
+
1479
+ get name()
1480
+ {
1481
+ let translation = this.translations.get();
1482
+ if (translation !== null && translation.name !== null)
1483
+ return translation.name;
1484
+ return this._name;
1485
+ }
1486
+
1487
+ set name(value)
1488
+ {
1489
+ this._name = value;
1490
+ }
1491
+
1492
+ get description()
1493
+ {
1494
+ let translation = this.translations.get();
1495
+ if (translation !== null && translation.description !== null)
1496
+ return translation.description;
1497
+ return this._description;
1498
+ }
1499
+
1500
+ set description(value)
1501
+ {
1502
+ this._description = value;
1503
+ }
1504
+
1505
+ _dumpUL4ONAttr(name)
1506
+ {
1507
+ if (name === "translations")
1508
+ return this.translations.langs;
1509
+ else
1510
+ return this[name];
1511
+ }
1512
+
1513
+ _loadUL4ONAttr(name, value)
1514
+ {
1515
+ if (name === "translations")
1516
+ this.translations.langs = value;
1517
+ else
1518
+ this[name] = value;
1519
+ }
1520
+
1521
+ _setDefaultUL4ONAttr(name)
1522
+ {
1523
+ if (name === "translations")
1524
+ this.translations.langs = null;
1525
+ else
1526
+ this[name] = null;
1527
+ }
989
1528
  };
990
- AppGroup.prototype._ul4onattrs = ["globals", "name", "description", "image", "apps", "main_app", "params", "attachments"];
991
- AppGroup.prototype._ul4attrs = new Set(["globals", "id", "name", "description", "image", "apps", "main_app", "params", "attachments"]);
1529
+ AppGroup.prototype._ul4onattrs = ["globals", "_name", "_description", "image", "apps", "main_app", "params", "attachments", "translations"];
1530
+ AppGroup.prototype._ul4attrs = new Set(["globals", "id", "name", "description", "translations", "image", "apps", "main_app", "params", "attachments"]);
992
1531
 
993
1532
 
994
1533
  class ViewType extends ul4.Type
@@ -4022,15 +4561,31 @@ export class Control extends Base
4022
4561
  return this.subtype ? this.type + "/" + this.subtype : this.type;
4023
4562
  }
4024
4563
 
4564
+ get translations()
4565
+ {
4566
+ if (this._translations === undefined)
4567
+ this._translations = new Translations(this);
4568
+ return this._translations;
4569
+ }
4570
+
4571
+ _create_translation(lang)
4572
+ {
4573
+ return new ControlLang(null, this, lang);
4574
+ }
4575
+
4025
4576
  get label()
4026
4577
  {
4027
4578
  let view_control = this._view_control();
4028
- if (view_control === null)
4029
- return this._label;
4030
- let label = view_control.label;
4031
- if (label === null)
4032
- return this._label;
4033
- return label;
4579
+ if (view_control !== null)
4580
+ {
4581
+ let label = view_control.label;
4582
+ if (label !== null)
4583
+ return label;
4584
+ }
4585
+ let translation = this.translations.get();
4586
+ if (translation !== null && translation.label !== null)
4587
+ return translation.label;
4588
+ return this._label;
4034
4589
  }
4035
4590
 
4036
4591
  set label(value)
@@ -4040,6 +4595,9 @@ export class Control extends Base
4040
4595
 
4041
4596
  get description()
4042
4597
  {
4598
+ let translation = this.translations.get();
4599
+ if (translation !== null && translation.description !== null)
4600
+ return translation.description;
4043
4601
  return this._description;
4044
4602
  }
4045
4603
 
@@ -4048,6 +4606,30 @@ export class Control extends Base
4048
4606
  this._description = value;
4049
4607
  }
4050
4608
 
4609
+ _dumpUL4ONAttr(name)
4610
+ {
4611
+ if (name === "translations")
4612
+ return this.translations.langs;
4613
+ else
4614
+ return this[name];
4615
+ }
4616
+
4617
+ _loadUL4ONAttr(name, value)
4618
+ {
4619
+ if (name === "translations")
4620
+ this.translations.langs = value;
4621
+ else
4622
+ this[name] = value;
4623
+ }
4624
+
4625
+ _setDefaultUL4ONAttr(name)
4626
+ {
4627
+ if (name === "translations")
4628
+ this.translations.langs = null;
4629
+ else
4630
+ this[name] = null;
4631
+ }
4632
+
4051
4633
  get priority()
4052
4634
  {
4053
4635
  return this._priority;
@@ -4252,8 +4834,8 @@ export class Control extends Base
4252
4834
 
4253
4835
  Control.prototype.type = null;
4254
4836
  Control.prototype.subtype = null;
4255
- Control.prototype._ul4onattrs = ["identifier", "fieldname", "app", "_label", "_description", "base_mode", "in_sum", "_priority", "_in_mobile_list", "_in_text", "_in_structured_search", "_in_fulltext_search", "_in_expert_search", "_required", "_required_in_view", "order", "ininsertprocedure", "inupdateprocedure"];
4256
- Control.prototype._ul4attrs = new Set(["id", "identifier", "fieldname", "app", "base_mode", "in_sum", "priority", "in_list", "in_mobile_list", "in_text", "in_structured_search", "in_fulltext_search", "in_expert_search", "order", "ininsertprocedure", "inupdateprocedure", "fulltype", "label", "description", "top", "left", "width", "height", "z_index", "liveupdate", "tabindex", "required", "mode", "labelpos", "autoalign", "in_active_view"]);
4837
+ Control.prototype._ul4onattrs = ["identifier", "fieldname", "app", "_label", "_description", "base_mode", "in_sum", "_priority", "_in_mobile_list", "_in_text", "_in_structured_search", "_in_fulltext_search", "_in_expert_search", "_required", "_required_in_view", "order", "ininsertprocedure", "inupdateprocedure", "translations"];
4838
+ Control.prototype._ul4attrs = new Set(["id", "identifier", "fieldname", "app", "base_mode", "in_sum", "priority", "in_list", "in_mobile_list", "in_text", "in_structured_search", "in_fulltext_search", "in_expert_search", "order", "ininsertprocedure", "inupdateprocedure", "fulltype", "label", "description", "translations", "top", "left", "width", "height", "z_index", "liveupdate", "tabindex", "required", "mode", "labelpos", "autoalign", "in_active_view"]);
4257
4839
  Control.prototype._cssclass_root = "llft-control";
4258
4840
  Control.prototype._cssclass_control = "input";
4259
4841
 
@@ -5548,17 +6130,41 @@ export class LookupItem extends Base
5548
6130
  return lookupitemtype;
5549
6131
  }
5550
6132
 
6133
+ get globals()
6134
+ {
6135
+ if (this.control === null || this.control.app === null)
6136
+ return null;
6137
+ return this.control.app.globals;
6138
+ }
6139
+
6140
+ get translations()
6141
+ {
6142
+ if (this._translations === undefined)
6143
+ this._translations = new Translations(this);
6144
+ return this._translations;
6145
+ }
6146
+
6147
+ _create_translation(lang)
6148
+ {
6149
+ return new LookupItemLang(null, this, lang);
6150
+ }
6151
+
5551
6152
  get label()
5552
6153
  {
5553
- if (this.control === null)
5554
- return this._label;
5555
- let view_lookupitem = this._view_lookupitem();
5556
- if (view_lookupitem === null)
5557
- return this._label;
5558
- let label = view_lookupitem.label;
5559
- if (label === null)
5560
- return this._label;
5561
- return label;
6154
+ if (this.control !== null)
6155
+ {
6156
+ let view_lookupitem = this._view_lookupitem();
6157
+ if (view_lookupitem !== null)
6158
+ {
6159
+ let label = view_lookupitem.label;
6160
+ if (label !== null)
6161
+ return label;
6162
+ }
6163
+ }
6164
+ let translation = this.translations.get();
6165
+ if (translation !== null && translation.label !== null)
6166
+ return translation.label;
6167
+ return this._label;
5562
6168
  }
5563
6169
 
5564
6170
  get visible()
@@ -5588,6 +6194,30 @@ export class LookupItem extends Base
5588
6194
  return null;
5589
6195
  }
5590
6196
 
6197
+ _dumpUL4ONAttr(name)
6198
+ {
6199
+ if (name === "translations")
6200
+ return this.translations.langs;
6201
+ else
6202
+ return this[name];
6203
+ }
6204
+
6205
+ _loadUL4ONAttr(name, value)
6206
+ {
6207
+ if (name === "translations")
6208
+ this.translations.langs = value;
6209
+ else
6210
+ this[name] = value;
6211
+ }
6212
+
6213
+ _setDefaultUL4ONAttr(name)
6214
+ {
6215
+ if (name === "translations")
6216
+ this.translations.langs = null;
6217
+ else
6218
+ this[name] = null;
6219
+ }
6220
+
5591
6221
  [ul4.symbols.repr]()
5592
6222
  {
5593
6223
  let repr = "<LookupItem key=" + ul4._repr(this.key) + " label=" + ul4._repr(this.label);
@@ -5597,8 +6227,8 @@ export class LookupItem extends Base
5597
6227
  }
5598
6228
  };
5599
6229
 
5600
- LookupItem.prototype._ul4onattrs = ["control", "key", "_label"];
5601
- LookupItem.prototype._ul4attrs = new Set(["id", "control", "key", "label"]);
6230
+ LookupItem.prototype._ul4onattrs = ["control", "key", "_label", "translations"];
6231
+ LookupItem.prototype._ul4attrs = new Set(["id", "control", "key", "label", "translations"]);
5602
6232
 
5603
6233
 
5604
6234
  class ViewLookupItemType extends ul4.Type
@@ -6645,6 +7275,10 @@ let classes = [
6645
7275
  MultipleAppLookupField,
6646
7276
  LookupItem,
6647
7277
  ViewLookupItem,
7278
+ AppLang,
7279
+ AppGroupLang,
7280
+ ControlLang,
7281
+ LookupItemLang,
6648
7282
  LayoutControl,
6649
7283
  HTMLLayoutControl,
6650
7284
  ImageLayoutControl,
@@ -6728,6 +7362,11 @@ export const module = new ul4.Module(
6728
7362
  DataSourceChildren: DataSourceChildren,
6729
7363
  LookupItem: LookupItem,
6730
7364
  ViewLookupItem: ViewLookupItem,
7365
+ Translations: Translations,
7366
+ AppLang: AppLang,
7367
+ AppGroupLang: AppGroupLang,
7368
+ ControlLang: ControlLang,
7369
+ LookupItemLang: LookupItemLang,
6731
7370
  Category: Category,
6732
7371
  AppParameter: AppParameter,
6733
7372
  MutableAppParameter: MutableAppParameter,