Merging together

Previous topic - Next topic

founder

I use in my document layers to have different language versions.

Until only German and English all done by myself.

Now is my translator for Spanish here.

So there will be soon the problem to merge together documents.

I continue to work on the English version
He creates the spanish version.

So I have soon the following problems:

Import all items on layer "Spanish" from his document

Merge attributes

For example there is a picture with attributes

Attribute picture "This is the English description of the picture

and he ads

Attribute picture_ES "This is the spanish description of the picture

So some sort of script should do this job



Founder of PEGE - Planetary Engineering Group Earth https://www.pege.org
Founder and CEO of https://gemini-next-generation.house

founder

Quote from: founder on September 29, 2012, 02:16:01 PM
I use in my document layers to have different language versions.

It would be helpfull to have a documentation about the XML document.

But all I found by Google

Document Structure for Scribus File Format as of V 0.8 (stable) 7 Oct. 2002 :o

Could somebody point me to a more actual version of the file structure?
Founder of PEGE - Planetary Engineering Group Earth https://www.pege.org
Founder and CEO of https://gemini-next-generation.house

a.l.e

one hint: don't mess with the .sla files directly :-)

i don't think that there is a real documentation for the file format.

but there are plans -- and work bing done -- to move to a new file format which will be documented (and will be real xml)

personally, going through some scripting (and eventually extend the scripter) seems to be a better way to solve your problems...

ciao
a.l.e

founder

Quote from: a.l.e on October 15, 2012, 04:03:31 PM
one hint: don't mess with the .sla files directly :-)

I just learned about this on the hard way.

The theory:

Take from my file all objects not spanish
Take from the translators file all objects in spanish
Merge them together.

Should work all fine, because only the TOC has chained text.
All text frames from the TOC are named

TOC
TOC01
TOC02 and so on for the english TOC

TOC_ES
TOC_ES01
TOC_ES02 and so on for the spanish TOC

The text flow was from TOC_ES to TOC_ES01 and so on.

So everything should work fine.

But they use not like expected the given names for the text flow chain

They use
NEXTITEM="2938" BACKITEM="2584"

So I completely messed up the text chain.

To cope with the situation: Unlink all text chain, for luck only used in the TOC
put all this items in the first part of the file, so the position number remains unchanged
at merge operations.
Exclude named frames from the spanish merge, so they remain at the same place

Founder of PEGE - Planetary Engineering Group Earth https://www.pege.org
Founder and CEO of https://gemini-next-generation.house

Nermander

From what I understand that is the major problem with the old SLA format: It is not structured according to the layout but instead uses attributes for the structure.


founder

Quote from: Nermander on October 17, 2012, 02:11:59 PM
From what I understand that is the major problem with the old SLA format: It is not structured according to the layout but instead uses attributes for the structure.

The problem is ony with NEXTITEM BACKITEM for text chains.
They use number references instead of the names given.

I just successfull recreated the TOC structure with UltraEdit after I had removed all text chains with ultraedit.
This can be done by seting NETXITEM BACKITEM to -1

All TOC items are now just the first PAGEOBJECT s in the XML.

Some replaces are with UltraEdit far faster.
For example I just replaced 288 ' against '
After this operation, I loaded the document again with Scribus and had only to correct 2 text frame overvlow errors because the ' takes more space than '
Founder of PEGE - Planetary Engineering Group Earth https://www.pege.org
Founder and CEO of https://gemini-next-generation.house

a.l.e

hi,

from what you've described until now, it looks like you should write a python script running inside of scribus, which would read your spanish files and insert at the right place...

well, if i have to be honest, i don't understand why you don't just load the spanish content... or simply copy paste it into the document...

ciao
a.l.e

founder

Quote from: a.l.e on October 17, 2012, 10:33:27 PM
hi,

from what you've described until now, it looks like you should write a python script running inside of scribus, which would read your spanish files and insert at the right place...

well, if i have to be honest, i don't understand why you don't just load the spanish content... or simply copy paste it into the document...

ciao
a.l.e

I did not find examples and documentation for this. Maybe it's easy to find and I just didn't see it.
So I decided for the most easy way.

The same with spell checking. I wrote a Perl Script to extract all text from a given layer to a text file.
This was the fastest way to make spell checking possible.
Founder of PEGE - Planetary Engineering Group Earth https://www.pege.org
Founder and CEO of https://gemini-next-generation.house