I have tried to translate title field label in my custom content type editing page (admin/content/types/). Title is labeled now as "Item name" but it should be translatable to other languages as well.

I noticed that there's a handy way to use i18n variables to translate some submitted text. Like this:

 $conf['i18n_variables'] = array(
  'site_name',
  'site_slogan',
  'site_mission',
  'site_footer',
  'site_frontpage', 
 );

Only problem is that I can't find the name of the variable I should use. If I look content_types.inc I can see that "title_label" is related to this field but it doesn't work :-(

 $conf['i18n_variables'] = array(
  'title_label', 
 );

I suppose it's too generic. What is the correct variable name - or is this solution working at all?

-----
Drupal 5.3
Configuration file Protected
Cron maintenance tasks Last run 16 hours 4 min ago
Database schema Up to date
File system Writable (public download method)
GD library bundled (2.0.34 compatible)
MySQL database 4.1.22
PHP 5.2.4
Unicode library PHP Mbstring Extension
Web server Apache

Comments

torsti’s picture

I changed line 122 in content_types.inc

'#default_value' => $type->title_label,

to this:

'#default_value' => t($type->title_label),

Then I translated sentence via localization and now "Item name" is changed to "Esineen nimi" (as it should be) when I toggle language versions.

But when I open my custom content type submit page, title remains "Item name" in both languages :-(

jose reyero’s picture

Status: Active » Closed (won't fix)

That's not a variable. Try 6.x version if you want these strings translated.

strellman’s picture

Title: What is the right variable name to use with i18n_variables » how to find i18n_variables
Issue tags: +multilingual

This might help you find the variable:
http://drupal.org/node/313272#comment-1741688
I am using d6.12, so if this solves your problem please close the issue.

torsti’s picture

Status: Closed (won't fix) » Closed (fixed)