Re: [tw5] How to do plugin translations

2019-05-14 Thread Sylvain Comte
Well, the macro was designed to help autonomous translation for devs or
users in a easy and clearly distinct way from <>. It's transparent
for users and doesn't use bundled tiddlers.

I'm a bit agnostic about the best convention to adopt. I'm sure that there
would be better advice here around (or on the dev forum)

By the way it's pretty easy to hack the i18n macro to change behaviour. So
we just have to decide ;-)

Best regards

Sylvain
@sycom

Le mar. 14 mai 2019 à 20:08, Flibbles  a
écrit :

> All right. So i18n can support whatever domain I configure it to, but then
> that brings me back to my original question. What would be the most
> appropriate domain to use.
>
> *$:/plugins/vendor_name/plugin_name/...*
>
> or
>
> *$:/language/vendor_name/plugin_name/...*
>
> Convention suggests the first, but the second makes more sense if you
> consider that plugin translations would be separate from the plugins, and
> it seems like it may be more appropriate for a final solution.
>
> -Flibbles
>
> On Tuesday, May 14, 2019 at 10:49:40 AM UTC-4, SylvainComte wrote:
>>
>> Just to be complete about this, see usage for Feather Icons Plugin
>> ,
>> i18n tiddlers are
>>
>>- ...
>>- $:/plugins/sycom/feather-icons/i18n/en-GB
>>- $:/plugins/sycom/feather-icons/i18n/en-GB/macrosIntro
>>- $:/plugins/sycom/feather-icons/i18n/en-GB/readme
>>- $:/plugins/sycom/feather-icons/i18n/en-GB/usage
>>- $:/plugins/sycom/feather-icons/i18n/fr-FR
>>- $:/plugins/sycom/feather-icons/i18n/fr-FR/macrosIntro
>>- $:/plugins/sycom/feather-icons/i18n/fr-FR/readme
>>- $:/plugins/sycom/feather-icons/i18n/fr-FR/usage
>>- ...
>>
>> cheers
>>
>> Sylvain
>> @sycom
>>
>> Le mardi 14 mai 2019 11:00:44 UTC+2, SylvainComte a écrit :
>>>
>>> Hello,
>>>
>>> The behaviour is somewhat different with the domain parameter : your
>>> translations will be in
>>>
>>> domain/i18n/lg-LG
>>>
>>> Default value is $:/ but it's up to you and might be
>>> $:/plugins/plugin_vendor/plugin_name and your translations will be in
>>>
>>> $:/plugins/plugin_vendor/plugin_name/i18n/lg-LG
>>>
>>> So it seems there's no conflict with your philosophy. But I guess
>>> documentation should be more explicit.
>>>
>>> Cheers
>>>
>>> Sylvain
>>> @sycom
>>>
>>> --
> You received this message because you are subscribed to a topic in the
> Google Groups "TiddlyWiki" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/tiddlywiki/h4UAjwbkdAk/unsubscribe.
> To unsubscribe from this group and all its topics, 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/d78b838d-8594-442e-b5bc-d42b7259f884%40googlegroups.com
> 
> .
> 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 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/CAOWAUqHHBrr-HNjS3D7ZqjmvQUgZBXnqw6bHpeWjGCS0j0nW_g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw5] How to do plugin translations

2019-05-14 Thread Flibbles
All right. So i18n can support whatever domain I configure it to, but then 
that brings me back to my original question. What would be the most 
appropriate domain to use.

*$:/plugins/vendor_name/plugin_name/...*

or

*$:/language/vendor_name/plugin_name/...*

Convention suggests the first, but the second makes more sense if you 
consider that plugin translations would be separate from the plugins, and 
it seems like it may be more appropriate for a final solution.

-Flibbles

On Tuesday, May 14, 2019 at 10:49:40 AM UTC-4, SylvainComte wrote:
>
> Just to be complete about this, see usage for Feather Icons Plugin 
> , 
> i18n tiddlers are
>
>- ...
>- $:/plugins/sycom/feather-icons/i18n/en-GB
>- $:/plugins/sycom/feather-icons/i18n/en-GB/macrosIntro
>- $:/plugins/sycom/feather-icons/i18n/en-GB/readme
>- $:/plugins/sycom/feather-icons/i18n/en-GB/usage
>- $:/plugins/sycom/feather-icons/i18n/fr-FR
>- $:/plugins/sycom/feather-icons/i18n/fr-FR/macrosIntro
>- $:/plugins/sycom/feather-icons/i18n/fr-FR/readme
>- $:/plugins/sycom/feather-icons/i18n/fr-FR/usage
>- ...
>
> cheers
>
> Sylvain
> @sycom
>
> Le mardi 14 mai 2019 11:00:44 UTC+2, SylvainComte a écrit :
>>
>> Hello,
>>
>> The behaviour is somewhat different with the domain parameter : your 
>> translations will be in 
>>
>> domain/i18n/lg-LG
>>
>> Default value is $:/ but it's up to you and might be 
>> $:/plugins/plugin_vendor/plugin_name and your translations will be in
>>
>> $:/plugins/plugin_vendor/plugin_name/i18n/lg-LG
>>
>> So it seems there's no conflict with your philosophy. But I guess 
>> documentation should be more explicit.
>>
>> Cheers
>>
>> Sylvain
>> @sycom
>>
>>

