I want to create field with Russian letters

179 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Siniy-Kit

ungelesen,
23.12.2020, 02:09:4423.12.20
an TiddlyWiki
Many years ago I try to make new field "цвет" with value "красный" but it was impossible, because  all tiddlers  are saved in this format


<div caption="tm-remove-field" created="20140908185153663" modified="20140908185153663" tags="Messages" title="WidgetMessage: tm-remove-field" type="text/vnd.tiddlywiki">

<pre>The `tm-remove-field` message is handled by the FieldManglerWidget. It removes the specified field......
</pre>
</div>

 So our fields are  html attributes, so they can't   contain Russian letters :(

BUT we can use js encodeURIComponent("цвет") and put it as attribute to make it work.
Why this mechanism is still not working in Tiddlywiki?


 

Siniy-Kit

ungelesen,
23.12.2020, 03:01:1323.12.20
an TiddlyWiki
little demo for my question 
if you edit tiddler you can see  this
Снимок экрана 2020-12-23 105802.png
it will be nice to use this field in filters whithout  +[decodeuri[]]  

среда, 23 декабря 2020 г. в 10:09:44 UTC+3, Siniy-Kit:

Jeremy Ruston

ungelesen,
23.12.2020, 08:01:4923.12.20
an TiddlyWiki Group
Hi Siniy-Kit

As you’ve discovered, field names currently only work reliably and consistently if are composed of the a-z, 0-9, dash and underscore. It is not trivial to fix because of the way that the code expects to be able to roundtrip fieldnames into attribute names. I think it would require an update to the TiddlyWiki HTML file format.

Best wishes

Jeremy

On 23 Dec 2020, at 08:01, Siniy-Kit <nera...@gmail.com> wrote:

little demo for my question 
if you edit tiddler you can see  this
<?????? ? ????? 202 0-12-23 105802.png>
it will be nice to use this field in filters whithout  +[decodeuri[]]  

среда, 23 декабря 2020 г. в 10:09:44 UTC+3, Siniy-Kit: 
Many years ago I try to make new field "цвет" with value "красный" but it was impossible, because  all tiddlers  are saved in this format


<div caption="tm-remove-field" created="20140908185153663" modified="20140908185153663" tags="Messages" title="WidgetMessage: tm-remove-field" type="text/vnd.tiddlywiki">

<pre>The `tm-remove-field` message is handled by the FieldManglerWidget. It removes the specified field......
</pre>
</div>

 So our fields are  html attributes, so they can't   contain Russian letters :(

BUT we can use js encodeURIComponent("цвет") and put it as attribute to make it work.
Why this mechanism is still not working in Tiddlywiki?


 

-- 
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a4836968-3efd-4fba-897f-fe91deb6e345n%40googlegroups.com.
<?????? ? ????? 202 0-12-23 105802.png>

Xavier Cazin

ungelesen,
23.12.2020, 12:09:2023.12.20
an tiddl...@googlegroups.com
Hi Siniy-Kit, Jeremy,

From my experience, naming fields with any Unicode (utf-8) names hasn't brought any issues,
as far as I don't use the EditTemplate (which explicitly refuses non-ascii characters for naming fields)
but rather an action widget like action-setfield. For instance,

<$button>
<$action-setfield $tiddler="проверка" $field="цвет" $value="красный"/>
Пойдем</$button>

<$list filter="[has[цвет]]">
<$text text={{{ [<currentTiddler>addprefix[The tiddler ]] }}}/>
<$text text={{{ [<currentTiddler>get[цвет]addprefix[ has a field named цвет, with a value of ]] }}} />.
</$list>

Brings the expected results in current 5.1.22 and Firefox after you click on Пойдем.

Siniy-Kit, do you have a counter-example where the field name is not recognized in a filter?
-- Xavier


Eric Shulman

ungelesen,
23.12.2020, 12:36:2723.12.20
an TiddlyWiki
On Wednesday, December 23, 2020 at 9:09:20 AM UTC-8 Xavier wrote:
From my experience, naming fields with any Unicode (utf-8) names hasn't brought any issues, 

While $action-setfield allows you to create a field name using almost any characters, the issue is whether the field name remains unchanged after saving and reloading the file.

For example, I can use $action-setfield to create a tiddler field name that uses mixed case (e.g., "SomeFieldName"), and that fieldname will work just fine in a filter during that session (e.g., "{{{ [[SomeTiddler]get[SomeFieldName]] }}}").

However, after I save and reload the file, the fieldname will become "somefieldname", and the filter then fails.

-e

Xavier Cazin

ungelesen,
23.12.2020, 16:05:1923.12.20
an tiddl...@googlegroups.com
Hi Eric,

Oh I see, thank you for the enlightenment! 

I realise that up to now I used extended field names only with wikis running on NodeJS, not ones saved in an HTML file. 

Cheers,
Xavier

--
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+...@googlegroups.com.

Hans Wobbe

ungelesen,
23.12.2020, 16:58:0923.12.20
an TiddlyWiki
@Jeremy:

Your reply to Siniy-Kit cited:   "... a-z, 0-9, dash and underscore..."  I have been under the impression that "dot" (".")  is also supported and I use it quite a bit.  Did your reply simply omit it, or has there been a change that has not bitten me yet, or are you contemplating dropping it?

Cheers,
Hans

Siniy-Kit

ungelesen,
24.12.2020, 02:36:3024.12.20
an TiddlyWiki
Hi  Jeremy. Thank you for answer. Many people don't know  about html attributes and so on. And it looks strange for them, when they get this alert,
 Illegal characters in field name "цвет". Fields can only contain lowercase letters, digits and the characters underscore (_), hyphen (-) and period (.)

