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) { | 			.forEach(function (el) { | ||||||
| 				document.head.removeChild(el); | 				document.head.removeChild(el); | ||||||
| 			}); | 			}); | ||||||
|  | 		require(['translator'], function (translator) { | ||||||
| 			// Add new meta tags | 			// Add new meta tags | ||||||
| 			ajaxify.data._header.tags.meta | 			ajaxify.data._header.tags.meta | ||||||
| 				.filter(function (tagObj) { | 				.filter(function (tagObj) { | ||||||
| @@ -248,14 +248,17 @@ ajaxify = window.ajaxify || {}; | |||||||
| 					return metaWhitelist.some(function (exp) { | 					return metaWhitelist.some(function (exp) { | ||||||
| 						return !!exp.test(name); | 						return !!exp.test(name); | ||||||
| 					}); | 					}); | ||||||
| 			}) | 				}).forEach(async function (tagObj) { | ||||||
| 			.forEach(function (tagObj) { | 					if (tagObj.content) { | ||||||
|  | 						tagObj.content = await translator.translate(tagObj.content); | ||||||
|  | 					} | ||||||
| 					var metaEl = document.createElement('meta'); | 					var metaEl = document.createElement('meta'); | ||||||
| 					Object.keys(tagObj).forEach(function (prop) { | 					Object.keys(tagObj).forEach(function (prop) { | ||||||
| 						metaEl.setAttribute(prop, tagObj[prop]); | 						metaEl.setAttribute(prop, tagObj[prop]); | ||||||
| 					}); | 					}); | ||||||
| 					document.head.appendChild(metaEl); | 					document.head.appendChild(metaEl); | ||||||
| 				}); | 				}); | ||||||
|  | 		}); | ||||||
|  |  | ||||||
| 		// Delete the old link tags | 		// Delete the old link tags | ||||||
| 		Array.prototype.slice | 		Array.prototype.slice | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user