-- 
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/d78b838d-8594-442e-b5bc-d42b7259f884%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw5] How to do plugin translations

2019-05-14 Thread SylvainComte
Just to be complete about this, see usage for Feather Icons Plugin 
, i18n 
tiddlers are

   - ...
   - $:/plugins/sycom/feather-icons/i18n/en-GB
   - $:/plugins/sycom/feather-icons/i18n/en-GB/macrosIntro
   - $:/plugins/sycom/feather-icons/i18n/en-GB/readme
   - $:/plugins/sycom/feather-icons/i18n/en-GB/usage
   - $:/plugins/sycom/feather-icons/i18n/fr-FR
   - $:/plugins/sycom/feather-icons/i18n/fr-FR/macrosIntro
   - $:/plugins/sycom/feather-icons/i18n/fr-FR/readme
   - $:/plugins/sycom/feather-icons/i18n/fr-FR/usage
   - ...

cheers

Sylvain
@sycom

Le mardi 14 mai 2019 11:00:44 UTC+2, SylvainComte a écrit :
>
> Hello,
>
> The behaviour is somewhat different with the domain parameter : your 
> translations will be in 
>
> domain/i18n/lg-LG
>
> Default value is $:/ but it's up to you and might be 
> $:/plugins/plugin_vendor/plugin_name and your translations will be in
>
> $:/plugins/plugin_vendor/plugin_name/i18n/lg-LG
>
> So it seems there's no conflict with your philosophy. But I guess 
> documentation should be more explicit.
>
> Cheers
>
> Sylvain
> @sycom
>
>

-- 
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/5281bebb-7d17-401b-bdd8-fafb14543f45%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw5] How to do plugin translations

2019-05-14 Thread SylvainComte
Hello,

The behaviour is somewhat different with the domain parameter : your 
translations will be in 

domain/i18n/lg-LG

Default value is $:/ but it's up to you and might be 
$:/plugins/plugin_vendor/plugin_name and your translations will be in

$:/plugins/plugin_vendor/plugin_name/i18n/lg-LG

So it seems there's no conflict with your philosophy. But I guess documentation 
should be more explicit.

Cheers

Sylvain
@sycom

-- 
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/379f2f4c-64a9-4e7e-a2ec-6985b7985f2e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw5] How to do plugin translations

2019-05-13 Thread Flibbles
So that looks like an interesting macro which addresses the problem of 
localization for now. Except it doesn't seem to answer the question of what 
the ultimate standard would become. Your macro encourages a "
*$:/i18n/language/title*" naming convention. That means language tiddlers 
inside my plugin would be named something like:

*$:/i18n/en-EN/plugin_vendor/plugin_name/Button/MyButton/Hint*

which not only doesn't conform with the 
*$:/plugins/plugin_vendor/plugin_name* convention, but steers farther away 
from what an ultimate convention would be.

Don't get me wrong. Your macro is definitely a solution to the problem. I'm 
just inquiring about what the ultimate solution will end up becoming.

-Flibbles

On Monday, May 13, 2019 at 12:44:54 AM UTC-4, SylvainComte wrote:
>
> Hello,
>
> You may find this thread on tiddlywikidev useful:
>
> https://groups.google.com/forum/#!topic/tiddlywikidev/fu0QFcs9O_U
>
> Cheers
>
> Sylvain
> @sycom
>
>

-- 
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/2378fd37-62a8-42d9-9761-5955c2dd99e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw5] How to do plugin translations

2019-05-12 Thread SylvainComte
Hello,

You may find this thread on tiddlywikidev useful:

https://groups.google.com/forum/#!topic/tiddlywikidev/fu0QFcs9O_U

Cheers

Sylvain
@sycom

-- 
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/1d81538e-6d40-43ad-a90f-3a4aec9c570e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw5] How to do plugin translations

2019-05-12 Thread Flibbles
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 "
*/languages*". Maybe for example: "
*/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={{{ 
> [addsuffix[/MyTranslatedString]] }}}/>
>
> Alternatively, without wikification: <$text text={{{ 
> [addsuffix[/MyTranslatedString]get[text]] }}}/>
>
> 
>
> 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 tiddl...@googlegroups.com .
> To post to this group, send email to tiddl...@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/CAP2DrbT0d1J4kkzzTZ%2BuDUurk4ns4JFAr21VM_Sa2xbozch7RQ%40mail.gmail.com
>  
> 
> .
> 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 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/ae5a8b37-3d6e-4950-a0c5-adb16998555c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw5] How to do plugin translations

2018-11-20 Thread Jeremy Ruston
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={{{ 
[addsuffix[/MyTranslatedString]] }}}/>

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



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 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/CAP2DrbT0d1J4kkzzTZ%2BuDUurk4ns4JFAr21VM_Sa2xbozch7RQ%40mail.gmail.com
>  
> .
> 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 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/0E045B52-D207-43C7-9E4E-61E71BCAF019%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[tw5] How to do plugin translations

2018-11-12 Thread ILYA Khlopotov
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/

<>
```

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=<>
 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/CAP2DrbT0d1J4kkzzTZ%2BuDUurk4ns4JFAr21VM_Sa2xbozch7RQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.