TEIC / TEI

The Text Encoding Initiative Guidelines
https://www.tei-c.org
Other
270 stars 88 forks source link

Constrain translatable elements in TEI ODDs #2279

Closed hcayless closed 8 months ago

hcayless commented 2 years ago

To make it easier to build and maintain a translation interface for the TEI documentation, a few additional constraints would help:

  1. Require that the English version of a desc, gloss, or remarks come first. This is a convention followed everywhere in the Specs as far as I can tell, but I don't think it is enforced. It is easier to look at preceding siblings for the "main" version than to have to look around.
  2. Prevent multiple glosses and descs in the same language. I found a single case where a Japanese translation was added when an existing one was already there. There is already a rule like this in place for remarks.
sydb commented 2 years ago

I submit that these are changes that should be made to p5odds.odd (where, BTW, the "only-one-remark-per-lang" constraint comes from), not to the Guidelines themselves, in which case I am 100% in favor.

I get the duplicate in same language constraint, makes perfect sense. However, need to define “same language”. One (easy) way to do so is to say “the values of @xml:lang match”, which I think makes sense. But if someone wants to make an argument that different variants or extensions should be considered the same, speak now …

While I have no objection to the “English first” constraint, I don’t get it — I thought translators were using an interface, not reading the tagdocs directly. In which case,

<xsl:apply-templates select="*[@xml:lang eq 'en']"/>
<xsl:apply-templates select="*[@xml:lang ne 'en']"/>

seems a pretty easy way to go.

hcayless commented 2 years ago

@sydb imagine you have a desc in German, and you want to know if it's out of date. It's easier if you can just look back at the preceding English desc rather than have to look at both preceding siblings and following siblings.

And yes, I agree about where to make the changes.

sydb commented 2 years ago

I have implemented this in branch sydb_2279. I found that there were 10 errors our new constraints found, and was able to fix 6 of them myself quite easily. HOWEVER we have trouble in this here paradise. In the following cases, there is no English <desc>, <gloss>, or <remarks>, thus it cannot come first, and the constraint that the English must come first fails, and the build will break.

Also

Of these four remaining errors the first three are all of the same general sort. They could be handled by

  1. Adding English versions. (Someone who speaks one of the languages already present would back-generate an English version, methinks.)
  2. The error could be converted to a warning. (Thus the build would not break.)
  3. I could re-write the constraint so it only insists that English be first if there is an English version.

My vague recollection is our rule is that there should always be an English version, thus (3) is not the right way to go. I personally lean towards doing both (1) and (2).

The fourth error listed above needs be fixed before it is merged into dev, because it would break the build. Could someone from il8 who speaks French please take a look at and fix the <availability> tagdoc on branch sydb_2279? (Note that detest_odd_schematron.log has already been updated without the four errors above, so you will not have to fix that, too.)

sydb commented 1 year ago

Council decides we are going with solution (1) only, not (2) (it should remain an error). Green to finish up, asking for I18N help as needed.

sydb commented 1 year ago

Attn: @peterstadler, @sabineseifert, @raffazizzi, @martinascholger, @HelenaSabel —

Looks like @hcayless fixed the French in availability.xml (in branch sydb_2279) back in September. So what is needed now:

Change should be made in the sydb_2279 branch, or in dev and then merge dev into sydb_2279.

HelenaSabel commented 1 year ago

Update:

sydb commented 1 year ago

I tweaked the wording of <remarks xml:lang="en"> of speaker.xml, but think someone else should still review it.

sydb commented 1 year ago

(Although as soon as we get a translation of the German remarks in extent.xml, I think we can make a PR of this.)

sydb commented 8 months ago

This was fixed 9 months ago, just forgot to close the ticket. But in response to @hcayless’s explanation, seems to me ../desc[ lang('en') ] is just as easy as preceding-sibling::desc[ lang('en') ]. (Actually easier, since I can never spell “preceding” :-)