Page 1 of 1

Oxygen formats content of text elements

Posted: Thu Sep 23, 2010 12:18 am
by xinelo
I've got an Xliff file that has elements like:

<trans-unit id="283395" resname="CAPI" translate="yes" reformat="yes" xml:space="default" approved="no">
<source xml:lang="en">I would like to start with some general questions.
Can you please tell me in which year you were born?</source>

After I open it in Oxygen it looks like:

<trans-unit id="283395" resname="CAPI" translate="yes" reformat="yes"
xml:space="default" approved="no">
<source xml:lang="en">I would like to start with some general questions. Can you
please tell me in which year you were born?</source>

It's been indented and hard-wrapped (some line breaks have been inserted).

This spoils the internal structure of the text contained in those segments and should be avoided.

I've been trying several options in the Preferences, but to no avail.

Any suggestion?

Thanks a lot, Manuel

Re: Oxygen formats content of text elements

Posted: Thu Sep 23, 2010 8:53 am
by xinelo
I found the answer myself :)

Preferences | Editor | Format | Format and indent the document on open

However, I still have one doubt. Is it possible somehow to either indent tags but not text contained in one element?

Thanks, xinelo

Re: Oxygen formats content of text elements

Posted: Thu Sep 23, 2010 8:56 am
by xinelo
I've just realized the format is not clearly kept in my excerpts of code above. I paste them again as code:

My document had:

Code: Select all

      <trans-unit id="283395" resname="CAPI" translate="yes" reformat="yes" xml:space="default" approved="no">
<source xml:lang="en">I would like to start with some general questions.
Can you please tell me in which year you were born?</source>
and oxygen converted it to:

Code: Select all

			<trans-unit id="283395" resname="CAPI" translate="yes" reformat="yes"
xml:space="default" approved="no">
<source xml:lang="en">I would like to start with some general questions. Can you
please tell me in which year you were born?</source>

Re: Oxygen formats content of text elements

Posted: Thu Sep 23, 2010 10:19 am
by adrian
Hello,

I see you have xml:space="default" set on the "trans-unit" element. If you want to preserve your indents and line breaks you should change it to xml:space="preserve". Oxygen's Format and Indent feature recognizes this attribute and preserves the whitespaces.

Otherwise, if you can't or don't want to modify the document, you can set for what elements should whitespaces be preserved in the options: Options -> Preferences -> Editor -> Format -> XML. Add a new element to the "Preserve space" list. You may also want to have a look at the other options from that option page, they control various formatting features/restrictions.

Regards,
Adrian

Re: Oxygen formats content of text elements

Posted: Fri Oct 22, 2010 2:07 pm
by xinelo
Hi Adrian,

Your answer was great, I learnt a new very important thing. Thanks a lot!

Cheers, Manuel