mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 13:39:01 +01:00 
			
		
		
		
	add translation for ribbon widgets: script_executor.js
This commit is contained in:
		
							parent
							
								
									b7809a709c
								
							
						
					
					
						commit
						a8bb064557
					
				@ -1,5 +1,6 @@
 | 
				
			|||||||
import NoteContextAwareWidget from "../note_context_aware_widget.js";
 | 
					import NoteContextAwareWidget from "../note_context_aware_widget.js";
 | 
				
			||||||
import keyboardActionService from "../../services/keyboard_actions.js";
 | 
					import keyboardActionService from "../../services/keyboard_actions.js";
 | 
				
			||||||
 | 
					import { t } from "../../services/i18n.js";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const TPL = `
 | 
					const TPL = `
 | 
				
			||||||
<div class="script-runner-widget">
 | 
					<div class="script-runner-widget">
 | 
				
			||||||
@ -37,7 +38,7 @@ export default class ScriptExecutorWidget extends NoteContextAwareWidget {
 | 
				
			|||||||
        return {
 | 
					        return {
 | 
				
			||||||
            show: this.isEnabled(),
 | 
					            show: this.isEnabled(),
 | 
				
			||||||
            activate: true,
 | 
					            activate: true,
 | 
				
			||||||
            title: this.isTriliumSqlite() ? 'Query' : 'Script',
 | 
					            title: this.isTriliumSqlite() ? t('script_executor.query') : t('script_executor.script'),
 | 
				
			||||||
            icon: 'bx bx-run'
 | 
					            icon: 'bx bx-run'
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -52,7 +53,7 @@ export default class ScriptExecutorWidget extends NoteContextAwareWidget {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    async refreshWithNote(note) {
 | 
					    async refreshWithNote(note) {
 | 
				
			||||||
        const executeTitle = note.getLabelValue('executeButton')
 | 
					        const executeTitle = note.getLabelValue('executeButton')
 | 
				
			||||||
            || (this.isTriliumSqlite() ? 'Execute Query' : 'Execute Script');
 | 
					            || (this.isTriliumSqlite() ? t('script_executor.execute_query') : t('script_executor.execute_script'));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.$executeButton.text(executeTitle);
 | 
					        this.$executeButton.text(executeTitle);
 | 
				
			||||||
        this.$executeButton.attr('title', executeTitle);
 | 
					        this.$executeButton.attr('title', executeTitle);
 | 
				
			||||||
 | 
				
			|||||||
@ -746,5 +746,11 @@
 | 
				
			|||||||
        "unknown_attribute_type": "未知的属性类型 '{{type}}'",
 | 
					        "unknown_attribute_type": "未知的属性类型 '{{type}}'",
 | 
				
			||||||
        "add_new_attribute": "添加新属性",
 | 
					        "add_new_attribute": "添加新属性",
 | 
				
			||||||
        "remove_this_attribute": "移除此属性"
 | 
					        "remove_this_attribute": "移除此属性"
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    "script_executor": {
 | 
				
			||||||
 | 
					        "query": "查询",
 | 
				
			||||||
 | 
					        "script": "脚本",
 | 
				
			||||||
 | 
					        "execute_query": "执行查询",
 | 
				
			||||||
 | 
					        "execute_script": "执行脚本"
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -747,5 +747,11 @@
 | 
				
			|||||||
        "unknown_attribute_type": "Unknown attribute type '{{type}}'",
 | 
					        "unknown_attribute_type": "Unknown attribute type '{{type}}'",
 | 
				
			||||||
        "add_new_attribute": "Add new attribute",
 | 
					        "add_new_attribute": "Add new attribute",
 | 
				
			||||||
        "remove_this_attribute": "Remove this attribute"
 | 
					        "remove_this_attribute": "Remove this attribute"
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    "script_executor": {
 | 
				
			||||||
 | 
					        "query": "Query",
 | 
				
			||||||
 | 
					        "script": "Script",
 | 
				
			||||||
 | 
					        "execute_query": "Execute Query",
 | 
				
			||||||
 | 
					        "execute_script": "Execute Script"
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user