Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make draft title translatable #8891

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/language/en-GB/DraftAuthor.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title: $:/language/DraftAuthor

by $1$
3 changes: 3 additions & 0 deletions core/language/en-GB/DraftNumber.tid
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
title: $:/language/DraftNumber

$1$
2 changes: 2 additions & 0 deletions core/language/en-GB/Misc.multids
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ ConfirmAction: Do you wish to proceed?
Count: count
DefaultNewTiddlerTitle: New Tiddler
Diffs/CountMessage: <<diff-count>> differences

DraftTitle: Draft $1$of '$2$'$3$
DropMessage: Drop now (or use the 'Escape' key to cancel)
Encryption/Cancel: Cancel
Encryption/ConfirmClearPassword: Do you wish to clear the password? This will remove the encryption applied when saving this wiki
Expand Down
7 changes: 5 additions & 2 deletions core/modules/wiki.js
Original file line number Diff line number Diff line change
Expand Up @@ -1701,9 +1701,12 @@ exports.generateDraftTitle = function(title) {
var c = 0,
draftTitle,
username = this.getTiddlerText("$:/status/UserName"),
attribution = username ? " by " + username : "";
draftBaseTitle = $tw.language.getRawString("DraftTitle"),
draftAuthor = $tw.language.getRawString("DraftAuthor"),
draftNumber = $tw.language.getRawString("DraftNumber"),
attribution = username ? draftAuthor.replace("$1$",username) : "";
do {
draftTitle = "Draft " + (c ? (c + 1) + " " : "") + "of '" + title + "'" + attribution;
draftTitle = draftBaseTitle.replace("$1$", (c ? draftNumber.replace(draftNumber, "$1$") : "")).replace("$2$", title).replace("$3$",attribution);
c++;
} while(this.tiddlerExists(draftTitle));
return draftTitle;
Expand Down
3 changes: 3 additions & 0 deletions languages/zh-Hans/Misc.multids
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ ConfirmAction: 是否要继续?
Count: 计数
DefaultNewTiddlerTitle: 新条目
Diffs/CountMessage: <<diff-count>> 个差异
DraftAuthor: $1$撰写的
DraftNumber: $1$
DraftTitle: $3$“$2$”的草稿$1$
DropMessage: 现在放下(或按 ESC 键取消)
Encryption/Cancel: 取消
Encryption/ConfirmClearPassword: 您要清除密码吗?当保存此维基时,这将删除已套用的加密
Expand Down
Loading