1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-30 05:19:57 +00:00

Make the default title created by excision translatable (#8500)

* Make the default title created by excision translatable

* Use $tw.language.getString to get language string
This commit is contained in:
Leilei332 2024-08-27 16:26:42 +08:00 committed by GitHub
parent fa423e508f
commit 98cd4a09b4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -133,6 +133,7 @@ Excise/Caption/Replace/Link: link
Excise/Caption/Replace/Transclusion: transclusion Excise/Caption/Replace/Transclusion: transclusion
Excise/Caption/Tag: Tag new tiddler with the title of this tiddler Excise/Caption/Tag: Tag new tiddler with the title of this tiddler
Excise/Caption/TiddlerExists: Warning: tiddler already exists Excise/Caption/TiddlerExists: Warning: tiddler already exists
Excise/DefaultTitle: New Excision
Excise/Hint: Excise the selected text into a new tiddler Excise/Hint: Excise the selected text into a new tiddler
Heading1/Caption: heading 1 Heading1/Caption: heading 1
Heading1/Hint: Apply heading level 1 formatting to lines containing selection Heading1/Hint: Apply heading level 1 formatting to lines containing selection

View File

@ -14,11 +14,12 @@ Text editor operation to excise the selection to a new tiddler
exports["excise"] = function(event,operation) { exports["excise"] = function(event,operation) {
var editTiddler = this.wiki.getTiddler(this.editTitle), var editTiddler = this.wiki.getTiddler(this.editTitle),
editTiddlerTitle = this.editTitle; editTiddlerTitle = this.editTitle,
excisionBaseTitle = $tw.language.getString("Buttons/Excise/DefaultTitle");
if(editTiddler && editTiddler.fields["draft.of"]) { if(editTiddler && editTiddler.fields["draft.of"]) {
editTiddlerTitle = editTiddler.fields["draft.of"]; editTiddlerTitle = editTiddler.fields["draft.of"];
} }
var excisionTitle = event.paramObject.title || this.wiki.generateNewTitle("New Excision"); var excisionTitle = event.paramObject.title || this.wiki.generateNewTitle(excisionBaseTitle);
this.wiki.addTiddler(new $tw.Tiddler( this.wiki.addTiddler(new $tw.Tiddler(
this.wiki.getCreationFields(), this.wiki.getCreationFields(),
this.wiki.getModificationFields(), this.wiki.getModificationFields(),