I am wondering if this module is useful to help improve accessibiltiy of Drupal. Accessibility guidelines require that if a part of a page is in another language, this should tagged with a language code.
So for example, if there is a Dutch text with an English document in a filefield, the title - that is English - of this filefield should have a lang=en attribute.
I am aware that this isn't so much about translations, but about languages, but as this project is aiming at language on a per field base, it might be interesting to see if there is a common ground for a UI.
See also the discussion in the accessibility group http://groups.drupal.org/node/145894

Comments

plach’s picture

hanno’s picture

Category: support » feature
Status: Fixed » Needs work
Issue tags: +Accessibility

Changed from fixed to needs work.

These issues above doesn't address the language of entities and more importantly to give users an UI to define in which language they fill in a field. As the entity translation module will provide a UI to have fields in other languages, this could be the same UI: Give users the ability to select a language for a field.

The difference is that while with translations, the original language of the entity is always the same as the language of the node and avaialble. With language of parts, an entity field can exist only in another language, and not in the node language itself. So the original language of this entity will be another language.

For example, the node and body text will be in Dutch, the filefield attachment title and document however will be in English.

Note that with translations, if an English translation of the body text is made, then this field is already available for the english version, and this is why I think it might be useful if we have an integrated UI.

plach’s picture

Status: Needs work » Active

This is a use case we had in mind when designing language-aware fields in core, but it is a completely different logic wrt the one implemented in Entity translation. I ain't sure this is the right place for this feature request.

hanno’s picture

Language of parts in a multilangual site would be the same as the entity translation. For a given language, not all fields are available in that particular language and should show the field in another language with a language tag. (a "Mixed current language" setting). The special case might be that the field wouldn't be available in the original entity language.

For monolingual sites we might need another UI to add the right language to the field.

So basically, the feature request will consist of four issues:
1. allow adding 'translations' (language versions) of fields in their original language not being the entity language
2. allow a mixed language mode for (selected?) fields when displaying a entity (one of the use cases for adding language on field level)
3. show language tags in mixed entity language mode
4. see if we can reuse elements for monolingual sites with certain fields in other languages

Sorry, that I am not sure what should be handled in this issue queue or in core and already is dealt with.

EDIT: changed some entity into field terms as it was aimed on language on a field level

mgifford’s picture

How do we best get some movement in this issue?

plach’s picture

@mgifford:

There is a heavy rework of the translation UI ongoing (#1282018: Improve UX of language-aware entity forms), but I don't think it will help supporting this use case. I discussed with @Gabor a UI allowing to explictly specify the language of each field, but this is not going to happen, at least in ET and D8 core. I think the best we can do is marking fields with a language different from the entity's one with the language attribute.

mgifford’s picture

Thanks @plach. On the most likely senario here:
"I think the best we can do is marking fields with a language different from the entity's one with the language attribute."

What do you need from us to help you with this?

plach’s picture

@mgifford:

What do you need from us to help you with this?

Well, first of all I need a feedback. Currently the page language attribute is set to the interface language. We don't have other language attributes that I'm aware of. IMHO the correct behavior should be the following:

<!--  Current UI language: IT -->
<html lang="it">
...
<body>

<!-- English node translated in Italian  -->
<div id="node-1" class="node" lang="en">
<div class="field field-name-body" lang="it"> Questo è un contenuto Inglese tradotto in Italiano </div>
<div class="field field-name-image" lang="und"> ... </div>
</div>

<!-- Italian node -->
<div id="node-2" class="node" lang="it">
<div class="field field-name-body"> Questo è un contenuto Italiano </div>
<div class="field field-name-image" lang="und"> ... </div>
</div>

<!-- English node with no translation -->
<div id="node-3" class="node" lang="en">
<div class="field field-name-body"> This is an untranslated English content </div>
<div class="field field-name-image" lang="und"> ... </div>
</div>

...
</body>
</html>
hanno’s picture

Thanks Mike for this example. That looks like the right direction. Two remarks.
* It might be prefered to provide both the xml:lang and the lang attribute (http://www.w3.org/TR/xhtml1/#C_7) .
It would then look like: <div id="node-1" class="node" lang="en" xml:lang="en">
* lang="und" seems not needed, as the language attribute is only useful if a speech computer knows the language to switch to.
* some languages need a direction attribute as well: <div id="node-1" class="node" lang="he" xml:lang="he" dir="rtl">...a Hebrew quotation...

plach’s picture

@Hanno:

* It might be prefered to provide both the xml:lang and the lang attribute (http://www.w3.org/TR/xhtml1/#C_7) .

Yes, I omitted the xml:lang for brevity.

lang="und" seems not needed, as the language attribute is only useful if a speech computer knows the language to switch to.

I explictly set the und language as otherwise, I guess, the piece of content would inherit the node language. Isn't this semantically wrong?

mgifford’s picture

I asked for feedback on twitter & got:
@pjackson28 WCAG2 doesn't require lang="und" (has exception for unknown language) and only use xml:lang for XHTML.

@SteveBuell Example looks OK. Only require "lang" on divs which differ from page "lang". "xml lang" not req'd w/ doctype

on the undefined language, or lang="und" see:
http://www.w3.org/International/questions/qa-no-language

hanno’s picture

So, the language 'und' seems not necessary? Don't know how a screen reader will behave with a undetermined language. If we include lang="und", will we get this on every numeric field, which is on a field level usually language neutral?

mgifford’s picture

Component: Code » Base system
Issue tags: +language of parts

tagging