Not sure if this should be marked as bug.

Title, Body, Tags and Image labels on Article and Page nodetypes (during node create/edit) aren't localizable since they're not passed through either t() or st() during installation.

Shure seems strange to install a localized Drupal and have everything except those =)

Comments

Status: Needs review » Needs work

The last submitted patch, untranslateable-default-nodetype-labels.patch, failed testing.

janusman’s picture

Status: Needs work » Needs review
StatusFileSize
new2.54 KB

D'oh! New patch.

janusman’s picture

Title: Default title, body and other field labels on default nodetypes not translateable » Default title, body and other field labels not localizable
StatusFileSize
new3.13 KB

Missed default on manual node type creation, removed stray t() inside tests.

David_Rothstein’s picture

Component: user interface text » field system

Related issue: #1048006: Name of vocabulary (Tags) created during install cannot be localized

As discussed there, although the current behavior doesn't make much sense, I don't think translating them like this is correct either? It's not true that they aren't currently translated at all. For example, if you go to node/add/article on a default Drupal installation, the label for the "Body" field will be translated for you.

Drupal core, at least, seems to be assuming that everyone enters these field labels in English, but then translates them on display. And we definitely don't want to double-translate them, which I think this patch would wind up doing.

I'm moving this to the field system, on the theory that someone who monitors those issues will have a better idea how field instance label translation is supposed to work :)

sun’s picture

Status: Needs review » Needs work
+++ modules/blog/blog.install Locally Modified (Based On 1.1)
@@ -13,5 +13,5 @@
-  node_add_body_field($types['blog']);
+  node_add_body_field($types['blog'], t('Body'));

This change (and other changes) in this patch is the utterly wrong point in time. Localization happens on view, not on save.

Powered by Dreditor.

janusman’s picture

I was following the logic that since #1014714: Installer-created "Home" item on main-menu not translateable needed translation during installation, this would too.

So I did some quick testing and:
- "Tags", "Body" are translateable from admin/config/regional/translate/translate
- "Title" is *not*

So should the "Title" label be translated during install like we did for the "Home" menu label on #1014714: Installer-created "Home" item on main-menu not translateable? Or should it be localizable upon display with t()?

plach’s picture

Jerome F’s picture

Is there a solution for that issue?

plach’s picture

gábor hojtsy’s picture

Yes, now that we removed the inappropriate t() that was running runtime on these (we cannot assume people create fields in English :), we can go ahead and install these localized. For user provided text, Drupal assumes it is in the site default language. Eg. if you set up a French site, you change your site name, anonymous user, date format, contact form setup, content types, field labels, etc. all to be French, right? You'll submit blocks, nodes, views in French. So if we install a site fresh for you, we should prefill the values localized if the localization is available at install time.

janusman’s picture

Gabor: so, does the *idea* implemented in #3 look like the way to go?

plach’s picture

I don't think it's the right way: default labels should be translated into the default language and not into the current language.

gábor hojtsy’s picture

@plach: well, that would require a rehaul of the install files in core and contrib all around. I think the install files use t() or st() expecting that the module is installed when the site default language is used. Eg. if you install Drupal localized right away, that happens in the installer. Then when you enable modules and themes, I think our current implementation assumes you do so with a UI in the site default language. However, there is definitely no guarantee for that. So yes, passing on language_default() as well to those calls could be the most accurate. I don't think any existing code does that yet though.

gábor hojtsy’s picture

Version: 7.x-dev » 8.x-dev
Component: field system » locale.module
David Stosik’s picture

@Gabor, about #11.
Does that mean that those labels become language unaware, and will be the same for every language the website should work on ?
Shouldn't that be considered a regression ?

Regards,

David

gábor hojtsy’s picture

@David Stosik: These were never language aware. Drupal 7 briefly slapped t() on *some* uses of *some* of the field properties. Not all properties and not all uses were covered. This was a mistake. Please use i18n module to translate them, which provides this functionality with a much better and continually improving implementation.

altavis’s picture

OK, i18n provides fields label translation but not for standard Title label.

gábor hojtsy’s picture

@altavis: if it does not do that for you, it is a bug in i18n module, please submit a report there with a detailed reproduction recipe.

altavis’s picture

I was wrong, it's possible to translate standard node title label also, sorry. i18n is a nice approach to multilang sites. Translation to English is a little bit wired but in the end it makes sense.

Anyway, I'm stuck with Fieldgroup labels and Image (aka ImageCache) styles names.

skyredwang’s picture

Issue summary: View changes
Status: Needs work » Closed (fixed)

This issue hasn't been updated for many years. Closing it.

gábor hojtsy’s picture

@skyredwang: did you verify that it is indeed fixed?

gábor hojtsy’s picture

Status: Closed (fixed) » Closed (duplicate)
Issue tags: +D8MI, +language-ui

Anyway, #2571337: Node type title label cannot be translated in the UI seems to be fixing the title label problem to some degree (you need the content type settings saved first) and body is a field on its own with its own configuration / translatability. Closing as duplicate on #2571337: Node type title label cannot be translated in the UI seems appropriate.