Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
install system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
1 Feb 2011 at 21:08 UTC
Updated:
29 Jul 2014 at 19:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
martin jinoch commentedgrr...I've attached wrong version of patch
Comment #3
wojtha commented@jyyna your patches were both reverse patches
rerolling jyyna's patch
Comment #4
wojtha commentedComment #5
martin jinoch commentedMea culpa! Thanks
Comment #6
dave reidLooks good to me.
Comment #7
David_Rothstein commentedI actually think the patch has a subtle problem, because the vocabulary name gets re-used later on in the same function:
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().
Comment #8
martin jinoch commentedI 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.
Comment #9
David_Rothstein commentedI 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.
Comment #10
martin jinoch commentedHmm, 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...
Comment #11
dave reidHrm, I'm confused as to why the vocabulary description is translated then.
Comment #12
martin jinoch commentedYes, 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.
Comment #13
David_Rothstein commentedYeah, 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.
Comment #14
martin jinoch commentedTranslating 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.
Comment #15
David_Rothstein commentedNo, 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.
Comment #16
martin jinoch commentedOK, 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.
Comment #17
wojtha commentedBumping to 8.x
Comment #18
wojtha commented#13: standard-install-translate-tags-1048006-13.patch queued for re-testing.
Comment #19
wojtha commentedComment #20
dries commentedCommitted to 7.x and 8.x. Thanks.
Comment #21
wojtha commentedremoving "needs backport to D7" tag