1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Craft CMS の出力値の翻訳に変数の値を渡す

Posted at

普通の翻訳は下記の記事を参照のこと。

この翻訳に変数の値を渡したい場合は下記のようにする。

site.php

site.php には下記のように定義する。

return [
    'Articles in "{category}" category' => '「{category}」カテゴリの記事一覧',
];

Twig

Twig テンプレートには下記のようにして変数を渡す。


{{ 'Articles in "{category}" category'|t({ 'category': category.title }) }}

参考

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?