Ilya, I would love to help, and would love to know, so I can improve my own solution.
Have you looked in https://tiddlywiki.com/dev/ ? Regards Tony On Friday, November 16, 2018 at 6:16:20 AM UTC+11, ILYA Khlopotov wrote: > > One idea I tried and cannot make it work is > > create $:/language/ru-RU/plugins/vendor/name/Note/Text > > \define translate(title) > <$wikify name="location" > text="""$:/language/{{{[title{$:/language}removeprefix[$:/languages/]]}}}/plugins/vendor/name/$title$"""> > <<location>> > <$wikify> > \end > > <<translate Note/Text>> > > The generated link to translation tiddler is correct (it opens the right > tiddler on click), but I cannot transclude it. > > Best regards, > iilyak > > > > On Mon, Nov 12, 2018 at 1:46 PM ILYA Khlopotov <ilya.kh...@gmail.com > <javascript:>> wrote: > >> I am completely lost with plugin translations. >> >> The core has `lingo` macro. So I tried to use it as follows: >> >> languages/ru-RU/Note.multids: >> ``` >> title: $:/language/plugins/plugin_vendor/plugin_name/ >> >> Note: New Note >> ``` >> >> I used it in tiddlers as follows >> ``` >> \define lingo-base() $:/language/plugin_vendor/plugin_name/ >> >> <<lingo Note>> >> ``` >> >> This seem to work at first. However when I added more translations only >> one was always selected. The values were overwritten because all >> translations are mapped to the same tiddler. I found another problem with >> this approach it didn't work inside widgets. For example following syntax >> didn't work >> ``` >> <$edit-text >> tiddler="$:/temp/idea" >> field="provisory_title" >> placeholder=<<lingo Note>> >> tag="input" class="tw-edit-texteditor"/> >> ``` >> >> So I came to a conclusion that lingo macro is internal thing which is not >> supposed to be used in plugins (I could be wrong). >> >> Therefore I need to find another way to achieve my goal (bundle plugin >> with multiple translations). I think I should rely on the value returned by >> `$:/language/`, but I don't know how to write a macro which would >> concatenate the result returned by `$:/language/` with path to namespace of >> the plugin. I thought to store translation tiddlers under either: >> - `$:/language/ru_RU/plugins/plugin_vendor/plugin_name/Note.multids` >> - `$:/plugins/plugin_vendor/plugin_name/languages/ru-RU/Note.multids` >> >> Macro is a simple text substitution so it doesn't get the value of >> `$:/language/`. Do I need: >> - a nested transclusion syntax >> - use of macrocall >> - use set or vars widget >> >> Best regards, >> iilyak >> > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+unsubscr...@googlegroups.com. To post to this group, send email to tiddlywiki@googlegroups.com. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/9dce4fa6-2041-4eba-985c-7d43fbb2e0df%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.