Skip to content

Commit

Permalink
bf
Browse files Browse the repository at this point in the history
  • Loading branch information
vdelachaux committed Sep 29, 2023
1 parent 3685b12 commit 34d2f94
Show file tree
Hide file tree
Showing 49 changed files with 544 additions and 268 deletions.
Binary file modified Build/4DPop XLIFF Pro.4dbase.zip
Binary file not shown.
Binary file modified Build/Components/4DPop XLIFF Pro.4dbase/4DPop XLIFF Pro.4DZ
Binary file not shown.
8 changes: 4 additions & 4 deletions Build/Components/4DPop XLIFF Pro.4dbase/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
<key>CFBundleIdentifier</key>
<string>com.4D.4DPop XLIFF Pro</string>
<key>CFBundleGetInfoString</key>
<string>20R3</string>
<string>20R4</string>
<key>CFBundleLongVersionString</key>
<string>20R3 (91)</string>
<string>20R4 (96)</string>
<key>CFBundleName</key>
<string>4DPop XLIFF Pro</string>
<key>CFBundleDevelopmentRegion</key>
<string>French</string>
<key>CFBundleDisplayName</key>
<string>4DPop XLIFF Pro</string>
<key>CFBundleVersion</key>
<string>92</string>
<string>97</string>
<key>CFBundleShortVersionString</key>
<string>20R3</string>
<string>20R4</string>
<key>CFBundleExecutable</key>
<string>4DPop XLIFF Pro</string>
</dict>
Expand Down
Binary file not shown.
Binary file not shown.
8 changes: 4 additions & 4 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
<key>CFBundleIdentifier</key>
<string>com.4D.4DPop XLIFF Pro</string>
<key>CFBundleGetInfoString</key>
<string>20R3</string>
<string>20R4</string>
<key>CFBundleLongVersionString</key>
<string>20R3 (91)</string>
<string>20R4 (96)</string>
<key>CFBundleName</key>
<string>4DPop XLIFF Pro</string>
<key>CFBundleDevelopmentRegion</key>
<string>French</string>
<key>CFBundleDisplayName</key>
<string>4DPop XLIFF Pro</string>
<key>CFBundleVersion</key>
<string>92</string>
<string>97</string>
<key>CFBundleShortVersionString</key>
<string>20R3</string>
<string>20R4</string>
<key>CFBundleExecutable</key>
<string>4DPop XLIFF Pro</string>
</dict>
Expand Down
3 changes: 2 additions & 1 deletion Preferences/4DPop AppMaker.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<appMaker>
<info.plist CFBundleGetInfoString="DEV" CFBundleLongVersionString="0.0" CFBundleShortVersionString="0" NSHumanReadableCopyright="©vdl 2020-{CurrentYear}"/>
<options close="true" delete_mac_content="true" increment_version="true" notarize="true"/>
<methods/>
<copy>
<array>
Expand Down Expand Up @@ -54,4 +53,6 @@
<item>./Resources/ja.lproj/zzz.xlf</item>
</array>
</delete>
<reveal path="./"/>
<options close="true" delete_mac_content="true" increment_version="true" notarize="true"/>
</appMaker>
60 changes: 40 additions & 20 deletions Project/Sources/Classes/Preferences.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ Class constructor($version : Text)

Else

This:C1470.data:=New object:C1471("version"; This:C1470.version)
This:C1470.data:=New object:C1471(\
"version"; This:C1470.version)

End if

Expand All @@ -43,22 +44,41 @@ Function _save()
// === === === === === === === === === === === === === === === === === === ===
Function _update()

Case of

//______________________________________________________
: (This:C1470.data.version=Null:C1517)

This:C1470.data.version:=This:C1470.version

OB REMOVE:C1226(This:C1470.data; "file")
OB REMOVE:C1226(This:C1470.data; "files")
OB REMOVE:C1226(This:C1470.data; "languages")
OB REMOVE:C1226(This:C1470.data; "digest")

//______________________________________________________
: (This:C1470.data.version="3.0") // Update to 3.1 or higher

//

//______________________________________________________
End case
var $version : Text
$version:=This:C1470.data.version || ""

Repeat

Case of

//______________________________________________________
: ($version="")

OB REMOVE:C1226(This:C1470.data; "file")
OB REMOVE:C1226(This:C1470.data; "files")
OB REMOVE:C1226(This:C1470.data; "languages")
OB REMOVE:C1226(This:C1470.data; "digest")

$version:="3.0"

//______________________________________________________
: ($version="3.0")

fixIDsWithSlashes

$version:="3.1"

