Add "aliases" property to fictionless model #627
-
Hi all, I have a question regarding the language used for field naming and schema descriptions. Our French users are not always familiar with computers, nor with English. But on the other hand, we see the benefit of naming our fields in English for better interoperability between countries. Is there a possibility in the tableschema schema description to have multiple versions of descriptions and naming depending on the language. I am thinking for example of a "name" field in English and a "aliases" field which will be an array of different accepted aliases. But for this to work, frictionless would have to accept to validate files whose field names are those contained in this array. I am curious to know if you have already think about it and to get your advice on this. Thanks ! Geoffrey from Etalab |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Good question, @geoffreyaldebert ! Language and translation support is already in the Frictionless Specs and you can use them. I agree it might not be super easy to find, as they are under the "Patterns" section of the documentation, and searching the specs site for "Language" does not bring those results, so perhaps that can be improved. But, to use a field in a different language, just use a new field with a suffix, like field_name@lang, and it should be interpreted as the translation of another field. E.g. Considering that you are concerned more with the language of fields' names than with their values, perhaps the first example there would be of more use to you: {
"name": "sun-package",
"languages": ["fr", "en"],
"title": "Sol"
}
# which is equivalent to
{
"name": "sun-package",
"languages": ["fr", "en"],
"title": {
"": "Sol",
"fr": "Soleil"
}
} Unfortunately, the documentation says
so to present this in an user interface you'd probably have to make a script to preprocess the file yourself, replacing the field names according to the data package descriptor before handling the table to the user. This shouldn't be hard to do, though. |
Beta Was this translation helpful? Give feedback.
Good question, @geoffreyaldebert !
Language and translation support is already in the Frictionless Specs and you can use them. I agree it might not be super easy to find, as they are under the "Patterns" section of the documentation, and searching the specs site for "Language" does not bring those results, so perhaps that can be improved.
But, to use a field in a different language, just use a new field with a suffix, like field_name@lang, and it should be interpreted as the translation of another field. E.g.
Considering that you are concerned more with the language of fields' names than with their values, perhaps the first example there would be of more use to you: