I can help you for one :
Your fake language plugin is almost good. The flag icon has to be embedded
in the language plugin ($:/languages/uk-UA)
replace
{"tiddlers": {}}
with
{"tiddlers": {
"$:/languages/uk-UA/icon":{
"text": "<svg xmlns=\"http://www.w3.org/2000/svg\" height=\"480\"
width=\"640\" viewBox=\"0 0 640 480\">\n <g fill-rule=\"evenodd\"
stroke-width=\"1pt\">\n <path fill=\"#ffd500\" d=\"M0 0h640v480H0z\"/>\n
<path fill=\"#005bbb\" d=\"M0 0h640v240H0z\"/>\n </g>\n</svg>",
"title": "$:/languages/uk-UA/icon",
"type": "image/svg+xml"
}
}}
For the second (title translations), a workaround could be modifying
tiddler template ($:/core/ui/ViewTemplate/title) to display a lg-LG_title
field (if exists through a $view widget) instead of <$view field="title" />.
You will also have to put a macro to call the good field based upon
$:/Language tiddler... But, as I told you before, no solution is simple for
this. I'll take a look, but not immediately...
cheers
*Sylvain*
[email protected]
http://sylvain.comte.online.fr
On Tue, Aug 6, 2019 at 3:42 PM oleghbond <[email protected]> wrote:
> Thanks for your support. As though I've managed to sort out the issue.
>
> That is the pseudo-plugin:
>
> author: OleghBondarenko
> core-version: >=5.0.0
> description: Ukrainian (Ukrainian)
> name: uk-UA
> plugin-type: language
> title: $:/languages/uk-UA
> type: application/json
>
> {"tiddlers": {}}
>
> and this is the flag:
>
> title: $:/languages/uk-UA/icon
> type: image/svg+xml
>
> <svg xmlns="http://www.w3.org/2000/svg" height="480" width="640" viewBox="0
> 0 640 480">
> <g fill-rule="evenodd" stroke-width="1pt">
> <path fill="#ffd500" d="M0 0h640v480H0z"/>
> <path fill="#005bbb" d="M0 0h640v240H0z"/>
> </g>
> </svg>
>
> I checked and it works as you described.
>
> However, the two following issues left:
>
> 1. How to make the Ukrainian flag to be revealed at the language
> switcher widget panel? At the moment I can see the text
> *Ukrainian (Ukrainian**)* only.
> 2. How to manage with translation of tiddler titles?
>
> Olegh
>
>
> понеділок, 5 серпня 2019 р. 13:10:44 UTC+3 користувач SylvainComte написав:
>>
>> Hi Olegh,
>>
>> You seem do anything like it should be... You should have a message from
>> the wiki telling you a tiddler is missing, or a crash message from the
>> wiki.
>>
>> It's pretty hard to tell you what happens. Here are some hints /
>> questions / reflexions, but I do not have any certainity.
>>
>> - "Nothing happens" might be a sign that the macro was not loaded. As it
>> is a js macro, you will have to save and reload the wiki before it works.
>> Pretty sure you did, but "just in case"...
>> - Do you know which version of tiddlywiki you are using? I'm unsure if my
>> macro is using some recent core features.
>> - I did notice there is no official "uk-UA" language plugin in the TW
>> library. It will not prevent you from creating your wiki, but you will have
>> to create a (at least a fake one) plugin to allow language switching.
>>
>> As an example, I took your protw.github.io sample and made some edit to
>> demonstrate the plugin. If you can't get what happened and if you don't
>> mind, feel free to join your own "not working" wiki. I could make some
>> tests to investigate further.
>>
>> warm regards,
>>
>> Sylvain
>> @sycom
>>
>>
>> Le dimanche 4 août 2019 20:03:59 UTC+2, oleghbond a écrit :
>>>
>>> Thanks Sylvian for the i18n macro.
>>>
>>> I've got an idea to equip some of my open TW resources with multilingual
>>> capabilities. The demonstration of your site looks simple and convincing.
>>>
>>> However, in practice I stumbled immediately. I dragged-and-dropped the
>>> i18n macro into my test monolingual (EN) TW. I allowed the language
>>> switcher at the sidebar. Then I put in a tiddler text a macro expression
>>> sort of: '*<<i18n "Щодо стандарту української російської мови"
>>> "$:/boa/texts" false "uk-UA">>*' (from https://protw.github.io/ukr/
>>> <https://www.google.com/url?q=https%3A%2F%2Fprotw.github.io%2Fukr%2F&sa=D&sntz=1&usg=AFQjCNE3rIdeTPjE1DeLu7h_favqk5P9RA>).
>>> And then ... nothing happens. I'm sure I missed something important.
>>> However, the tips on the issue in internet are scarce and sparse.
>>>
>>> Could you help me as for a dummy to get your macro working?
>>>
>>> Grateful in advance. Olegh
>>>
>>> вівторок, 7 травня 2019 р. 15:28:41 UTC+3 користувач SylvainComte
>>> написав:
>>>>
>>>> HelloThere,
>>>>
>>>> sorry for the flood, but I have been working on various things and did
>>>> not publish here during the process. But I think it's better to have one
>>>> thread for each item...
>>>>
>>>> First, let me introduce the i18n macro that will enable multilingual
>>>> versions of your tiddlers (You will have to install corresponding languages
>>>> plugin to make it work properly)
>>>>
>>>> - create the tiddler
>>>> - use <<i18n>>
>>>> - edit original and translated versions of your text
>>>>
>>>> That's it, switching wiki language will also switch for your tiddlers...
>>>>
>>>> - <<i18n>> macro
>>>>
>>>> <http://sycom.gitlab.io/TiddlyWiki-Plugins/#i18n%20macro:%5B%5BA%20plugin%20collection%5D%5D%20%5B%5Bi18n%20macro%5D%5D>
>>>>
>>>>
>>>> cheers and stay tuned,
>>>>
>>>> *Sylvain*
>>>> [email protected]
>>>> http://sylvain.comte.online.fr
>>>>
>>> --
> 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/ATHJzp0SitM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/tiddlywiki/e1dc7793-028d-48d6-b768-e81010e3c40e%40googlegroups.com
> <https://groups.google.com/d/msgid/tiddlywiki/e1dc7793-028d-48d6-b768-e81010e3c40e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
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 view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/CAOWAUqEZGVHD83sZY6NyHGQZfOQfGMcun0W90jvVZ%3D7W0FtrCA%40mail.gmail.com.