Closed trsh closed 5 years ago
Visual labels of things should never be used identifiers
Why not? You can use custom templates, where you can write any titles. And since the names are unique, each time writing the same line for the identifier would be inconvenient
Because it can get long, it can get Chinese, etc.
Why not x2 ? If there is a correct encoding, then all this will be safely stored in JSON format. After all, there is "data" property in addition to the "name" field, in which anything chars can be stored
@Ni55aN
1) I can write Title in my language "Lielais Lācis", because it needs to be in my language represented. And then other foreign programmers will have to wonder what's that . I can have also translations. Etc. I can go wrong is so much directions.
2) The second solution actually presents no dangers to existing solution. Just opportunities.
@trsh
<div class="name">{{name | translate}}</div>
var translations = {
ru:{
'hello': 'привет'
}
}
alight.filters.translate = function(exp, scope) {
return function(value) {
return translations.ru[value]
}
}
So even I have a tiny nodes system, I have to add custom template to deal with the Name thing? Seems odd to me.
Adding custom data to json, on component level, still seams a good idea to me.
Let's summarize:
.vue
component for node (since a v1.0.0) examplemeta
property where you can put a metadata (data that does not affect the result of processing the scheme)By the way, there is a great translation tool called vuex-i18n
So I'm processing workers on back-end. I cloned the c++ code (https://github.com/retejs/cpp-engine) to Rust, and I have one big issue. It's that
title
(I guessname
in current v.) is used to identify the workers. Strings that represent Visual labels of things should never be used identifiers. Because it can get long, it can get Chinese, etc. So possible solutions:1) Boxed: let's add and ID for component, that has some limitations in characters. 2) Universal: let's add some custom param for Component, where we can put any JSON, and it will be added to editor.toJSON(), to any node. Than programmer can decide on it's self, how to organize the identifiers.