Closed beepsoft closed 8 months ago
I've been meaning to document our email chat here:
Yes - that's all find and sounds good. Those properties are not currently used and describo does not validate the profile so having them there is ok. It's a good idea - something to come back to in time.
@beepsoft
Please take a look at https://github.com/describo/crate-builder-component/tree/implementing-profile-translations
This branch is a proof of concept for supporting localisation in the profiles. In the screenshot the second type for Author is 'Hombre' and the type for date is "When it happened". This is defined in a translations property in the profile. This example uses the blank crate and "Profile with all primitive and no groups".
We could just have a label on each class in the profile but then we would also need to define translations for the primitives like Text and Date somewhere which is why I've added this translations property.
What do you think?
If you don't want to translate the primitives then having a label on the class definition is a nicer solution I think.
Yes, I agree, this is a better approach. With the "translations" we can translate class names that are defined outside of the profile (practically in schema.org). The only thing that maybe confusing is that "translations" is just too broad, maybe use "classTranslations" to make it more specific?
I agree that translations is too broad but I'm not sold on classTranslations because it can be used to translate anything (classes and type primitives for now but who maybe other things). How about "localisation"?
Or maybe a structured thing?
{
"localization": {
"classes": {
"Text": "Szöveg"
}
}
}
That will make the code a little more complex:
At the moment it's very simple. Any type or class or whatever, if found as a key in the localisation property will return the value otherwise the lookup key.
I see. Ok, this is fine for me for now and it will work until there's no name clash between class names and other localizable items later.
ok. I'll create a release with this tomorrow.
Done!
Currently classes are defined with these 3 properties in a Describo Profile:
The crate builder component then uses the class's name as found as the key in
classes
. For example, this raw class name is displayed in the context entity browser.It would be great if we were able to specify a - translatable - label and help text for classes the same way we can for fields (inputs).
For example:
Whenever the class's name is to be displayed to the user, the component would use the
label
if available, and falls back to the class's name if it is not. The help text could be shown, for example, whenever hovering the name of the class or some other places in the future.