|
@@ -195,6 +195,7 @@ class TranslateLogic extends BaseLogic |
|
@@ -195,6 +195,7 @@ class TranslateLogic extends BaseLogic |
|
195
|
$texts = $dom->find("text");
|
195
|
$texts = $dom->find("text");
|
|
196
|
$description = $dom->find("meta[name=description]",0);
|
196
|
$description = $dom->find("meta[name=description]",0);
|
|
197
|
$keywords = $dom->find("meta[name=keywords]",0);
|
197
|
$keywords = $dom->find("meta[name=keywords]",0);
|
|
|
|
198
|
+ $placeholders = $dom->find("[placeholder]");
|
|
198
|
// 组装需要翻译的内容 HTML内文案、meta description、meta keywords
|
199
|
// 组装需要翻译的内容 HTML内文案、meta description、meta keywords
|
|
199
|
$need_tran = [];
|
200
|
$need_tran = [];
|
|
200
|
foreach ($texts as $k=>$text) {
|
201
|
foreach ($texts as $k=>$text) {
|
|
@@ -217,6 +218,12 @@ class TranslateLogic extends BaseLogic |
|
@@ -217,6 +218,12 @@ class TranslateLogic extends BaseLogic |
|
217
|
$need_tran[] = htmlspecialchars_decode(html_entity_decode($string));
|
218
|
$need_tran[] = htmlspecialchars_decode(html_entity_decode($string));
|
|
218
|
}
|
219
|
}
|
|
219
|
}
|
220
|
}
|
|
|
|
221
|
+ foreach ($placeholders as $placeholder) {
|
|
|
|
222
|
+ $placeholderText = trim($placeholder->placeholder);
|
|
|
|
223
|
+ if ($placeholderText) {
|
|
|
|
224
|
+ $need_tran[] = $placeholderText;
|
|
|
|
225
|
+ }
|
|
|
|
226
|
+ }
|
|
220
|
$need_tran[] = $description ? $description->attr['content'] : '';
|
227
|
$need_tran[] = $description ? $description->attr['content'] : '';
|
|
221
|
$need_tran[] = $keywords ? $keywords->attr['content'] : '';
|
228
|
$need_tran[] = $keywords ? $keywords->attr['content'] : '';
|
|
222
|
$need_tran = array_values(array_unique($need_tran));
|
229
|
$need_tran = array_values(array_unique($need_tran));
|