mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-29 07:36:42 +00:00
Make draft title translatable (#8891)
* Make draft title translatable * Update change note * Improve number handling Now generates "Draft of '...' 2" instead of "Draft 2 of '...'" * Improve whitespace handling We no longer needs to add whitespace in languages. We now handle it in javascript. * Update language naming * Update zh-Hans translation * Update change note * Refactor logic to make it less complex Since we don't need to care about draft numbers, we can have two different templates for draft title with and without attribution. No need to trim the string now. Also, we can reuse the getSubstitutedText method * Update translators edition * fixup! Update translators edition * Switch to transclude and variable mechanism * Adapt translators to the new mechanism * Update change note * Further simplify the logic $tw.language.getString can already wikify translatable strings. No need for this.renderText
This commit is contained in:
28
plugins/tiddlywiki/translators/ui/group/Draft.tid
Normal file
28
plugins/tiddlywiki/translators/ui/group/Draft.tid
Normal file
@@ -0,0 +1,28 @@
|
||||
title: $:/plugins/tiddlywiki/translators/ui/group/Draft
|
||||
caption: Draft
|
||||
tags: $:/tags/TranslationGroup
|
||||
|
||||
\procedure translatableTiddlerTitles()
|
||||
[all[tiddlers+shadows]prefix[$:/language/Draft/]]
|
||||
+[sort[title]]
|
||||
\end
|
||||
\procedure shortenTitle()
|
||||
[all[current]removeprefix[$:/language/Draft/]]
|
||||
\end
|
||||
|
||||
! Draft
|
||||
|
||||
Template for the title of draft tiddlers.
|
||||
|
||||
Substitution result:
|
||||
|
||||
<$let draft-title="Motovun Jack">
|
||||
<$wikify name="draft-with-attribution" text={{$:/language/Draft/Attribution}} output="text">
|
||||
<$wikify name="draft-without-attribution" text={{$:/language/Draft/Title}} output="text">
|
||||
<$codeblock code=<<draft-with-attribution>>/>
|
||||
<$codeblock code=<<draft-without-attribution>>/>
|
||||
</$wikify>
|
||||
</$wikify>
|
||||
</$let>
|
||||
|
||||
<<translatableStringEditor>>
|
||||
@@ -6,6 +6,7 @@ tags: $:/tags/TranslationGroup
|
||||
[all[tiddlers+shadows]prefix[$:/language/]]
|
||||
-[all[tiddlers+shadows]prefix[$:/language/Buttons/]]
|
||||
-[all[tiddlers+shadows]prefix[$:/language/ControlPanel/]]
|
||||
-[all[tiddlers+shadows]prefix[$:/language/Draft/]]
|
||||
-[all[tiddlers+shadows]prefix[$:/language/Date/]]
|
||||
-[all[tiddlers+shadows]prefix[$:/language/Docs/]]
|
||||
-[all[tiddlers+shadows]prefix[$:/language/EditTemplate/]]
|
||||
|
||||
Reference in New Issue
Block a user