I think it will be better to create this  "wrong" field in tiddler, BUT  with encodeURI field name in html code.
AND in tiddler edit interface nearby this "wrong"  fieldname will be small button [!?]  with small $reveal 

your field name contains Illegal characters. Rename it, or  use it's encoded variant  name in filters  %D1%86%D0%B2%D0%B5%D1%82

I think   it will make tiddlywiki more friendly for all users. 

среда, 23 декабря 2020 г. в 16:01:49 UTC+3, jeremy...@gmail.com:

Thomas Stone

ungelesen,
25.12.2020, 18:21:5925.12.20
an TiddlyWiki
FYI: I was able to verify the button provided by Xavier on the sample TW that Siniy-Kit provided. His link opens a specific Tiddler. I edited that tiddler and pasted in the below code. I was also able to verify Eric Shulman's comment that the field names are converted to lower case upon saving.

The sample Tiddler already had two fields with a "parametr-" prefixed name. Those are shown in the "See already existing fields". His fields looked like this.

Field: -parametr-%D1%86%D0%B2%D0%B5%D1%82-
Field: -parametr-%D1%80%D0%B0%D0%B7%D0%BC%D0%B5%D1%80-  

The button provided by Xavier did set the value correctly.

After saving the wiki and re-opening from my Downloads directory, I added the "#567567811" bookmark tag to the end of the address bar. This brought up the originally edited Tiddler. The field name set by the button provided by Xavier was persisted and still showed correctly. The original "paremetr-" prefixed fields had their hexadecimal values turned into lowercase.

Field: -parametr-%d1%86%d0%b2%d0%b5%d1%82-
Field: -parametr-%d1%80%d0%b0%d0%b7%d0%bc%d0%b5%d1%80-  


```
!!Set field using button

<$button>
<$action-setfield $tiddler="проверка" $field="цвет" $value="красный"/>
Пойдем</$button>

<$list filter="[has[цвет]]">
<$text text={{{ [<currentTiddler>addprefix[The tiddler ]] }}}/>
<$text text={{{ [<currentTiddler>get[цвет]addprefix[ has a field named цвет, with a value of ]] }}} />.
</$list>

!!See already existing fields
<$list filter="[fields[]prefix[para]]">Field: -<<currentTiddler>>-<br>
</$list>
```

Siniy-Kit

ungelesen,
26.12.2020, 06:16:3126.12.20
an TiddlyWiki
Positiv,  thank you for experiment. I don't know  that attributes can be with Russian letters
<div created="20201226110548100" creator="HEEG.HTML free on-line store" modified="20201226110634850" modifier="HEEG.HTML free on-line store" title="проверка" цвет="красный"><pre></pre></div>  

I test it with space "цвет мой"  unfortunately it don't work

<div created="20201226110548100" creator="HEEG.HTML free on-line store" modified="20201226111148894" modifier="HEEG.HTML free on-line store" title="проверка" цвет="красный" цвет мой="красный"><pre></pre></div>  
суббота, 26 декабря 2020 г. в 02:21:59 UTC+3, positiv...@gmail.com:

Thomas Stone

ungelesen,
28.12.2020, 00:34:3228.12.20
an TiddlyWiki
You said, "I don't know  that attributes can be with Russian letters". I cannot see what you tried and what error you saw.

When I open a Wiki file and create a new Tiddler, the Tiddler Editor says "Add a new field" at the bottom. I put in a field name of "цвет" and a field value of "цвет", and then click the "Add" button. This shows a dialog box complaining about the field name. Closing the dialog erases the field name and field value that I tried to enter.

Is that the error that is stopping you from using Russian letters in attributes? This is a known issue in TiddlyWiki, as Jeremy replied earlier.

You CAN use a ButtonWidget to call an Action that creates a Tiddler field with a Russian name. This attribute is saved in the Wiki file and can be seen again when you re-open the Wiki file.

Please provide some screenshots of your issue if it is something different than this.







Thomas Stone

ungelesen,
28.12.2020, 00:36:1628.12.20
an TiddlyWiki
I was unable to get my screenshots to submit with the post. Email me at positiv...@gmail.com if you want to send some screenshots back and forth.

Thomas Stone

ungelesen,
28.12.2020, 00:39:2728.12.20
an TiddlyWiki
positivesigner is my username at gmail.com.

Siniy-Kit

ungelesen,
28.12.2020, 01:56:2528.12.20
an tiddl...@googlegroups.com
It is not my problem. It is problem of TW5.   

Снимок экрана 2020-12-28 095212.png



понедельник, 28 декабря 2020 г. в 08:34:32 UTC+3, positiv...@gmail.com:

TW Tones

ungelesen,
06.01.2021, 02:00:0606.01.21
an TiddlyWiki
Siniy

The following tiddler seems to be where the new field creation logic is. If manipulated you may be able to create other fields but it is not clear what implications this would have. Test on an empty.html and save and reload, list and search then ask the dev team if they can tell you what the consequences are. It is possibly aligned with the rules that apply to Javascript and html. How do they handle alternate languages?

A workaround may be to use indexes in a data tiddler to define fields with other index values such as a fieldname, then the value stored will be equivalent to a named field, I do not expect the same restrictions to apply.

However a quick test like this {{{ [[data]getindex[цвет]] }}} did work on a tiddler named data containing цвет: красный with the type application/x-tiddler-dictionary.

The Query did return красный

tiddlername
$:/tiddlername/datafields (a data or JSON tiddler
Use index as fieldname, value as fieldvalue
Use serial number and/or relink plugin with additional settings, if tiddlername rename is needed

There is a fair argument that fieldnames could use alternate language alphanumeric's but the code refactoring may be prohibitive and this may be for future major versions of tiddlywiki.

Regards
Tones

Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten