mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	fix: #9629, translate content property of meta tags
This commit is contained in:
		| @@ -240,7 +240,7 @@ ajaxify = window.ajaxify || {}; | ||||
| 			.forEach(function (el) { | ||||
| 				document.head.removeChild(el); | ||||
| 			}); | ||||
|  | ||||
| 		require(['translator'], function (translator) { | ||||
| 			// Add new meta tags | ||||
| 			ajaxify.data._header.tags.meta | ||||
| 				.filter(function (tagObj) { | ||||
| @@ -248,14 +248,17 @@ ajaxify = window.ajaxify || {}; | ||||
| 					return metaWhitelist.some(function (exp) { | ||||
| 						return !!exp.test(name); | ||||
| 					}); | ||||
| 			}) | ||||
| 			.forEach(function (tagObj) { | ||||
| 				}).forEach(async function (tagObj) { | ||||
| 					if (tagObj.content) { | ||||
| 						tagObj.content = await translator.translate(tagObj.content); | ||||
| 					} | ||||
| 					var metaEl = document.createElement('meta'); | ||||
| 					Object.keys(tagObj).forEach(function (prop) { | ||||
| 						metaEl.setAttribute(prop, tagObj[prop]); | ||||
| 					}); | ||||
| 					document.head.appendChild(metaEl); | ||||
| 				}); | ||||
| 		}); | ||||
|  | ||||
| 		// Delete the old link tags | ||||
| 		Array.prototype.slice | ||||
|   | ||||
		Reference in New Issue
	
	Block a user