Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XlIFF2.0 to MF2 design #236

Open
klavinsjanis opened this issue Jan 18, 2024 · 0 comments
Open

XlIFF2.0 to MF2 design #236

klavinsjanis opened this issue Jan 18, 2024 · 0 comments

Comments

@klavinsjanis
Copy link
Contributor

klavinsjanis commented Jan 18, 2024

// original xliff2.0:

<?xml version="1.0" encoding="UTF-8" ?>
<xliff version="2.0"
	xmlns="urn:oasis:names:tc:xliff:document:2.0" srcLang="en">
	<file>
		<unit id="1">
			<segment>
				<source xml:lang="en" xml:space="preserve">Loves or pursues or desires to obtain
					<pc>
						<mrk id="" translate="yes" type="term">pain of itself</mrk>
					</pc>, because it is pain, but occasionally circumstances occur in which toil and pain can procure him some great pleasure.</source>
			</segment>
		</unit>
	</file>
</xliff>

// original translation with MF2 message:

original :=  model.Translation{
	Original: original,
	Language: language.English,
	Messages: []model.Message{
		{
			ID: "1",
			Message: `.local $source = { |<source xml:lang="en" xml:space="preserve">Loves or pursues or desires to obtain<pc><mrk id="" translate="yes" type="term">pain of itself</mrk></pc>, because it is pain, but occasionally circumstances occur in which toil and pain can procure him some great pleasure.</source>| }
.local $pc1 = { |<pc><mrk id="" translate="yes" type="term">pain of itself</mrk></pc>| }
{{Loves or pursues or desires to obtain {$pc1}, because it is pain, but occasionally circumstances occur in which toil and pain can procure him some great pleasure.}}`,
			Status:      model.MessageStatusTranslated,
		},
	},
}

// translation with MF2 message:

translated := model.Translation{
	Original: false,
	Language: language.German,
	Messages: []model.Message{
		{
			ID: "1",
			Message: `.local $source = { |<source xml:lang="en" xml:space="preserve">Loves or pursues or desires to obtain<pc><mrk id="" translate="yes" type="term">pain of itself</mrk></pc>, because it is pain, but occasionally circumstances occur in which toil and pain can procure him some great pleasure.</source>| }
.local $pc1 = { |<pc><mrk id="" translate="yes" type="term">Schmerz seiner selbst</mrk></pc>| }
{{Liebt oder verfolgt oder wünscht etwas zu erreichen {$pc1}, weil es Schmerz ist, aber gelegentlich treten Umstände auf, in denen Mühe und Schmerz ihm große Freude bereiten können.}}`,
			Status:      model.MessageStatusFuzzy,
		},
	},
}

// translated xliff2.0

<?xml version="1.0" encoding="UTF-8" ?>
<xliff version="2.0"
	xmlns="urn:oasis:names:tc:xliff:document:2.0" srcLang="en" trgLang="de">
	<file>
		<unit id="1">
			<segment>
				<source xml:lang="en" xml:space="preserve">Loves or pursues or desires to obtain
					<pc>
						<mrk id="" translate="yes" type="term">pain of itself</mrk>
					</pc>, because it is pain, but occasionally circumstances occur in which toil and pain can procure him some great pleasure.</source>
				<translation xml:lang="de" xml:space="preserve">Liebt oder verfolgt oder wünscht etwas zu erreichen
					<pc>
						<mrk id="" translate="yes" type="term">Schmerz seiner selbst</mrk>
					</pc>, weil es Schmerz ist, aber gelegentlich treten Umstände auf, in denen Mühe und Schmerz ihm große Freude bereiten können.</translation>
			</segment>
		</unit>
	</file>
</xliff>
@klavinsjanis klavinsjanis changed the title Xliff2.0 to MF2 design XlIFF2.0 to MF2 design Jan 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant