I'm quite sure I'm missing something, but I'm not able to translate "Title" and "Body" fields although now could be defined by user.

I'm on a drupal 5.1 with i18n but as far as are interface strings I thought it need to be done by locale...

I dig into the code and I found that they are defined without t(). In node.module around line 2957 you can see:

    $form['title'] = array(
      '#type' => 'textfield',
      '#title' => check_plain($type->title_label),
      '#required' => TRUE,
      '#default_value' => $node->title,
      '#weight' => -5,
    );

Is it right? or need to be translated as...

    $form['title'] = array(
      '#type' => 'textfield',
      '#title' => t(check_plain($type->title_label)),
      '#required' => TRUE,
      '#default_value' => $node->title,
      '#weight' => -5,
    );

Same happens with body, that I changed for:

      '#title' => t(check_plain($type->body_label)),

I did the change and I didn't noticed any collateral effects.

Sorry in advance for the annoyance if it's not a bug and it's just my ignorance.

Cheers,

m.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

flk’s picture

Version: 5.1 » 6.x-dev
FileSize
919 bytes

since your able to define both title and body shouldn't you be defining them in the chosen language?

any way's, you cant change anything in a stable version...

btw in future you should create a patch for the problem in this format attached. (either use diff or something like tortoiseCVS)

mbria’s picture

No problem with attaching a patch. I will do next time... but I was unsure about if it really was an issue. Thanks to fix it.

> since your able to define both title and body shouldn't you be defining them in the chosen language?
Sure, but the point is that in a multilang site, you could need labels in different languages (based on user's preference) so I believe this also need to be translated.

My concern about this patch is related with the way locale works.
When adding url is allways "*/node/add" but what will happen when editing and the url changes?
Translating it here means that a new record will be added for every edited node?

Once again, sorry if it's just my ignorance.

chx’s picture

Version: 6.x-dev » 7.x-dev
Category: bug » feature
lilou’s picture

Status: Active » Needs review
FileSize
1.28 KB

Reroll

Anonymous’s picture

Status: Needs review » Needs work

The last submitted patch failed testing.

strellman’s picture

Title: "Title" and "Body" labels are not translated » "Title" and "Body" labels are not translated, then translated wrong
Project: Drupal core » Internationalization
Version: 7.x-dev » 6.x-1.0-beta4
Component: node system » Code
Category: feature » support
Status: Needs work » Active

Well I started to update this report as a bug and then found out how to make it work but not work well. This is actually done with string translation in the i18n or internationalization module http://drupal.org/project/i18n as described at http://drupal.org/node/313293

Try going to /admin/build/translate/refresh
selecting content type
(I saw the following...)
Updated string group:title for textgroup nodetype: Name of group
Updated string group:title for textgroup nodetype: Action plan (This is my body field in English)

Since I couldn't find the title to translate I changed back the field labels to "Title" and "Body"

This time it took my translation for Text group - content type, and in the string column - Body / group:title so that the original text was "Body". For my Romanian translation I typed "Group Action Plan" which actually showed up as the label for the Title field instead of the Body field. Very strange!

Jose Reyero’s picture

Status: Active » Fixed

These issues are fixed in latest -dev, refresh locales after updating

Status: Fixed » Closed (fixed)

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

noelbush’s picture

Prior to your next release (to avoid using a dev version of this complex module), here is a very simple module that just addresses this problem:

http://drupal.org/project/trans_core_labels