forked from MapComplete/MapComplete
		
	Add translation button to inline renderings
This commit is contained in:
		
							parent
							
								
									e62f71a51d
								
							
						
					
					
						commit
						70e74144ed
					
				
					 1 changed files with 2 additions and 5 deletions
				
			
		|  | @ -17,11 +17,8 @@ export default class InputElementWrapper<T> extends InputElement<T> { | |||
|         mapping.set(key, inputElement) | ||||
| 
 | ||||
|         // Bit of a hack: the SubstitutedTranslation expects a special rendering, but those are formatted '{key()}' instead of '{key}', so we substitute it first
 | ||||
|         const newTranslations = {} | ||||
|         for (const lang in translation.translations) { | ||||
|             newTranslations[lang] = translation.translations[lang].replace("{" + key + "}", "{" + key + "()}") | ||||
|         } | ||||
|         this._renderElement = new SubstitutedTranslation(new Translation(newTranslations), tags, state, mapping) | ||||
|         translation = translation.OnEveryLanguage((txt) => txt.replace("{" + key + "}", "{" + key + "()}")) | ||||
|         this._renderElement = new SubstitutedTranslation(translation, tags, state, mapping) | ||||
|     } | ||||
| 
 | ||||
|     GetValue(): UIEventSource<T> { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue