Author Topic: Merging together  (Read 3608 times)

founder

  • Full Member
  • ***
  • Posts: 113
  • Karma: 0
Merging together
« on: September 29, 2012, 03:16:01 pm »
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

  • Full Member
  • ***
  • Posts: 113
  • Karma: 0
Searching a documentation about the XML
« Reply #1 on: October 15, 2012, 04:23:49 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?

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2109
  • Karma: 27
    • the graphics lab
Re: Merging together
« Reply #2 on: October 15, 2012, 05:03:31 pm »
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

  • Full Member
  • ***
  • Posts: 113
  • Karma: 0
Re: Merging together
« Reply #3 on: October 17, 2012, 03:03:29 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


Nermander

  • Hero Member
  • *****
  • Posts: 1311
  • Karma: 17
Re: Merging together
« Reply #4 on: October 17, 2012, 03: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.


founder

  • Full Member
  • ***
  • Posts: 113
  • Karma: 0
Re: Merging together
« Reply #5 on: October 17, 2012, 08:22:07 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 '

a.l.e

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2109
  • Karma: 27
    • the graphics lab
Re: Merging together
« Reply #6 on: October 17, 2012, 11: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

founder

  • Full Member
  • ***
  • Posts: 113
  • Karma: 0
Re: Merging together
« Reply #7 on: October 19, 2012, 01:09:38 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.