Hi Jeremy,
I'm looking into this too. While your response make good sense to me, I do
have one question:
Given the mechanism of the $tw.Language module, and how plugin language
translations could theoretically be separate from the plugins they're
translating, wouldn't the most appropriate naming convention be:
*$:/language/plugin_vendor/plugin_name/...*
as opposed to: *$:/plugins/plugin_vendor/plugin_name/language/...*
I know it doesn't make a difference while plugin translations aren't
supported, but I'd hate to have to redo my plugins after the fact, and it
seems to me that the plugin translations would likely install in the "
*<tiddlywiki_dir>/languages*". Maybe for example: "
*<tiddlywiki_dir>/languages/plugin_vendor/plugin_name/fr-FR*"
or at least somewhere other than the plugins directory.
Feel free to tell me it doesn't matter. I'm one of those people who's
pedantic to sticking to coding conventions perfectly.
Thanks,
-Flibbles
On Tuesday, November 20, 2018 at 4:36:35 AM UTC-5, Jeremy Ruston wrote:
>
> 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] <javascript:>.
> To post to this group, send email to [email protected]
> <javascript:>.
> 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/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.
>
>
>
--
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/ae5a8b37-3d6e-4950-a0c5-adb16998555c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.