standard.install profile creates vocabulary Tags and this name could not be localized. I am not sure about the component to submit this issue to. Sorry if it is not right.

Comments

martin jinoch’s picture

StatusFileSize
new580 bytes

grr...I've attached wrong version of patch

Status: Needs review » Needs work

The last submitted patch, d7_standard_install_tags.patch, failed testing.

wojtha’s picture

@jyyna your patches were both reverse patches

rerolling jyyna's patch

wojtha’s picture

Status: Needs work » Needs review
martin jinoch’s picture

Mea culpa! Thanks

dave reid’s picture

Version: 7.0 » 7.x-dev
Status: Needs review » Reviewed & tested by the community

Looks good to me.

David_Rothstein’s picture

Status: Reviewed & tested by the community » Needs work

I actually think the patch has a subtle problem, because the vocabulary name gets re-used later on in the same function:

  $instance = array(
    ....
    'label' => $vocabulary->name,
    ....
  );
  field_create_instance($instance);

As far as I know, instance labels aren't supposed to be translated before going into the database (they get translated on display instead).

So I think we need to ensure that the version used for the instance label remains untranslated, even if we are translating the one that goes into taxonomy_vocabulary_save().

martin jinoch’s picture

I was looking at the code too and I think the label of that field is safe to be translated.
That code just (AFAIK) does the same steps as would a user do while creating vocabulary and entering details about it and then adding term_reference_field to content type.

David_Rothstein’s picture

I think Drupal core, at least, makes the assumption that field labels (even those entered via the UI) are interface text, and therefore supposed to be entered in English but translated on display. I know it doesn't make much sense, but that seems to be the way it works.

For example, none of the other fields added in the install profile have translated labels, nor does the body field when added via this API function:
http://api.drupal.org/api/drupal/modules--node--node.module/function/nod...

And if you go to admin/structure/types/manage/article/fields on a non-English site, you will see that there, the labels are in English. But if you go to node/add/article, the same labels will be translated for you.

I just discovered #1016006: Default title, body and other field labels not localizable which is related to this.

martin jinoch’s picture

Hmm, but if it's not localized here (in standard.install file) we need a "place" where Drupal asks for translated version of that string. Which could be somewhere deep in core, where node display is being constructed. But it would be probably hard-coded and that is not a good idea.
And if someone changes the name of vocabulary in standard.install, another change will be needed somewhere deeper.
Strange situation we've got here...

dave reid’s picture

Hrm, I'm confused as to why the vocabulary description is translated then.

martin jinoch’s picture

Yes, why not localize the human readable name of vocabulary and translate the description? Description is not shown on every node of that content type, but label of that field is.

David_Rothstein’s picture

Status: Needs work » Needs review
StatusFileSize
new1.05 KB

Yeah, there might be something wrong with the way field descriptions are handled too. Overall, this is very confusing!

Anyway, my suggestion above was that we simply do the attached patch for now. Does that work? That way the vocabulary name gets translated, but the field label is left alone (and remains untranslated just like all the others). Then we can leave it up to #1016006: Default title, body and other field labels not localizable to figure out how to handle field translation.

martin jinoch’s picture

Translating vocabulary name and NOT translating label of that field seems to me as a strange (one more string to translate and label Tags still present on all nodes of Basic page and Article content types).
I understand why having the base system in English makes sense (multi-language sites, etc.).
But I'm not too aware of Drupal core structure and behaviour to find out better place to patch this issue.

David_Rothstein’s picture

Translating vocabulary name and NOT translating label of that field seems to me as a strange (one more string to translate and label Tags still present on all nodes of Basic page and Article content types).

No, that's not correct. The label "Tags", and all other field labels, are already run through the translation system when they appear on nodes and other similar pages; that is what I have been saying above. You can see this yourself - just add a custom translation for the word "Tags" on your site, and it will work perfectly fine on those pages.

With this patch, not only do we fix the vocabulary translation issue directly, but now that we are adding this as a translatable string (which translators will start picking up and actually translating), that means it will automatically start being used for the field label also. Everyone wins.

martin jinoch’s picture

With this patch, not only do we fix the vocabulary translation issue directly, but now that we are adding this as a translatable string (which translators will start picking up and actually translating), that means it will automatically start being used for the field label also. Everyone wins.

OK, sounds good to me. I was not sure if the field label will be translated, but if you say so, I am happy with this. Thanks.

wojtha’s picture

Version: 7.x-dev » 8.x-dev
Issue tags: +Needs backport to D7

Bumping to 8.x

wojtha’s picture

wojtha’s picture

Status: Needs review » Reviewed & tested by the community
dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 7.x and 8.x. Thanks.

wojtha’s picture

Issue tags: -Needs backport to D7

removing "needs backport to D7" tag

Status: Fixed » Closed (fixed)
Issue tags: -install, -content translation, -format plural

Automatically closed -- issue fixed for 2 weeks with no activity.