Hi Ilya

> I am completely lost with plugin translations.

The core doesn’t currently support translations for plugins, I’m afraid. That 
doesn’t stop you making a plugin that has multiple translations, but it means 
that you have to roll your own, including building an equivalent of the `lingo` 
macro.

> 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`

Here’s one approach:

<$set name="myLingoBase" value={{{ 
[[$:/plugins/plugin_vendor/plugin_name/]addsuffix{$:/language}]  }}}>

Translated, wikified string: <$transclude tiddler={{{ 
[<myLingoBase>addsuffix[/MyTranslatedString]] }}}/>

Alternatively, without wikification: <$text text={{{ 
[<myLingoBase>addsuffix[/MyTranslatedString]get[text]] }}}/>

</$set>

Here we construct a variable “myLingoBase” that will end up containing a string 
such as "$:/plugins/plugin_vendor/plugin_name/$:/languages/en-GB”. Then when we 
want to access a particular translatable string we just concatenate the final 
portion of the tiddler name and transclude it.

Best wishes

Jeremy


> 
> 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 [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/tiddlywiki 
> <https://groups.google.com/group/tiddlywiki>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/CAP2DrbT0d1J4kkzzTZ%2BuDUurk4ns4JFAr21VM_Sa2xbozch7RQ%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/tiddlywiki/CAP2DrbT0d1J4kkzzTZ%2BuDUurk4ns4JFAr21VM_Sa2xbozch7RQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/0E045B52-D207-43C7-9E4E-61E71BCAF019%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to