Error message

  • Deprecated function: Creation of dynamic property SelectQuery::$alterTags is deprecated in SelectQuery->addTag() (line 978 of /var/www/cms/drupal7/includes/database/select.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property SelectQuery::$alterTags is deprecated in SelectQuery->addTag() (line 978 of /var/www/cms/drupal7/includes/database/select.inc).
  • Deprecated function: Creation of dynamic property SelectQuery::$alterTags is deprecated in SelectQuery->addTag() (line 978 of /var/www/cms/drupal7/includes/database/select.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property SelectQuery::$alterTags is deprecated in SelectQuery->addTag() (line 978 of /var/www/cms/drupal7/includes/database/select.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property SelectQuery::$alterTags is deprecated in SelectQuery->addTag() (line 978 of /var/www/cms/drupal7/includes/database/select.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property SelectQuery::$alterTags is deprecated in SelectQuery->addTag() (line 978 of /var/www/cms/drupal7/includes/database/select.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property SelectQuery::$alterTags is deprecated in SelectQuery->addTag() (line 978 of /var/www/cms/drupal7/includes/database/select.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).
  • Deprecated function: Creation of dynamic property DatabaseCondition::$stringVersion is deprecated in DatabaseCondition->compile() (line 1887 of /var/www/cms/drupal7/includes/database/query.inc).

Drupal 導入記(多言語化)

日本語の追加

http://localhost/drupal を開きログイン、admin ツールバーから "Modules" を選択する。"Locale" モジュールをチェックして有効化し、"Configure" をクリックして設定画面

"Home » Administration » Configuration » Regional and language » Languages"

に入る。"LIST" タブを選んで、新しい言語、"Japanese(日本語)"、を追加("add a new language")する。必要なら日本語をデフォールトにしておく。次に "DETECTION AND SELECTION" タブを選んで、"DETECTION METHOD" として "URL" をチェックする。"Configure" では、"Path prefix" にチェックをいれる。これで Node の prefix として、"ja/" で日本語、"en/" で英語のコンテンツが表示される。しかし、これだけでは、"Site name" や "Site slogan" などを多言語かできない。もう一作業必要だ。

settings.php の変更

i18n モジュールによって切り替え可能な変数を追加するため <DocumentRoot>/drupal/sites/default/settings.php の最後に以下の記述を追加する。ここで <DocumentRoot> は、drupal の置き場所のパス。

/**
 * Multilingual settings
 * 
 * This is a collection of variables that can be set up for each language 
 * when i18n is enabled.
 * These are the basic ones for Drupal core, but you can add your own here.
 */
$conf['i18n_variables'] = array(
 // Site name, slogan, mission, etc..
 'site_name',
 'site_slogan',
 'site_mission',
 'site_footer',
 'anonymous',
 // Different front page for each language
 'site_frontpage',
 // Primary and secondary links
 'menu_primary_links_source',
 'menu_secondary_links_source',
 // Contact form information
 'contact_form_information',
 // For theme variables, read more below
 'theme_settings',
 'theme_garland_settings',
);
 

多言語化モジュールのインストール

多言語化に用いたのは、"i18n" とそれが要求する "variable" パッケージの2つ。インストールはいつも通り、"modules" ディレクトリーの中に tarball を展開する。

$ tar -zxvf <somewhere>/i18n-7.x-1.2.tar.gz -C <DocumentRoot>/drupal/sites/all/modules
$ tar -zxvf <somewhere>/variable-7.x-1.1.tar.gz -C <DocumentRoot>/drupal/sites/all/modules

インストール先は、コンテンツの置き場所に従って適当に変えること。後は、web browser を使って "http://localhost/drupal" を開いて、ログイン、admin ツールバーから、"Modules" を選んで、インストールしたモジュールをリストから探し有効化(チェック)、必要に応じて "Configure" する。これらのパッケージはたくさんのモジュールを含んでいるが、"Variable" 関連では、"Variable advanced" 以外全て、"i18n" 関連では、"Block languages"、"Internationalization"、"Menu tranlsation"、 "Variable" と "Variable translation" を有効化する。

次に、admin ツールバーから、"Structure » Content types » Basic page" と選択して、"Edit" タブを選ぶ。 さらに "Publishing options" を選んで、"Multilingual support" の所の "Enabled, with translation" にチェックをいれる。引き続き "Multilingual settings" を選び、"Require language (Do not allow Language Neutral)" にチェックをいれる。

好みに応じて、"MANAGE DISPLAY" タブを選択し、"language" 表示を隠す("hide")。これで本文部分の左下の言語表示が隠される。

次に、"Configuration » Regional and language » Multilingual settings" に行き、"MULTILINGUAL SYSTEM" タブを選んで、"Enable languages only" にチェックをいれる。ようやく、準備完了。後は、"VARIABLES" タブを選んで、"Site name" と "Site slogin" にチェックをいれる。また、同じく "STRINGS" タブで "Translatable text formats" の所で全ての format にチェックを入れる(デフォールトでは Plain text の翻訳しか許していない)。

これで、"Configurations » System » Site information" で、"Select language" というオプションが現れ、言語毎の "Site name" や "Slogan" が指定できるようになる。

また、多言語化したい "Block" の "Configure" ページで、Visibility settings 部分に "Languages" の選択肢が現れるので、そこで "Make this block translatable"、その下の Show this block for these languages で "English" と "Japanese" の両方にチェックを入れ保存する。"TRANSLATE" タブが現れるので、そこで翻訳版を作成できる。

メニューを言語で切り替え、リンク先を言語に応じて変えるのはちょっとトリッキーだ。"Structure >> Menus" で "LIST LINKS" タブを選び、"Add link" でメニューを加え、その "edit" 画面の "TRANSLATE" で英語版を作成する。リンク先ノードは言語に応じて変える。ポイントは、コンテンツ作成の時に Menu settings で "Provide a menu link" をチェックしてメニューを自動生成せず、手動でメニューを作成すること。

これで、言語選択に応じて、タイトルやらメニューやらコンテンツやらが切り替わる。

めでたしめでたし。

You are hereHome » Administration » Configuration » System"


 

Subgroup: