evilfreelancer/translation-key-helper

Laravel 插件,用于在 HTML 注释中显示文本字符串附近的翻译键。

1.0.0 2020-01-12 09:05 UTC

This package is auto-updated.

Last update: 2024-09-13 01:42:44 UTC


README

Laravel 插件,用于在 HTML 注释中显示文本字符串附近的翻译键。

composer require evilfreelancer/translation-key-helper --dev

请仅在开发环境中使用此插件。

使用示例

安装此插件后,您可以在网站的 HTML 源代码中找到类似以下行

<ul id="navbar-main" class="navbar-nav">
  <li class="nav-item">
    <a class="nav-link active" href="http://localhost/posts"><!-- navbar.posts -->Posts</a>
  </li>
  <li class="nav-item">
    <a class="nav-link " href="http://localhost/news"><!-- navbar.news -->News</a>
  </li>
</ul>

注意

如果您使用 VueJs,则需要允许 div#app 块内的注释

const app = new Vue({
    el: '#app',
	comments: true, // When set to true, HTML comments found in templates will be saved and rendered. Default: false
});