//______________________________________________________
: ($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()

End if
3 changes: 2 additions & 1 deletion Project/Sources/Classes/_EDITOR_Controller.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Class constructor($mainLanguage : Text)
This:C1470.folderExtension:=".lproj"

This:C1470.generator:=File:C1566(Structure file:C489; fk platform path:K87:2).name
This:C1470.version:="3.0"
This:C1470.version:="3.1"

// TODO:Could be a preference
This:C1470.autoSave:=True:C214 // Flag for automatic saving
Expand Down Expand Up @@ -1698,6 +1698,7 @@ Function _LOAD_STRINGS()
var $unit : cs:C1710.Transunit
var $main : cs:C1710.Xliff

//FIXME:Optimize
ARRAY TEXT:C222($groupResnames; 0x0000)
ARRAY TEXT:C222($stringResnames; 0x0000)
ARRAY OBJECT:C1221($units; 0x0000)
Expand Down
11 changes: 4 additions & 7 deletions Project/Sources/Classes/_STRING_Controller.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Function handleEvents($e : cs:C1710.evt)
Case of

//==============================================
: (This:C1470.resname.catch($e))
: (This:C1470.resname.catch($e; On Losing Focus:K2:8))

This:C1470._resnameManager($e)

Expand Down Expand Up @@ -199,6 +199,8 @@ Function update()

$string:=$parent.stringList.item

ASSERT:C1129($string#Null:C1517)

// Set shortcuts
Form:C1466.main:=$parent.main
Form:C1466.string:=$string
Expand Down Expand Up @@ -367,7 +369,7 @@ Function _resnameManager($e : cs:C1710.evt)

If ($e.code#On Losing Focus:K2:8)

ASSERT:C1129(False:C215; "Form event activated unnecessarily ("+$e.description+")")
//ASSERT(False; "Form event activated unnecessarily ("+$e.description+")")
return

End if
Expand Down Expand Up @@ -573,11 +575,6 @@ Function _sourceManager($e : cs:C1710.evt)

This:C1470.updateSource()

//______________________________________________________
Else

ASSERT:C1129(False:C215; "Form event activated unnecessarily ("+$e.description+")")

//______________________________________________________
End case

Expand Down
43 changes: 41 additions & 2 deletions Project/Sources/Classes/database.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,11 @@ Function compile($options : Object) : Boolean

End if

This:C1470.errors:=$compile.errors.query("isError = :1"; True:C214)
Use (This:C1470[""].errors)

This:C1470[""].errors:=$compile.errors.query("isError = :1"; True:C214).copy(ck shared:K85:29; This:C1470[""].errors)

End use

return $compile.success

Expand Down Expand Up @@ -452,4 +456,39 @@ Function _restart($compiled : Boolean; $userParam) : Object
$signal.wait()

return $signal.result
//%W+550.2
//%W+550.2

//MARK:-[PROCESSES]
// === === === === === === === === === === === === === === === === === === === === === === === === === ===
Function getRunningUserProcesses() : Collection

var $c : Collection

$c:=Get 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

$process:=This:C1470.getRunningUserProcesses().query("name = :1"; $name).pop()

If ($process#Null:C1517)

If ($bringToFront)

SHOW PROCESS:C325($process.number)
BRING TO FRONT:C326($process.number)

End if

return True:C214

End if
3 changes: 2 additions & 1 deletion Project/Sources/Classes/listboxDelegate.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,8 @@ Function cellPosition($e : cs:C1710.evt) : Object
| ($e.code=On Double Clicked:K2:5)\
| ($e.code=On Selection Change:K2:29)\
| ($e.code=On Expand:K2:41)\
| ($e.code=On Delete Action:K2:56)
| ($e.code=On Delete Action:K2:56)\
| ($e.code=On Losing Focus:K2:8)

// ⚠️ Column is always 0
LISTBOX GET CELL POSITION:C971(*; This:C1470.name; $column; $row)
Expand Down
11 changes: 9 additions & 2 deletions Project/Sources/Methods/EDITOR OPEN.4dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@
var $data : Object
var $database : cs:C1710.database

If ($run)
$database:=cs:C1710.database.new()

If (Not:C34($run))\
&& ($database.isProcessExists("$4DPop XLIFF Pro"; True:C214))

return

$database:=cs:C1710.database.new()
End if

If ($run)

// Allow assertions for the matrix database & me ;-)
SET ASSERT ENABLED:C1131($database.isMatrix | $database.isDebug; *)
Expand Down
24 changes: 24 additions & 0 deletions Project/Sources/Methods/fixIDsWithSlashes.4dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//%attributes = {}
var $id; $node : Text
var $folder : 4D:C1709.Folder
var $file : 4D:C1709.File
var $xml : cs:C1710.xml

For each ($folder; Folder:C1567("/RESOURCES/"; *).folders().query("extension=.lproj"))

For each ($file; $folder.files().query("extension = .xlf"))

$xml:=cs:C1710.xml.new($file)

For each ($node; $xml.find("/xliff/file/body/group/trans-unit"))

$id:=String:C10($xml.getAttribute($node; "id"))
$xml.setAttribute($node; "id"; Split string:C1554($id; "/").join("_"))

End for each

$xml.save()
$xml.close()

End for each
End for each
Loading

0 comments on commit 34d2f94

Please sign in to comment.