0
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.

bakeで作成されたプラグインコード中の __('message')を__d('pluginname', 'message)に一括置換する方法

0
Last updated at Posted at 2014-02-10

message中にプラグイン名や、プラグインのみに記述のあるモデル名があるときしかつかえないけど。

PhoStormの一括置換で

Text to find:を __\('([^()]*PluginName[^()]*)'\)
Replace with: を __d('plugin_name', '$1')

にしてRegular expression有効で置換。

メッセージ中にプラグイン名が出てれば置換対象となる。

個人的に、プラグイン内のモデル名はユニークになるようにプラグイン名をプレフィクスとしてつけてるので、これでOK。

2014/04/21追記

この方法だとカラム名とかは__dに置換されないので、結局__(を全部__d(に置換するようになりました(^^;

0
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
0
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?