From be14fdc318e622e759400fc3755278a8f54af5a6 Mon Sep 17 00:00:00 2001 From: vdelachaux Date: Thu, 19 Dec 2024 13:13:03 +0100 Subject: [PATCH] wip --- Project/Sources/Classes/Preferences.4dm | 15 +- Project/Sources/Classes/Xliff.4dm | 128 ++-- .../Sources/Classes/_EDITOR_Controller.4dm | 50 +- .../Classes/_SEARCH_PICKER_Controller.4dm | 39 +- .../Sources/Classes/_STRING_Controller.4dm | 21 +- Project/Sources/Classes/database.4dm | 31 - Project/Sources/Classes/hListDelegate 2.4dm | 689 ------------------ Project/Sources/Classes/process.4dm | 32 + Project/Sources/Classes/static.4dm | 2 +- Project/Sources/Classes/tools.4dm | 41 +- Project/Sources/Classes/xliffGroup.4dm | 85 ++- Project/Sources/Classes/xliffUnit.4dm | 38 +- Project/Sources/Forms/STRING/form.4DForm | 1 - Project/Sources/Methods/EDITOR CALLBACK.4dm | 3 +- Project/Sources/Methods/EDITOR OPEN.4dm | 15 +- .../Sources/Methods/dropableWidgetMethod.4dm | 7 +- Project/Sources/Methods/formCallBack.4dm | 5 +- Project/Sources/Methods/formMenuHandle.4dm | 7 +- .../Sources/Methods/subformWidgetMethod.4dm | 2 +- Project/Sources/folders.json | 5 +- 20 files changed, 258 insertions(+), 958 deletions(-) delete mode 100644 Project/Sources/Classes/hListDelegate 2.4dm create mode 100644 Project/Sources/Classes/process.4dm diff --git a/Project/Sources/Classes/Preferences.4dm b/Project/Sources/Classes/Preferences.4dm index 59baa1a..b1a83ac 100644 --- a/Project/Sources/Classes/Preferences.4dm +++ b/Project/Sources/Classes/Preferences.4dm @@ -1,5 +1,6 @@ Class extends _classCore +property version : Text property file : 4D:C1709.File property data : Object @@ -19,8 +20,7 @@ Class constructor($version : Text) Else - This:C1470.data:=New object:C1471(\ - "version"; This:C1470.version) + This:C1470.data:={version: This:C1470.version} End if @@ -34,10 +34,10 @@ Function set($key : Text; $value) This:C1470.data[$key]:=$value - This:C1470._save() + This:C1470.save() // === === === === === === === === === === === === === === === === === === === -Function _save() +Function save() This:C1470.file.setText(JSON Stringify:C1217(This:C1470.data; *)) @@ -62,7 +62,7 @@ Function _update() $version:="3.0" //______________________________________________________ - : ($version="3.0") + : ($version="3.0") // Update to 3.1 or higher fixIDsWithSlashes @@ -71,14 +71,15 @@ Function _update() //______________________________________________________ : ($version="3.1") // Update to 3.2 or higher + // + //______________________________________________________ End case - Until ($version=This:C1470.version) If (This:C1470.data.version#$version) This:C1470.data.version:=$version - This:C1470._save() + This:C1470.save() End if \ No newline at end of file diff --git a/Project/Sources/Classes/Xliff.4dm b/Project/Sources/Classes/Xliff.4dm index 534fe19..6b5d17b 100644 --- a/Project/Sources/Classes/Xliff.4dm +++ b/Project/Sources/Classes/Xliff.4dm @@ -1,10 +1,33 @@ Class extends xml +// MARK: Default values โš™๏ธ +property allUnits : Collection:=[] +property groups : Collection:=[] + +// MARK: Constants ๐Ÿ” +// Extensions +property FILE_EXTENSION : Text:=".xlf" +property FOLDER_EXTENSION : Text:=".lproj" + +// Common XPATH +property XPATH_HEADER : Text:="/xliff/header" +property XPATH_PROP_GROUP : Text:="/xliff/file/header/prop-group" +property XPATH_FILE : Text:="/xliff/file" +property XPATH_BODY : Text:="/xliff/file/body" + +// State values +property NEW : Text:="new" // The item is new (not in a previous version of the document) +property NEEDS_TRANSLATION : Text:="needs-translation" // The item needs to be translated. +property NEEDS_REVIEW : Text:="needs-review-translation" // Only the text of the item needs to be reviewed. + +// MARK: Other ๐Ÿ’พ property attributes; language : Object -property groups : Collection property datatype : Text -property duplicateResname : Boolean +property noTranslate : Boolean +property note : Boolean + +property duplicateID; duplicateResname : Boolean Class constructor($file : 4D:C1709.File) @@ -13,25 +36,6 @@ Class constructor($file : 4D:C1709.File) // Do not close the XML tree when they are saved This:C1470.autoClose:=False:C215 - // MARK:Delegates ๐Ÿ“ฆ - This:C1470.group:=cs:C1710.xliffGroup - This:C1470.transunit:=cs:C1710.xliffUnit - - // MARK: Common XPATH - This:C1470.headerPath:="/xliff/header" - This:C1470.propPath:="/xliff/file/header/prop-group" - This:C1470.filePath:="/xliff/file" - This:C1470.bodyPath:="/xliff/file/body" - - // MARK: Extensions - This:C1470.fileExtension:=".xlf" - This:C1470.folderExtension:=".lproj" - - // Mark:State values - This:C1470.new:="new" // The item is new (not in a previous version of the document) - This:C1470.needsTranslation:="needs-translation" // The item needs to be translated. - This:C1470.needsReviewTranslation:="needs-review-translation" // Only the text of the item needs to be reviewed. - // === === === === === === === === === === === === === === === === === === === /// Creating and returning a new group Function createGroup($resname : Text) : cs:C1710.xliffGroup @@ -46,8 +50,8 @@ Function createGroup($resname : Text) : cs:C1710.xliffGroup $node:=This:C1470.create(This:C1470.bodyNode; "group"; $attributes) // Update me - $attributes.XPATH:=This:C1470.bodyPath+"/group[@resname=\""+$resname+"\"]" - $group:=This:C1470.group.new($node; $attributes) + $attributes.xpath:=This:C1470.XPATH_BODY+"/group[@resname=\""+$resname+"\"]" + $group:=cs:C1710.xliffGroup.new($node; $attributes) This:C1470.groups.push($group) This:C1470.groups:=This:C1470.groups.orderBy("resname") @@ -61,13 +65,13 @@ Function deleteUnit($unit : cs:C1710.xliffUnit) : cs:C1710.xliffGroup var $c : Collection var $group : cs:C1710.xliffGroup - //delete unit + // Delete unit This:C1470.remove($unit.node) - //update group - $c:=Split string:C1554($unit.XPATH; "/") + // Update group + $c:=Split string:C1554($unit.xpath; "/") $c.pop() - $group:=This:C1470.groups.query("XPATH = :1"; $c.join("/")).pop() + $group:=This:C1470.groups.query("xpath = :1"; $c.join("/")).pop() $indx:=$group.transunits.indices("id = :1"; $unit.id)[0] $group.transunits.remove($indx) @@ -88,13 +92,13 @@ Function createUnit($group : cs:C1710.xliffGroup; $resname : Text; $id : Text) : $node:=This:C1470.create($group.node; "trans-unit"; $attributes) $unit:=cs:C1710.xliffUnit.new($node; $attributes) - $unit.XPATH:=$group.XPATH+"/trans-unit[@id=\""+$unit.id+"\"]" + $unit.xpath:=$group.xpath+"/trans-unit[@id=\""+$unit.id+"\"]" $unit.source.node:=This:C1470.create($node; "source") - $unit.source.XPATH:=$unit.XPATH+"/source" + $unit.source.xpath:=$unit.xpath+"/source" $unit.target.node:=This:C1470.create($node; "target") - $unit.target.XPATH:=$unit.XPATH+"/target" + $unit.target.xpath:=$unit.xpath+"/target" $group.transunits.push($unit) @@ -109,7 +113,7 @@ Function get fileNode() : Text If (This:C1470.root#Null:C1517) - return This:C1470.findByXPath(This:C1470.filePath) + return This:C1470.findByXPath(This:C1470.XPATH_FILE) End if @@ -118,7 +122,7 @@ Function get bodyNode() : Text If (This:C1470.root#Null:C1517) - return This:C1470.findByXPath(This:C1470.bodyPath) + return This:C1470.findByXPath(This:C1470.XPATH_BODY) End if @@ -226,18 +230,16 @@ Function todoNodes() : Collection // === === === === === === === === === === === === === === === === === === === Function setState($node : Text; $state : Text) - var $currentState : Text - $node:=This:C1470.getTarget($node) If (This:C1470.isReference($node)) If (Length:C16($state)>0) - $currentState:=String:C10(This:C1470.getAttributes($node).state) + var $currentState : Text:=String:C10(This:C1470.getAttributes($node).state) If (Length:C16($currentState)>0)\ - && (($currentState=This:C1470.new) | ($state=This:C1470.needsTranslation) | ($state=This:C1470.needsReviewTranslation)) + && (($currentState=This:C1470.NEW) | ($state=This:C1470.NEEDS_TRANSLATION) | ($state=This:C1470.NEEDS_REVIEW)) return // Don't modify @@ -325,23 +327,23 @@ Function parse() : cs:C1710.Xliff For each ($node; This:C1470.groupNodes()) - $group:=This:C1470.group.new($node; This:C1470.getAttributes($node)) - $group.XPATH:=This:C1470.bodyPath+"/group[@resname=\""+$group.resname+"\"]" + $group:=cs:C1710.xliffGroup.new($node; This:C1470.getAttributes($node)) + $group.xpath:=This:C1470.XPATH_BODY+"/group[@resname=\""+$group.resname+"\"]" // Get the trans-units For each ($node; This:C1470.groupUnitNodes($group.node)) - $unit:=This:C1470.transunit.new($node; This:C1470.getAttributes($node)) - $unit.XPATH:=$group.XPATH+"/trans-unit[@id=\""+$unit.id+"\"]" + $unit:=cs:C1710.xliffUnit.new($node; This:C1470.getAttributes($node)) + $unit.xpath:=$group.xpath+"/trans-unit[@id=\""+$unit.id+"\"]" $unit.source.value:=This:C1470.sourceValue($node) - $unit.source.XPATH:=$unit.XPATH+"/source" + $unit.source.xpath:=$unit.xpath+"/source" If ($unit.attributes.translate#Null:C1517)\ && ($unit.attributes.translate#"no") $unit.target.value:=This:C1470.targetValue($node) - $unit.target.XPATH:=$unit.XPATH+"/target" + $unit.target.xpath:=$unit.xpath+"/target" Else @@ -445,7 +447,7 @@ Function findUnitNode($unit : cs:C1710.xliffUnit) : Text var $nodes : Collection // Search first with the id - $nodes:=This:C1470.find(This:C1470.root; $unit.XPATH) + $nodes:=This:C1470.find(This:C1470.root; $unit.xpath) If ($nodes.length>1) @@ -515,13 +517,13 @@ Function localizedFile($file : 4D:C1709.File; $masterLanguage : Text; $language // Manage the target language in upper case (EN, FR, ...) as a suffix of the name $path:=$file.platformPath - If (Match regex:C1019("(?m-si)(.*)"+Uppercase:C13(Substring:C12($masterLanguage; 1; 2))+"\\"+This:C1470.fileExtension+"$"; $path; 1; $pos; $len)) + If (Match regex:C1019("(?m-si)(.*)"+Uppercase:C13(Substring:C12($masterLanguage; 1; 2))+"\\"+This:C1470.FILE_EXTENSION+"$"; $path; 1; $pos; $len)) - $path:=Substring:C12($path; 1; $len{1})+Uppercase:C13(Substring:C12($language; 1; 2))+This:C1470.fileExtension + $path:=Substring:C12($path; 1; $len{1})+Uppercase:C13(Substring:C12($language; 1; 2))+This:C1470.FILE_EXTENSION End if - return File:C1566(Replace string:C233($path; $masterLanguage+This:C1470.folderExtension; $language+This:C1470.folderExtension); fk platform path:K87:2) + return File:C1566(Replace string:C233($path; $masterLanguage+This:C1470.FOLDER_EXTENSION; $language+This:C1470.FOLDER_EXTENSION); fk platform path:K87:2) // === === === === === === === === === === === === === === === === === === === Function synchronize($file : 4D:C1709.File; $targetLanguage : Text) @@ -557,7 +559,7 @@ Function synchronize($file : 4D:C1709.File; $targetLanguage : Text) If (Not:C34(Bool:C1537($unit.noTranslate))) - $xliff.setState($unit.node; This:C1470.new) + $xliff.setState($unit.node; This:C1470.NEW) End if End for each @@ -583,7 +585,7 @@ Function synchronize($file : 4D:C1709.File; $targetLanguage : Text) If ($localizedGroup=Null:C1517) // Create the group - $groupNode:=$xliff.append($xliff.findByXPath($xliff.bodyPath); $group.node) + $groupNode:=$xliff.append($xliff.findByXPath($xliff.XPATH_BODY); $group.node) // Set all target states as "new" For each ($node; $xliff.childrens($groupNode)) @@ -592,7 +594,7 @@ Function synchronize($file : 4D:C1709.File; $targetLanguage : Text) If (String:C10($attributes.translate)#"no") - $xliff.setState($node; This:C1470.new) + $xliff.setState($node; This:C1470.NEW) End if End for each @@ -602,7 +604,7 @@ Function synchronize($file : 4D:C1709.File; $targetLanguage : Text) End if // Ensure that all units are synchronized - $groupNode:=$xliff.findByXPath($group.XPATH) + $groupNode:=$xliff.findByXPath($group.xpath) For each ($unit; $group.transunits.orderBy("resname")) @@ -624,7 +626,7 @@ Function synchronize($file : 4D:C1709.File; $targetLanguage : Text) If (String:C10($unit.attributes.translate)#"no") // Set the target state as "new" - $xliff.setState($node; This:C1470.new) + $xliff.setState($node; This:C1470.NEW) End if End if @@ -639,7 +641,7 @@ Function updateHeader($name : Text; $version : Text) var $node : Text - $node:=This:C1470.findByXPath(This:C1470.propPath) + $node:=This:C1470.findByXPath(This:C1470.XPATH_PROP_GROUP) If (This:C1470.isReference($node)) @@ -647,26 +649,26 @@ Function updateHeader($name : Text; $version : Text) Else - $node:=This:C1470.create(This:C1470.root; This:C1470.propPath; New object:C1471("name"; $name)) + $node:=This:C1470.create(This:C1470.root; This:C1470.XPATH_PROP_GROUP; New object:C1471("name"; $name)) End if - $node:=This:C1470.findByXPath(This:C1470.propPath+"/prop[@prop-type=\"version\"") + $node:=This:C1470.findByXPath(This:C1470.XPATH_PROP_GROUP+"/prop[@prop-type=\"version\"") If (Not:C34(This:C1470.isReference($node))) - $node:=This:C1470.create(This:C1470.root; This:C1470.propPath+"/prop"; New object:C1471("prop-type"; "version")) + $node:=This:C1470.create(This:C1470.root; This:C1470.XPATH_PROP_GROUP+"/prop"; New object:C1471("prop-type"; "version")) End if This:C1470.setValue($node; $version) // Delete old properties - This:C1470.remove(This:C1470.findByXPath(This:C1470.propPath+"/prop[@prop-type=\"resname-autofill\"")) - This:C1470.remove(This:C1470.findByXPath(This:C1470.propPath+"/prop[@prop-type=\"resname-prefix\"")) - This:C1470.remove(This:C1470.findByXPath(This:C1470.propPath+"/prop[@prop-type=\"resname-separator\"")) - This:C1470.remove(This:C1470.findByXPath(This:C1470.propPath+"/prop[@prop-type=\"prefix\"")) - This:C1470.remove(This:C1470.findByXPath(This:C1470.propPath+"/prop[@prop-type=\"separator\"")) + This:C1470.remove(This:C1470.findByXPath(This:C1470.XPATH_PROP_GROUP+"/prop[@prop-type=\"resname-autofill\"")) + This:C1470.remove(This:C1470.findByXPath(This:C1470.XPATH_PROP_GROUP+"/prop[@prop-type=\"resname-prefix\"")) + This:C1470.remove(This:C1470.findByXPath(This:C1470.XPATH_PROP_GROUP+"/prop[@prop-type=\"resname-separator\"")) + This:C1470.remove(This:C1470.findByXPath(This:C1470.XPATH_PROP_GROUP+"/prop[@prop-type=\"prefix\"")) + This:C1470.remove(This:C1470.findByXPath(This:C1470.XPATH_PROP_GROUP+"/prop[@prop-type=\"separator\"")) This:C1470.save() @@ -701,13 +703,13 @@ Function addCopyright($copyright : Text) $node:=DOM Append XML child node:C1080(DOM Get XML document ref:C1088(This:C1470.root); XML comment:K45:8; $copyright) // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** - // $item could be a XPATH or a unit object + // $item could be a xpath or a unit object Function _child($item; $element : Text) : Text If (Value type:C1509($item)=Is object:K8:27) var $node : Text - $node:=This:C1470.findByXPath($item.XPATH+"/"+$element) + $node:=This:C1470.findByXPath($item.xpath+"/"+$element) If (This:C1470.success & This:C1470.isReference($node)) @@ -725,6 +727,4 @@ Function _child($item; $element : Text) : Text Function _uid() : Text return Replace string:C233(Delete string:C232(Generate digest:C1147(Generate UUID:C1066; _o_4D REST digest:K66:3); 23; 2); "/"; "_") - - \ No newline at end of file diff --git a/Project/Sources/Classes/_EDITOR_Controller.4dm b/Project/Sources/Classes/_EDITOR_Controller.4dm index 3932c53..6ffd5b2 100644 --- a/Project/Sources/Classes/_EDITOR_Controller.4dm +++ b/Project/Sources/Classes/_EDITOR_Controller.4dm @@ -1014,7 +1014,7 @@ Function doDeleteString($e : cs:C1710.evt) For each ($language; This:C1470.current.languages) $xliff:=$language.xliff - $group:=$xliff.groups.query("XPATH = :1"; $target.XPATH).pop() + $group:=$xliff.groups.query("xpath = :1"; $target.xpath).pop() $xliff.remove($group.node) This:C1470.save($xliff) @@ -1372,10 +1372,10 @@ Function parentGroup($unit : Object) : Object var $c : Collection - $c:=Split string:C1554($unit.XPATH; "/") + $c:=Split string:C1554($unit.xpath; "/") $c.pop() - return This:C1470.current.groups.query("XPATH = :1"; $c.join("/")).pop() + return This:C1470.current.groups.query("xpath = :1"; $c.join("/")).pop() // === === === === === === === === === === === === === === === === === === === === === === === === // Returns a collection of all xliff files for a given language (main by default) @@ -1577,7 +1577,7 @@ Function _synchronizeAttributes($parent : Object; $string : Object; $attributes // Update the XML tree $xliff:=$parent.opened.query("root = :1"; $language.root).pop() - $unit:=$xliff.findByXPath($string.XPATH) + $unit:=$xliff.findByXPath($string.xpath) If ($xliff.success) @@ -1837,7 +1837,7 @@ Function _UPDATE_SOURCE($context : Object) // Update the reference XML tree $xliff:=$context.file - $unit:=$xliff.findByXPath($string.XPATH) + $unit:=$xliff.findByXPath($string.xpath) $source:=$xliff.sourceNode($unit; True:C214) $target:=$xliff.targetNode($unit; True:C214) @@ -1850,7 +1850,7 @@ Function _UPDATE_SOURCE($context : Object) // Update the XML tree $xliff:=$language.xliff - $unit:=$xliff.findByXPath($string.XPATH) + $unit:=$xliff.findByXPath($string.xpath) $source:=$xliff.sourceNode($unit; True:C214) $target:=$xliff.targetNode($unit; True:C214) @@ -1864,17 +1864,17 @@ Function _UPDATE_SOURCE($context : Object) : ($isNew) $xliff.setValue($target; $string.source.value) - $xliff.setState($target; $xliff.new) + $xliff.setState($target; $xliff.NEW) //______________________________________________________ - : (String:C10($xliff.getAttributes($target).state)=$xliff.new) + : (String:C10($xliff.getAttributes($target).state)=$xliff.NEW) $xliff.setValue($target; $string.source.value) //______________________________________________________ Else - $xliff.setState($target; $xliff.needsReviewTranslation) + $xliff.setState($target; $xliff.NEEDS_REVIEW) //______________________________________________________ End case @@ -1883,7 +1883,7 @@ Function _UPDATE_SOURCE($context : Object) // Updating of UI elements $language.properties:=$language.properties || {} - $language.properties.state:=$xliff.needsReviewTranslation + $language.properties.state:=$xliff.NEEDS_REVIEW End for each @@ -1902,7 +1902,7 @@ Function _UPDATE_RESNAME($context : Object) // Update the reference XML tree $xliff:=$context.file - $xliff.setAttribute($xliff.findByXPath($target.XPATH); "resname"; $target.resname) + $xliff.setAttribute($xliff.findByXPath($target.xpath); "resname"; $target.resname) This:C1470.save($xliff) $ptr:=This:C1470.stringList.pointer @@ -1955,9 +1955,9 @@ Function _UPDATE_RESNAME($context : Object) // Synchronize attributes of other files This:C1470._synchronizeAttributes($context.parent; $target; $xliff.getAttributes($target.node)) - If (Match regex:C1019("(?mi-s)(?<=trans-unit\\[@resname=\")([^\"]*)"; $target.XPATH; 1; $pos; $len)) + If (Match regex:C1019("(?mi-s)(?<=trans-unit\\[@resname=\")([^\"]*)"; $target.xpath; 1; $pos; $len)) - $target.XPATH:=Substring:C12($target.XPATH; 1; $pos-1)+$target.resname+Substring:C12($target.XPATH; $pos+$len) + $target.xpath:=Substring:C12($target.xpath; 1; $pos-1)+$target.resname+Substring:C12($target.xpath; $pos+$len) End if @@ -1980,7 +1980,7 @@ Function _UPDATE_TRANSLATE($context : Object) // Update the reference XML tree $xliff:=$context.file - $unit:=$xliff.findByXPath($string.XPATH) + $unit:=$xliff.findByXPath($string.xpath) If ($string.attributes["translate"]=Null:C1517) @@ -2001,17 +2001,17 @@ Function _UPDATE_TRANSLATE($context : Object) // Update the XML tree $xliff:=$language.xliff - $unit:=$xliff.findByXPath($string.XPATH) + $unit:=$xliff.findByXPath($string.xpath) $target:=$xliff.targetNode($unit; True:C214) $xliff.setValue($target; $string.source.value) - $xliff.setState($target; $xliff.needsTranslation) + $xliff.setState($target; $xliff.NEEDS_TRANSLATION) This:C1470.save($xliff) // Updating of UI elements $language.properties:=$language.properties || {} - $language.properties.state:=$xliff.needsTranslation + $language.properties.state:=$xliff.NEEDS_TRANSLATION $language.value:=$string.source.value End for each @@ -2031,7 +2031,7 @@ Function _UPDATE_TRANSLATE($context : Object) // Update the XML tree $xliff:=$language.xliff - $unit:=$xliff.findByXPath($string.XPATH) + $unit:=$xliff.findByXPath($string.xpath) $xliff.remove($xliff.targetNode($unit)) This:C1470.save($xliff) @@ -2058,7 +2058,7 @@ Function _UPDATE_PLATFORM($context : Object) // Update the reference XML tree $xliff:=$context.file - $unit:=$xliff.findByXPath($string.XPATH) + $unit:=$xliff.findByXPath($string.xpath) If ($string.attributes["d4:includeIf"]=Null:C1517) @@ -2088,7 +2088,7 @@ Function _UPDATE_NOTE($context : Object) // Update the reference XML tree $xliff:=$context.file - $unit:=$xliff.findByXPath($string.XPATH) + $unit:=$xliff.findByXPath($string.xpath) $note:=$xliff.noteNode($unit) If (Length:C16(String:C10($string.note))=0) @@ -2108,7 +2108,7 @@ Function _UPDATE_NOTE($context : Object) // Update the XML tree $xliff:=$language.xliff - $unit:=$xliff.findByXPath($string.XPATH) + $unit:=$xliff.findByXPath($string.xpath) $note:=$xliff.noteNode($unit) If (Length:C16(String:C10($string.note))=0) @@ -2139,15 +2139,15 @@ Function _PROPAGATE_REFERENCE($context : Object) // Update the XML tree $xliff:=$language.xliff - $unit:=$xliff.findByXPath($string.XPATH) + $unit:=$xliff.findByXPath($string.xpath) $xliff.setValue($target; $string.source.value) - $xliff.setState($target; $xliff.needsTranslation) + $xliff.setState($target; $xliff.NEEDS_TRANSLATION) This:C1470.save($xliff) // Updating of UI elements $language.properties:=$language.properties || {} - $language.properties.state:=$xliff.needsTranslation + $language.properties.state:=$xliff.NEEDS_TRANSLATION $language.value:=$string.source.value End for each @@ -2164,7 +2164,7 @@ Function _UPDATE_LOCALIZED_TARGET($context : Object) $xliff:=This:C1470.opened.query("root=:1"; $context.root).pop() // Get target & set value - $target:=$xliff.findByXPath($context.string.target.XPATH) + $target:=$xliff.findByXPath($context.string.target.xpath) $xliff.setValue($target; $context.value) // Remove state attribute diff --git a/Project/Sources/Classes/_SEARCH_PICKER_Controller.4dm b/Project/Sources/Classes/_SEARCH_PICKER_Controller.4dm index ea3e897..68613cf 100644 --- a/Project/Sources/Classes/_SEARCH_PICKER_Controller.4dm +++ b/Project/Sources/Classes/_SEARCH_PICKER_Controller.4dm @@ -3,24 +3,26 @@ Class: _SEARCH_PICKER_Controller - (4DPop XLIFF Pro) Created 10-05-2023 by Vincent de Lachaux */ +// MARK: Default values โš™๏ธ +property isSubform:=True:C214 +property toBeInitialized:=False:C215 + +property borderColor : Integer:=0x00E5E5E5 +property expanded : Boolean:=False:C215 + +// MARK: Delegates ๐Ÿ“ฆ property form : cs:C1710.form -property callback : 4D:C1709.Function + +// MARK: Widgets ๐Ÿงฑ property box : cs:C1710.input property glass : cs:C1710.button property ring : cs:C1710.static Class constructor() - This:C1470.__CLASS__:=OB Class:C1730(This:C1470) - - This:C1470.isSubform:=True:C214 - // MARK:-Delegates ๐Ÿ“ฆ This:C1470.form:=cs:C1710.form.new(This:C1470) - This:C1470.borderColor:=0x00E5E5E5 - This:C1470.expanded:=False:C215 - This:C1470.form.init() // MARK:-[Standard Suite] @@ -44,13 +46,12 @@ Function handleEvents($e : cs:C1710.evt) //______________________________________________________ : ($e.code=On Load:K2:1) - SET TIMER:C645(-1) + This:C1470.form.refresh() //______________________________________________________ : ($e.code=On Timer:K2:25) SET TIMER:C645(0) - This:C1470.reset() //______________________________________________________ @@ -82,15 +83,12 @@ Function handleEvents($e : cs:C1710.evt) //============================================== : (This:C1470.box.catch($e)) - var $searchText : Text - $searchText:=This:C1470.box.getValue() - Case of //______________________________________________________ : ($e.code=On Losing Focus:K2:8) - If (Length:C16($searchText)=0) + If (Length:C16(This:C1470.box.value)=0) This:C1470.reset() @@ -106,12 +104,12 @@ Function handleEvents($e : cs:C1710.evt) //______________________________________________________ : ($e.code=On Data Change:K2:15) - This:C1470.form.containerInstance.data.value:=$searchText + This:C1470.form.containerInstance.data.value:=This:C1470.box.value // Inform the host - This:C1470.form.setValue(This:C1470) + This:C1470.form.containerValue:=This:C1470 - If (Length:C16($searchText)#0) + If (Length:C16(This:C1470.box.value)#0) // Stay in the widget This:C1470.box.focus() @@ -124,6 +122,11 @@ Function handleEvents($e : cs:C1710.evt) //============================================== End case + // === === === === === === === === === === === === === === === === === === === === === === === === +Function update() + + // + // === === === === === === === === === === === === === === === === === === === === === === === === Function expand() @@ -151,5 +154,5 @@ Function reset() This:C1470.collapse() This:C1470.box.setColors(Foreground color:K23:1; Background color none:K23:10) - This:C1470.ring.setColors(This:C1470.containerInstance.data.borderColor || This:C1470.borderColor; Background color none:K23:10).show() + This:C1470.ring.setColors(This:C1470.form.containerInstance.data.borderColor || This:C1470.borderColor; Background color none:K23:10).show() \ No newline at end of file diff --git a/Project/Sources/Classes/_STRING_Controller.4dm b/Project/Sources/Classes/_STRING_Controller.4dm index 48b5bf9..4ec9dc7 100644 --- a/Project/Sources/Classes/_STRING_Controller.4dm +++ b/Project/Sources/Classes/_STRING_Controller.4dm @@ -9,8 +9,7 @@ property toBeInitialized:=False:C215 // MARK: Delegates ๐Ÿ“ฆ property form : cs:C1710.form -property menu : 4D:C1709.Class -property str : cs:C1710.str +property str : cs:C1710.str:=cs:C1710.str.new() // MARK: Widgets ๐Ÿงฑ property resname; flag; lang; source : cs:C1710.input @@ -19,17 +18,14 @@ property handle; mac; win : cs:C1710.static property note : cs:C1710.widget property unitGroup; languageGroup; movable : cs:C1710.group -// MARK: Other ๐Ÿ’พ - - // MARK: Constants ๐Ÿ” +// MARK: Other ๐Ÿ’พ + Class constructor // MARK:-Delegates ๐Ÿ“ฆ This:C1470.form:=cs:C1710.form.new(This:C1470) - This:C1470.str:=cs:C1710.str.new() - This:C1470.menu:=cs:C1710.menu This:C1470.form.init() @@ -125,9 +121,7 @@ Function handleEvents($e : cs:C1710.evt) Else - // Show note UI - This:C1470.note.setCoordinates(This:C1470.source.getCoordinates()) - This:C1470.note.show().focus() + This:C1470.note.setCoordinates(This:C1470.source.getCoordinates()).show().focus() End if @@ -321,7 +315,7 @@ This.adjustResname(False) // Get localisation //FIXME:Failed if 2 identical or diacritical resnames, the first one is returned. - $node:=$xliff.findByXPath($localisation.string.XPATH) + $node:=$xliff.findByXPath($localisation.string.xpath) If ($xliff.success) @@ -451,7 +445,6 @@ Function _resnameManager($e : cs:C1710.evt) // === === === === === === === === === === === === === === === === === === === === === === === === Function _actionManager($e : cs:C1710.evt) - var $XPATH : Text var $string : Object var $parent : cs:C1710._EDITOR_Controller var $menu; $sub : cs:C1710.menu @@ -475,13 +468,13 @@ Function _actionManager($e : cs:C1710.evt) End if - $menu:=This:C1470.menu.new() + $menu:=cs:C1710.menu.new() $menu.append("camelCase"; "camelCase") //.shortcut("c"; Option key mask) If (OB Instance of:C1731($string; cs:C1710.xliffUnit)) - $sub:=This:C1470.menu.new() + $sub:=cs:C1710.menu.new() $sub.append("all"; "all").mark($string.attributes["d4:includeIf"]=Null:C1517)\ .line()\ .append("macOS"; "mac").icon("#images/maOS.png").mark(String:C10($string.attributes["d4:includeIf"])="mac")\ diff --git a/Project/Sources/Classes/database.4dm b/Project/Sources/Classes/database.4dm index 17d558a..130bb21 100644 --- a/Project/Sources/Classes/database.4dm +++ b/Project/Sources/Classes/database.4dm @@ -587,37 +587,6 @@ Function _restart($compiled : Boolean; $userParam) : Object End try - //MARK:-[PROCESSES] - // === === === === === === === === === === === === === === === === === === === === === === === === === === -Function getRunningUserProcesses() : Collection - - var $c : Collection:=Process activity:C1495(Processes only:K5:35).processes - - return $c.query("state >= :1 & type > 0"; Executing:K13:4) - - // === === === === === === === === === === === === === === === === === === === === === === === === === === -Function isProcessRunning($name : Text) : Boolean - - return This:C1470.getRunningUserProcesses().query("name = :1"; $name).pop()#Null:C1517 - - // === === === === === === === === === === === === === === === === === === === === === === === === === === -Function isProcessExists($name : Text; $bringToFront : Boolean) : Boolean - - var $process : Object:=This:C1470.getRunningUserProcesses().query("name = :1"; $name).first() - - If ($process#Null:C1517) - - If ($bringToFront) - - SHOW PROCESS:C325($process.number) - BRING TO FRONT:C326($process.number) - - End if - - return True:C214 - - End if - //MARK:-โš ๏ธ NOT THREAD SAFE // === === === === === === === === === === === === === === === === === === === === === === === === === === Function setUpdateFolder($folder; $silent : Boolean) diff --git a/Project/Sources/Classes/hListDelegate 2.4dm b/Project/Sources/Classes/hListDelegate 2.4dm deleted file mode 100644 index 7d5b3b1..0000000 --- a/Project/Sources/Classes/hListDelegate 2.4dm +++ /dev/null @@ -1,689 +0,0 @@ -Class extends scrollable - -Class constructor($name : Text; $itemRef : Integer) - - Super:C1705($name) - - ASSERT:C1129(This:C1470.type=Object type hierarchical list:K79:7) - - This:C1470.ref:=$itemRef - - This:C1470.datasource:=OBJECT Get data source:C1265(*; This:C1470.name) - - // MARK:-[List] - // === === === === === === === === === === === === === === === === === === === === === === === === - /// Creates a new list in memory and returns its unique list reference number. -Function create() : Integer - - This:C1470.clear() - This:C1470.ref:=New list:C375 - - return This:C1470.ref - - // === === === === === === === === === === === === === === === === === === === === === === === === - /// Deletes the current reference list -Function clear($keepSubLists : Boolean) - - If (This:C1470.isList) - - If ($keepSubLists) - - CLEAR LIST:C377(This:C1470.ref) - - Else - - CLEAR LIST:C377(This:C1470.ref; *) // Default is list and sublists - - End if - End if - - // === === === === === === === === === === === === === === === === === === === === === === === === - /// Returns a copy of the current list -Function copy() : cs:C1710.hList - - If (Asserted:C1132(This:C1470.isList; "No list to duplicate")) - - return cs:C1710.hList.new(Copy list:C626(This:C1470.ref)) - - End if - - // === === === === === === === === === === === === === === === === === === === === === === === === - /// Alias of copy() -Function clone() : cs:C1710.hList - - return This:C1470.copy() - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> - /// Is the current reference a valid list? -Function get isList() : Boolean - - return Is a list:C621(This:C1470.ref) - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> - /// The total number of items present in the list -Function get itemCount() : Integer - - return Count list items:C380(*; This:C1470.name; *) - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> - /// The number of items currently โ€œvisibleโ€ -Function get visibleItemCount() : Integer - - return Count list items:C380(*; This:C1470.name) - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> - /// The properties about the current list [โš ๏ธ only work with datasource] -Function get properties() : Object - - var $appearance; $doubleClick; $editable; $icon; $lineHeight; $multiSelection : Integer - - If (Asserted:C1132(Not:C34(Is nil pointer:C315(This:C1470.datasource)); Current method name:C684+" works only with a datatsource :-((")) - - GET LIST PROPERTIES:C632((This:C1470.datasource)->; $appearance; $icon; $lineHeight; $doubleClick; $multiSelection; $editable) - - return New object:C1471(\ - "lineHeight"; $lineHeight; \ - "expandCollapseOnDoubleClick"; Not:C34(Bool:C1537($doubleClick)); \ - "multiSelections"; Bool:C1537($multiSelection); \ - "editable"; Bool:C1537($editable)) - - End if - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> -Function set properties($properties : Object) - - var $key : Text - var $appearance; $doubleClick; $editable; $icon; $lineHeight; $multiSelection : Integer - - If (Asserted:C1132(Not:C34(Is nil pointer:C315(This:C1470.datasource)); Current method name:C684+" works only with a datatsource :-((")) - - GET LIST PROPERTIES:C632((This:C1470.datasource)->; $appearance; $icon; $lineHeight; $doubleClick; $multiSelection; $editable) - - For each ($key; $properties) - - Case of - - //______________________________________________________ - : ($key="lineHeight") - - $lineHeight:=Num:C11($properties[$key]) - - //______________________________________________________ - : ($key="expandCollapseOnDoubleClick") - - $doubleClick:=Num:C11(Not:C34(Bool:C1537($properties[$key]))) - - //______________________________________________________ - : ($key="multiSelections") - - $multiSelection:=Num:C11(Bool:C1537($properties[$key])) - - //______________________________________________________ - : ($key="editable") - - $editable:=Num:C11(Bool:C1537($properties[$key])) - - //______________________________________________________ - End case - - End for each - - SET LIST PROPERTIES:C387((This:C1470.datasource)->; $appearance; $icon; $lineHeight; $doubleClick; $multiSelection; $editable) - - End if - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> - /// The selected item positions [โ›”๏ธ READ ONLY] -Function get selected() : Collection - - var $c : Collection - - ARRAY LONGINT:C221($selected; 0x0000) - $selected{0}:=Selected list items:C379(*; This:C1470.name; $selected) - - $c:=New collection:C1472 - ARRAY TO COLLECTION:C1563($c; $selected) - - return $c - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> - /// The selected item refrernces [โ›”๏ธ READ ONLY] -Function get selectedReferences() : Collection - - var $c : Collection - - ARRAY LONGINT:C221($selected; 0x0000) - $selected{0}:=Selected list items:C379(*; This:C1470.name; $selected; *) - - $c:=New collection:C1472 - ARRAY TO COLLECTION:C1563($c; $selected) - - return $c - - // === === === === === === === === === === === === === === === === === === === === === === === === - /// Appends a new item to the current list -Function append($itemText : Text; $itemRef : Integer; $sublist : Integer; $expanded : Boolean) - - // โš ๏ธ APPEND TO LIST doesn't accept object name - - Case of - - //โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“ - : (Count parameters:C259=2) || ($sublist=0) - - INSERT IN LIST:C625(*; This:C1470.name; 0; $itemText; $itemRef) - - //โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“ - : (Count parameters:C259=4) - - INSERT IN LIST:C625(*; This:C1470.name; 0; $itemText; $itemRef; $sublist; $expanded) - - //โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“โ€“ - End case - - // === === === === === === === === === === === === === === === === === === === === === === === === - /// Inserts an item to the current list -Function insert($itemText : Text; $itemRef : Integer; $sublist : Integer; $expanded : Boolean; $beforeItemRef : Integer) - - If ($beforeItemRef#0) - - If ($sublist=0) - - INSERT IN LIST:C625(*; This:C1470.name; $beforeItemRef; $itemText; $itemRef) - - Else - - INSERT IN LIST:C625(*; This:C1470.name; $beforeItemRef; $itemText; $itemRef; $sublist; $expanded) - - End if - - Else - - INSERT IN LIST:C625(*; This:C1470.name; *; $itemText; $itemRef; $sublist; $expanded) - - End if - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> - /// True if at least one element could be folded. -Function get collapsable() : Boolean - - var $itemText : Text - var $expanded : Boolean - var $i; $itemRef; $sublist : Integer - - For ($i; 1; Count list items:C380(*; This:C1470.name); 1) - - GET LIST ITEM:C378(*; This:C1470.name; $i; $itemRef; $itemText; $sublist; $expanded) - - If ($sublist>0) && ($expanded) - - return True:C214 - - End if - End for - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> - /// True if at least one element could be unfolded. -Function get expandable() : Boolean - - var $itemText : Text - var $expanded : Boolean - var $i; $itemRef; $sublist : Integer - - For ($i; 1; Count list items:C380(*; This:C1470.name); 1) - - GET LIST ITEM:C378(*; This:C1470.name; $i; $itemRef; $itemText; $sublist; $expanded) - - If ($sublist>0) - - If (Not:C34($expanded)) - - return True:C214 - - Else - - $i+=Count list items:C380($sublist) - - End if - End if - End for - - // === === === === === === === === === === === === === === === === === === === === === === === === - /// Collapse all items -Function collapseAll($keep : Boolean) - - var $itemText : Text - var $expanded : Boolean - var $count; $current; $i; $itemRef; $subList : Integer - - $keep:=Count parameters:C259=0 ? This:C1470.itemSublist>0 : $keep - - // Keep the current item reference to restore if any - $current:=This:C1470.itemRef - - $count:=This:C1470.itemCount - - Repeat - - $i+=1 - $expanded:=False:C215 - - GET LIST ITEM:C378(*; This:C1470.name; $i; $itemRef; $itemText; $subList; $expanded) - - If ($subList#0)\ - & ($expanded) - - SET LIST ITEM:C385(*; This:C1470.name; $itemRef; $itemText; $itemRef; $subList; False:C215) - $count-=Count list items:C380($subList; *) - - Else - - $count-=1 - - End if - Until ($count<=0) - - If ($keep) - - // Restore the selected item - This:C1470.selectByReference($current) - - End if - - // === === === === === === === === === === === === === === === === === === === === === === === === - /// Expand all items -Function expandAll() - - var $itemText : Text - var $expanded : Boolean - var $count; $i; $itemRef; $subList : Integer - - $count:=This:C1470.itemCount - - For ($i; 1; This:C1470.itemCount; 1) - - GET LIST ITEM:C378(*; This:C1470.name; $i; $itemRef; $itemText; $subList; $expanded) - - If ($subList#0) && (Not:C34($expanded)) - - SET LIST ITEM:C385(*; This:C1470.name; $itemRef; $itemText; $itemRef; $subList; True:C214) - $i+=Count list items:C380($subList) - - End if - End for - - This:C1470.unselect() - - // MARK:-[Item] - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> - /// The value of the current element -Function get itemValue() : Text - - return This:C1470._getItem("value") - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> -Function set itemValue($value : Text) - - This:C1470._setItem("value"; $value) - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> - /// The ref of the current element -Function get itemRef() : Integer - - return This:C1470._getItem("ref") - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> -Function set itemRef($รฎtemRef : Integer) - - This:C1470._setItem("ref"; $รฎtemRef) - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> - /// The sub-list of the current element -Function get itemSublist() : Integer - - return This:C1470._getItem("sublist") - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> -Function set itemSublist($sublist : Integer) - - This:C1470._setItem("sublist"; $sublist) - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> - /// The expanded state of the sub-list of the current element -Function get itemExpanded() : Boolean - - return This:C1470._getItem("expanded") - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> -Function set itemExpanded($expanded : Boolean) - - This:C1470._setItem("expanded"; $expanded) - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> - ///The icon associated with the current element -Function get itemIcon() : Picture - - return This:C1470._getItem("icon") - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> -Function set itemIcon($icon : Picture) - - This:C1470._setItem("icon"; $icon) - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> - /// The current element position -Function get itemPosition() : Integer - - return List item position:C629(*; This:C1470.name; This:C1470.itemRef) - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> - /// All the parameters names & values of the current item -Function get parameters() : Collection - - var $dateSep; $decimalSep; $timeSep : Text - var $date : Date - var $bool : Boolean - var $time : Time - var $o : Object - var $c : Collection - - ARRAY TEXT:C222($names; 0x0000) - ARRAY TEXT:C222($values; 0x0000) - GET LIST ITEM PARAMETER ARRAYS:C1195(*; This:C1470.name; *; $names; $values) - - $c:=New collection:C1472 - ARRAY TO COLLECTION:C1563($c; $names; "name"; $values; "value") - - GET SYSTEM FORMAT:C994(Decimal separator:K60:1; $decimalSep) - GET SYSTEM FORMAT:C994(Date separator:K60:10; $dateSep) - GET SYSTEM FORMAT:C994(Time separator:K60:11; $timeSep) - - For each ($o; $c) - - Case of - - //______________________________________________________ - : ($o.value="0")\ - | ($o.value="1") // โš ๏ธ Boolean are stored as 0 or 1 - - GET LIST ITEM PARAMETER:C985(*; This:C1470.name; *; $o.name; $bool) - $o.value:=$bool - - //______________________________________________________ - : (Match regex:C1019("(?m-si)^(?:\\+|-)?\\d+(?:\\.|"+$decimalSep+"\\d+)?$"; $o.value; 1)) - - $o.value:=Num:C11($o.value) - - //______________________________________________________ - : (Match regex:C1019("(?m-si)^\\d+"+$timeSep+"\\d+(?:"+$timeSep+"\\d+)?$"; $o.value; 1)) - - GET LIST ITEM PARAMETER:C985(*; This:C1470.name; *; $o.name; $time) - $o.value:=$time - - //______________________________________________________ - : (Match regex:C1019("(?m-si)^\\d+"+$dateSep+"\\d+(?:"+$dateSep+"\\d+)?$"; $o.value; 1)) - - GET LIST ITEM PARAMETER:C985(*; This:C1470.name; *; $o.name; $date) - $o.value:=$date - - //______________________________________________________ - : (Match regex:C1019("(?msi)^(?:\\{.*\\})|(?:\\[.*\\])$"; $o.value; 1)) - - $o.value:=JSON Parse:C1218($o.value) - - //______________________________________________________ - End case - End for each - - return $c - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> - /// The parent item reference [โ›”๏ธ READ ONLY] -Function get parent() : Integer - - return List item parent:C633(*; This:C1470.name; *) - - // === === === === === === === === === === === === === === === === === === === === === === === === - /// Expand one item -Function collapse($itemPos : Integer) - - var $itemText : Text - var $isExpanded : Boolean - var $itemRef; $sublist : Integer - - GET LIST ITEM:C378(*; This:C1470.name; $itemPos; $itemRef; $itemText; $sublist; $isExpanded) - - If ($sublist#0)\ - && ($isExpanded) - - SET LIST ITEM:C385(*; This:C1470.name; $itemRef; $itemText; $itemRef; $sublist; False:C215) - - End if - - // === === === === === === === === === === === === === === === === === === === === === === === === - /// Expand one item -Function expand($itemPos : Integer) - - var $itemText : Text - var $isExpanded : Boolean - var $itemRef; $sublist : Integer - - GET LIST ITEM:C378(*; This:C1470.name; $itemPos; $itemRef; $itemText; $sublist; $isExpanded) - - If ($sublist#0)\ - && (Not:C34($isExpanded)) - - SET LIST ITEM:C385(*; This:C1470.name; $itemRef; $itemText; $itemRef; $sublist; True:C214) - - End if - - // === === === === === === === === === === === === === === === === === === === === === === === === - /// Returns the itemRef position -Function getItemPositionByRef($itemRef : Integer) : Integer - - return List item position:C629(*; This:C1470.name; $itemRef) - - // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** - /// Returns information about the element specified by itemPos or the current element if omitted -Function _getItem($request : Text; $itemPos : Integer) : Variant - - var $itemText : Text - var $icon : Picture - var $expanded : Boolean - var $itemRef; $sublist : Integer - - If ($request="icon") - - If ($itemPos=0) - - GET LIST ITEM ICON:C951(*; This:C1470.name; *; $icon) - - Else - - GET LIST ITEM ICON:C951(*; This:C1470.name; $itemPos; $icon) - - End if - - return $icon - - Else - - If ($itemPos=0) - - GET LIST ITEM:C378(*; This:C1470.name; *; $itemRef; $itemText; $sublist; $expanded) - - Else - - GET LIST ITEM:C378(*; This:C1470.name; $itemPos; $itemRef; $itemText; $sublist; $expanded) - - End if - - End if - - Case of - - //______________________________________________________ - : ($request="value") - - return $itemText - - //______________________________________________________ - : ($request="ref") - - return $itemRef - - //______________________________________________________ - : ($request="sublist") - - return $sublist - - //______________________________________________________ - : ($request="expanded") - - return $expanded - - //______________________________________________________ - End case - - // *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** - /// Sets information of the element itemPos or the current element if omitted -Function _setItem($request : Text; $value; $itemPos : Integer) - - var $icon : Picture - - If ($request="icon") - - If ($itemPos=0) - - SET LIST ITEM ICON:C950(*; This:C1470.name; *; $icon) - - Else - - SET LIST ITEM ICON:C950(*; This:C1470.name; $itemPos; $icon) - - End if - - Else - - If ($itemPos=0) - - GET LIST ITEM:C378(*; This:C1470.name; *; $itemRef; $itemText; $sublist; $expanded) - - Else - - GET LIST ITEM:C378(*; This:C1470.name; $itemPos; $itemRef; $itemText; $sublist; $expanded) - - End if - - Case of - - //______________________________________________________ - : ($request="value") - - SET LIST ITEM:C385(*; This:C1470.name; *; $value; $itemRef; $sublist; $expanded) - - //______________________________________________________ - : ($request="ref") - - SET LIST ITEM:C385(*; This:C1470.name; *; $itemText; $value; $sublist; $expanded) - - //______________________________________________________ - : ($request="sublist") - - SET LIST ITEM:C385(*; This:C1470.name; *; $itemText; $itemRef; $value; $expanded) - - //______________________________________________________ - : ($request="expanded") - - SET LIST ITEM:C385(*; This:C1470.name; *; $itemText; $itemRef; $sublist; $value) - - //______________________________________________________ - End case - End if - - // MARK:-[Find] - // === === === === === === === === === === === === === === === === === === === === === === === === - /// Returns the position of the first item value -Function findPosition($itemText : Text; $scope : Integer) : Integer - - return Find in list:C952(*; This:C1470.name; $itemText; $scope) - - // === === === === === === === === === === === === === === === === === === === === === === === === - /// Returns the reference of the first item value -Function findReference($itemText : Text; $scope : Integer) : Integer - - return Find in list:C952(*; This:C1470.name; $itemText; $scope; *) - - // MARK:-[Selection] - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> - /// A collection of indexes of selected items -Function get selectedItemIndexes() : Collection - - var $dummy : Integer - var $c : Collection - $c:=New collection:C1472 - - ARRAY LONGINT:C221($selected; 0) - $dummy:=Selected list items:C379(*; This:C1470.name; $selected) - - ARRAY TO COLLECTION:C1563($c; $selected) - - return $c - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> - /// A collection of refernces of selected items -Function get selectedItemReferences() : Collection - - var $dummy : Integer - var $c : Collection - $c:=New collection:C1472 - - ARRAY LONGINT:C221($selected; 0) - $dummy:=Selected list items:C379(*; This:C1470.name; $selected; *) - - ARRAY TO COLLECTION:C1563($c; $selected) - - return $c - - // <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> <==> - /// Selects the item whose item position is passed -Function selectByPosition($itemPos : Integer) - - // TODO: Accept a collection of positions - - If ($itemPos>0) - - SELECT LIST ITEMS BY POSITION:C381(*; This:C1470.name; $itemPos) - OBJECT SET SCROLL POSITION:C906(*; This:C1470.name; $itemPos) - - Else - - This:C1470.unselect() - - End if - - // === === === === === === === === === === === === === === === === === === === === === === === === - /// Selects the item whose item reference is passed -Function selectByReference($itemRef : Integer) - - // TODO: Accept a collection of references - - // โš ๏ธ SELECT LIST ITEMS BY REFERENCE doesn't accept object name - This:C1470.selectByPosition(This:C1470.getItemPositionByRef($itemRef)) - - // === === === === === === === === === === === === === === === === === === === === === === === === - /// Deselect all items -Function selectAll() - - var $focused : Text - $focused:=OBJECT Get name:C1087(Object with focus:K67:3) - GOTO OBJECT:C206(*; This:C1470.name) - INVOKE ACTION:C1439(ak select all:K76:57; ak current form:K76:70) - GOTO OBJECT:C206(*; $focused) - - // === === === === === === === === === === === === === === === === === === === === === === === === - /// Deselect all items -Function unselect() - - SELECT LIST ITEMS BY POSITION:C381(*; This:C1470.name; This:C1470.itemCount+1) - \ No newline at end of file diff --git a/Project/Sources/Classes/process.4dm b/Project/Sources/Classes/process.4dm new file mode 100644 index 0000000..5242b0a --- /dev/null +++ b/Project/Sources/Classes/process.4dm @@ -0,0 +1,32 @@ +Class constructor + + // + + // === === === === === === === === === === === === === === === === === === === === === === === === === === +Function getRunningUserProcesses() : Collection + + var $c : Collection:=Process activity:C1495(Processes only:K5:35).processes + return $c.query("state >= :1 & type > 0"; Executing:K13:4) + + // === === === === === === === === === === === === === === === === === === === === === === === === === === +Function isProcessRunning($name : Text) : Boolean + + return This:C1470.getRunningUserProcesses().query("name = :1"; $name).pop()#Null:C1517 + + // === === === === === === === === === === === === === === === === === === === === === === === === === === +Function isProcessExists($name : Text; $bringToFront : Boolean) : Boolean + + var $process : Object:=This:C1470.getRunningUserProcesses().query("name = :1"; $name).first() + + If ($process#Null:C1517) + + If ($bringToFront) + + SHOW PROCESS:C325($process.number) + BRING TO FRONT:C326($process.number) + + End if + + return True:C214 + + End if \ No newline at end of file diff --git a/Project/Sources/Classes/static.4dm b/Project/Sources/Classes/static.4dm index eac490d..b2283c8 100644 --- a/Project/Sources/Classes/static.4dm +++ b/Project/Sources/Classes/static.4dm @@ -669,7 +669,7 @@ Function set visible($visible : Boolean) OBJECT SET VISIBLE:C603(*; This:C1470.name; $visible) // === === === === === === === === === === === === === === === === === === === === === === === === === === -Function show($state : Boolean) : cs:C1710.static +Function show($state : Boolean) : cs:C1710.widget OBJECT SET VISIBLE:C603(*; This:C1470.name; Count parameters:C259=0 ? True:C214 : $state) return This:C1470 diff --git a/Project/Sources/Classes/tools.4dm b/Project/Sources/Classes/tools.4dm index e6c9033..b9eab57 100644 --- a/Project/Sources/Classes/tools.4dm +++ b/Project/Sources/Classes/tools.4dm @@ -4,11 +4,13 @@ Common tools to have at hand */ +property success : Boolean:=False:C215 +property lastError : Text:="" +property errors : Collection:=[] + Class constructor - This:C1470.success:=False:C215 - This:C1470.lastError:="" - This:C1470.errors:=[] + // // === === === === === === === === === === === === === === === === === === === === === === === === === === Function clone($class : Object) : Object @@ -18,37 +20,31 @@ Function clone($class : Object) : Object // === === === === === === === === === === === === === === === === === === === === === === === === === === Function first($c : Collection) : Variant - If ($c#Null:C1517) + If ($c#Null:C1517)\ + && ($c.length>0) + + return $c[0] - If ($c.length>0) - - return $c[0] - - End if End if // === === === === === === === === === === === === === === === === === === === === === === === === === === Function last($c : Collection) : Variant - If ($c#Null:C1517) + If ($c#Null:C1517)\ + && ($c.length>0) + + return $c[$c.length-1] - If ($c.length>0) - - return $c[$c.length-1] - - End if End if // === === === === === === === === === === === === === === === === === === === === === === === === === === Function next($c : Collection; $current : Integer) : Variant - If ($c#Null:C1517) + If ($c#Null:C1517)\ + && ($c.length>$current) + + return $c[$current+1] - If ($c.length>$current) - - return $c[$current+1] - - End if End if // === === === === === === === === === === === === === === === === === === === === === === === === === === @@ -64,7 +60,6 @@ Function lep($command : Text; $inputStream) : Object var $error; $out : Text var $len; $pid; $pos : Integer - var $o : Object Case of @@ -92,7 +87,7 @@ Function lep($command : Text; $inputStream) : Object //______________________________________________________ End case - $o:={success: False:C215} + var $o : Object:={success: False:C215} SET ENVIRONMENT VARIABLE:C812("_4D_OPTION_HIDE_CONSOLE"; "true") LAUNCH EXTERNAL PROCESS:C811($command; $inputStream; $out; $error; $pid) diff --git a/Project/Sources/Classes/xliffGroup.4dm b/Project/Sources/Classes/xliffGroup.4dm index 5db4d71..c9029ab 100644 --- a/Project/Sources/Classes/xliffGroup.4dm +++ b/Project/Sources/Classes/xliffGroup.4dm @@ -1,80 +1,85 @@ -Class constructor($node : Text; $attributes : Object) - /* The element specifies a set of elements that should be processed together. For example: all the items of a menu, etc. Note that a element can contain other elements. The element can be used to describe the hierarchy of the file. - + The optional id attribute is used to uniquely identify the within the same . - + The optional datatype attribute specifies the data type of the content of the ; e.g. "winres" for Windows resources. The optional xml:space attribute is used to specify how white-spaces are to be treated within the . - + The optional restype, resname, extradata, help-id, menu , menu-option, menu-name, coord, font, css-style, style, exstyle, and extype attributes describe the resources contained within the . - + The optional translate attribute provides a default value for all elements contained within the . - + The optional reformat attribute specifies whether and which attributes can be modified for the elements of the . - + The optional maxbytes and minbytes attributes specify the required maximum and minimum number of bytes for the translation units within the . The optional size-unit attribute determines the unit for the optional maxheight, minheight, maxwidth, and minwidth attributes, which limit the size of the resource described by the . - + The optional charclass attribute restricts all translation units in the scope of the to a subset of characters. - + The optional merged-trans attribute indicates if the group element contains merged elements. - + The optional ts attribute was DEPRECATED in XLIFF 1.1. - + Lists of values for the datatype, restype, and size-unit attributes are provided by this specification. - + Required attributes: - + None. - + Optional attributes: - + id, datatype, xml:space, ts, , , extradata, help-id, menu, menu- option , menu-name, coord, font, css-style, style, exstyle, extype, translate, reformat , maxbytes, minbytes, size-unit, maxheight, minheight, maxwidth , minwidth, charclass, merged-trans, non-XLIFF attributes - + Contents: - + Zero, one or more elements, followed by Zero, one or more elements, followed by Zero, one or more elements, followed by Zero, one or more elements, followed by Zero, one or more non-XLIFF elements, followed by Zero, one or more , , elements, in any order. - + All , , , and non-XLIFF elements pertain to the subsequent elements in the tree but can be overridden within a child element. */ + +property node; resname; xpath : Text +property attributes : Object +property isconstant : Boolean + +property transunits : Collection:=[] + +// MARK: Constants ๐Ÿ” +property XPATH_PATTERN : Text:="(?mi-s)(?<=group\\[@resname=\")([^\"]*)" + +Class constructor($node : Text; $attributes : Object) This:C1470.node:=$node - This:C1470.attributes:=$attributes || New object:C1471 + This:C1470.attributes:=$attributes || {} This:C1470.resname:=String:C10(This:C1470.attributes.resname) - This:C1470.XPATH:=String:C10($attributes.XPATH) + This:C1470.xpath:=String:C10($attributes.xpath) This:C1470.isconstant:=String:C10(This:C1470.attributes.restype)="x-4DK#" - This:C1470.transunits:=[] - - This:C1470._xpathPattern:="(?mi-s)(?<=group\\[@resname=\")([^\"]*)" - // === === === === === === === === === === === === === === === === === === === === === === === === Function setResname($resname : Text) @@ -83,9 +88,9 @@ Function setResname($resname : Text) This:C1470.resname:=$resname This:C1470.attributes.resname:=$resname - If (Match regex:C1019(This:C1470._xpathPattern; This:C1470.XPATH; 1; $pos; $len)) + If (Match regex:C1019(This:C1470.XPATH_PATTERN; This:C1470.xpath; 1; $pos; $len)) - This:C1470.XPATH:=Substring:C12(This:C1470.XPATH; 1; $pos-1)+$resname+Substring:C12(This:C1470.XPATH; $pos+$len) + This:C1470.xpath:=Substring:C12(This:C1470.xpath; 1; $pos-1)+$resname+Substring:C12(This:C1470.xpath; $pos+$len) End if @@ -99,23 +104,23 @@ Function updateTransunits() For each ($unit; This:C1470.transunits) - If (Match regex:C1019(This:C1470._xpathPattern; $unit.XPATH; 1; $pos; $len)) + If (Match regex:C1019(This:C1470.XPATH_PATTERN; $unit.xpath; 1; $pos; $len)) - $unit.XPATH:=Substring:C12($unit.XPATH; 1; $pos-1)+This:C1470.resname+Substring:C12($unit.XPATH; $pos+$len) + $unit.xpath:=Substring:C12($unit.xpath; 1; $pos-1)+This:C1470.resname+Substring:C12($unit.xpath; $pos+$len) End if - If (Match regex:C1019(This:C1470._xpathPattern; $unit.source.XPATH; 1; $pos; $len)) + If (Match regex:C1019(This:C1470.XPATH_PATTERN; $unit.source.xpath; 1; $pos; $len)) - $unit.source.XPATH:=Substring:C12($unit.source.XPATH; 1; $pos-1)+This:C1470.resname+Substring:C12($unit.source.XPATH; $pos+$len) + $unit.source.xpath:=Substring:C12($unit.source.xpath; 1; $pos-1)+This:C1470.resname+Substring:C12($unit.source.xpath; $pos+$len) End if If ($unit.target#Null:C1517) - If (Match regex:C1019(This:C1470._xpathPattern; $unit.target.XPATH; 1; $pos; $len)) + If (Match regex:C1019(This:C1470.XPATH_PATTERN; $unit.target.xpath; 1; $pos; $len)) - $unit.target.XPATH:=Substring:C12($unit.target.XPATH; 1; $pos-1)+This:C1470.resname+Substring:C12($unit.target.XPATH; $pos+$len) + $unit.target.xpath:=Substring:C12($unit.target.xpath; 1; $pos-1)+This:C1470.resname+Substring:C12($unit.target.xpath; $pos+$len) End if End if @@ -129,27 +134,27 @@ Function setAttributes($attributes : Object) This:C1470.attributes:=$attributes This:C1470.resname:=String:C10(This:C1470.attributes.resname) - This:C1470.XPATH:=String:C10($attributes.XPATH) + This:C1470.xpath:=String:C10($attributes.xpath) For each ($unit; This:C1470.transunits) - If (Match regex:C1019(This:C1470._xpathPattern; $unit.XPATH; 1; $pos; $len)) + If (Match regex:C1019(This:C1470.XPATH_PATTERN; $unit.xpath; 1; $pos; $len)) - $unit.XPATH:=Substring:C12($unit.XPATH; 1; $pos-1)+This:C1470.resname+Substring:C12($unit.XPATH; $pos+$len) + $unit.xpath:=Substring:C12($unit.xpath; 1; $pos-1)+This:C1470.resname+Substring:C12($unit.xpath; $pos+$len) End if - If (Match regex:C1019(This:C1470._xpathPattern; $unit.source.XPATH; 1; $pos; $len)) + If (Match regex:C1019(This:C1470.XPATH_PATTERN; $unit.source.xpath; 1; $pos; $len)) - $unit.source.XPATH:=Substring:C12($unit.source.XPATH; 1; $pos-1)+This:C1470.resname+Substring:C12($unit.source.XPATH; $pos+$len) + $unit.source.xpath:=Substring:C12($unit.source.xpath; 1; $pos-1)+This:C1470.resname+Substring:C12($unit.source.xpath; $pos+$len) End if If ($unit.target#Null:C1517) - If (Match regex:C1019(This:C1470._xpathPattern; $unit.target.XPATH; 1; $pos; $len)) + If (Match regex:C1019(This:C1470.XPATH_PATTERN; $unit.target.xpath; 1; $pos; $len)) - $unit.target.XPATH:=Substring:C12($unit.target.XPATH; 1; $pos-1)+This:C1470.resname+Substring:C12($unit.target.XPATH; $pos+$len) + $unit.target.xpath:=Substring:C12($unit.target.xpath; 1; $pos-1)+This:C1470.resname+Substring:C12($unit.target.xpath; $pos+$len) End if End if diff --git a/Project/Sources/Classes/xliffUnit.4dm b/Project/Sources/Classes/xliffUnit.4dm index 238dd57..1b36f02 100644 --- a/Project/Sources/Classes/xliffUnit.4dm +++ b/Project/Sources/Classes/xliffUnit.4dm @@ -1,9 +1,7 @@ -Class constructor($node : Text; $attributes : Object) - /* The elements contains a , and associated elements. - + The required id attribute is used to uniquely identify the within all and elements within the same . The optional approved attribute indicates whether the translation has been approved by a @@ -29,46 +27,48 @@ are provided by this specification. During translation the content of the element may be duplicated into a element, in which additional segmentation related markup is introduced. See the Segmentation section for more information. - + Required attributes: - + - + Optional attributes: - + approved, translate, reformat, xml:space , datatype, ts, phase-name , , , extradata , help-id, menu, menu-option , menu-name, coord, font, css- style, style, exstyle, extype, maxbytes, minbytes , size-unit, maxheight, minheight, maxwidth, minwidth , charclass, non-XLIFF attributes - + Contents: - + One element, followed by Zero or one element, followed by Zero or one element, followed by Zero, one or more , , , , elements, in any order, followed by Zero, one or more non-XLIFF elements. - + All child elements of pertain to their sibling element. While for backward compatibility reasons no order is enforced for the elements before the non-XLIFF elements, the recommended order is the one in which they are listed here. */ + +property node; resname; xpath; id; note : Text +property attributes; source; target : Object +property noTranslate : Boolean + +Class constructor($node : Text; $attributes : Object) + This:C1470.node:=$node - This:C1470.attributes:=$attributes || New object:C1471 + This:C1470.attributes:=$attributes || {} This:C1470.resname:=String:C10(This:C1470.attributes.resname) - This:C1470.XPATH:=String:C10($attributes.XPATH) + This:C1470.xpath:=String:C10($attributes.xpath) This:C1470.id:=String:C10(This:C1470.attributes.id) This:C1470.noTranslate:=Bool:C1537(This:C1470.attributes.translate="no") - This:C1470.source:=New object:C1471(\ - "value"; ""; \ - "XPATH"; "") - - This:C1470.target:=New object:C1471(\ - "value"; ""; \ - "XPATH"; "") + This:C1470.source:={value: ""; xpath: ""} + This:C1470.target:={value: ""; xpath: ""} This:C1470.note:="" \ No newline at end of file diff --git a/Project/Sources/Forms/STRING/form.4DForm b/Project/Sources/Forms/STRING/form.4DForm index e054bf8..b584f21 100755 --- a/Project/Sources/Forms/STRING/form.4DForm +++ b/Project/Sources/Forms/STRING/form.4DForm @@ -286,7 +286,6 @@ "views": { "default": {}, "NOTE": { - "visible": false, "objects": [ "NOTE" ] diff --git a/Project/Sources/Methods/EDITOR CALLBACK.4dm b/Project/Sources/Methods/EDITOR CALLBACK.4dm index 69e9239..93941ee 100644 --- a/Project/Sources/Methods/EDITOR CALLBACK.4dm +++ b/Project/Sources/Methods/EDITOR CALLBACK.4dm @@ -1,8 +1,7 @@ //%attributes = {"invisible":true} #DECLARE($function : Text; $data : Object) -var $instance : 4D:C1709.Class -$instance:=formGetInstance +var $instance : 4D:C1709.Class:=formGetInstance If (Asserted:C1132(OB Instance of:C1731($instance[$function]; 4D:C1709.Function); "The function \""+$function+"\" is missing in the class\""+$instance.__CLASS__.name+"\"")) diff --git a/Project/Sources/Methods/EDITOR OPEN.4dm b/Project/Sources/Methods/EDITOR OPEN.4dm index a4ba7cc..85a94e0 100644 --- a/Project/Sources/Methods/EDITOR OPEN.4dm +++ b/Project/Sources/Methods/EDITOR OPEN.4dm @@ -1,13 +1,10 @@ //%attributes = {"invisible":true} #DECLARE($run : Boolean) -var $data : Object -var $database : cs:C1710.database - -$database:=cs:C1710.database.new() +var $name : Text:="$4DPop XLIFF Pro" If (Not:C34($run))\ - && ($database.isProcessExists("$4DPop XLIFF Pro"; True:C214)) + && (cs:C1710.process.new().isProcessExists($name; True:C214)) return @@ -15,6 +12,8 @@ End if If ($run) + var $database : cs:C1710.database:=cs:C1710.database.new() + // Allow assertions for the matrix database & me ;-) SET ASSERT ENABLED:C1131($database.isMatrix | $database.isDebug; *) @@ -24,13 +23,11 @@ If ($run) End if - $data:=New object:C1471(\ - "window"; Open form window:C675("EDITOR"; Plain form window:K39:10; Horizontally centered:K39:1; Vertically centered:K39:4; *)) - + var $data : Object:={window: Open form window:C675("EDITOR"; Plain form window:K39:10; Horizontally centered:K39:1; Vertically centered:K39:4; *)} DIALOG:C40("EDITOR"; $data; *) Else - CALL WORKER:C1389("$4DPop XLIFF Pro"; Current method name:C684; True:C214) + CALL WORKER:C1389($name; Current method name:C684; True:C214) End if \ No newline at end of file diff --git a/Project/Sources/Methods/dropableWidgetMethod.4dm b/Project/Sources/Methods/dropableWidgetMethod.4dm index 31b4fae..15dbea6 100644 --- a/Project/Sources/Methods/dropableWidgetMethod.4dm +++ b/Project/Sources/Methods/dropableWidgetMethod.4dm @@ -1,11 +1,8 @@ //%attributes = {"invisible":true,"shared":true} #DECLARE() : Integer -var $manager : Text -var $instance : 4D:C1709.Class - -$manager:="_"+OBJECT Get name:C1087+"Manager" -$instance:=formGetInstance +var $manager : Text:="_"+OBJECT Get name:C1087+"Manager" +var $instance : 4D:C1709.Class:=formGetInstance If (Asserted:C1132(OB Instance of:C1731($instance[$manager]; 4D:C1709.Function); "The function \""+$manager+"\" is missing in the class\""+$instance.__CLASS__.name+"\"")) diff --git a/Project/Sources/Methods/formCallBack.4dm b/Project/Sources/Methods/formCallBack.4dm index 2ea019e..048ee1e 100644 --- a/Project/Sources/Methods/formCallBack.4dm +++ b/Project/Sources/Methods/formCallBack.4dm @@ -1,10 +1,9 @@ //%attributes = {"invisible":true} #DECLARE($data : Object; $function : Text) -var $instance : 4D:C1709.Class - $function:=Length:C16($function)>0 ? $function : "callback" -$instance:=formGetInstance + +var $instance : 4D:C1709.Class:=formGetInstance If (Asserted:C1132(OB Instance of:C1731($instance[$function]; 4D:C1709.Function); "The function \""+$function+"\" is missing in the class\""+$instance.__CLASS__.name+"\"")) diff --git a/Project/Sources/Methods/formMenuHandle.4dm b/Project/Sources/Methods/formMenuHandle.4dm index 6bfbff5..361be45 100644 --- a/Project/Sources/Methods/formMenuHandle.4dm +++ b/Project/Sources/Methods/formMenuHandle.4dm @@ -1,9 +1,6 @@ //%attributes = {"invisible":true} -var $manager : Text -var $instance : 4D:C1709.Class - -$manager:="handleMenus" -$instance:=formGetInstance +var $manager : Text:="handleMenus" +var $instance : 4D:C1709.Class:=formGetInstance If (Asserted:C1132(OB Instance of:C1731($instance[$manager]; 4D:C1709.Function); "The function \""+$manager+"\" is missing in the class\""+$instance.__CLASS__.name+"\"")) diff --git a/Project/Sources/Methods/subformWidgetMethod.4dm b/Project/Sources/Methods/subformWidgetMethod.4dm index f72e61e..2103781 100644 --- a/Project/Sources/Methods/subformWidgetMethod.4dm +++ b/Project/Sources/Methods/subformWidgetMethod.4dm @@ -18,7 +18,7 @@ If (Not:C34(OB Instance of:C1731($instance[$manager]; 4D:C1709.Function)))\ End if End if -If (OB Instance of:C1731($instance[$manager]; 4D:C1709.Function)) +If (Asserted:C1132(OB Instance of:C1731($instance[$manager]; 4D:C1709.Function); "The function \""+$manager+"\" is missing in the class\""+$instance.__CLASS__.name+"\"")) $instance[$manager](FORM Event:C1606) diff --git a/Project/Sources/folders.json b/Project/Sources/folders.json index 61b98b0..172ec9c 100755 --- a/Project/Sources/folders.json +++ b/Project/Sources/folders.json @@ -29,7 +29,9 @@ "๐Ÿ‘ฅ NAMESPACE": { "classes": [ "Preferences", - "Xliff" + "Xliff", + "xliffGroup", + "xliffUnit" ] }, "๐Ÿ‘ฉโ€๐Ÿ’ป UI": { @@ -37,6 +39,7 @@ "COMPILER_UI", "dropableWidgetMethod", "form_spreadToSubforms", + "formCallBack", "formGetInstance", "formMenuHandle", "formMethod",