GfSE / SpecIF

Specification Integration Facility - schema, constraint checker and examples
Apache License 2.0
15 stars 6 forks source link

Definition of default language for a property value #24

Closed oalt closed 4 years ago

oalt commented 5 years ago

In SpecIF you can define the property values in different languages or use a simple string if you do not need multiple languages. To ensure the compatibility and the ability to convert data from simple string to multi-language representation and vice versa, an information about the used language in the string value is required.

My first idea was to define a new JSON property "defaultLanguage" in the SpecIF heading data. But the problem is, that if you use SpecIF as API data you will not always get a complete SpecIF data structure, but just a Resource, Statement or Property alone.

So the proposal is to extend the "value" for a SpecIF property with a new JSON property "defaultLanguage":

 "defaultLanguage": {
            "description": "An IETF language tag such as 'en', 'en-US, 'fr' or 'de' - specifying the default language used for this value.",
            "type": "string"
          }
odungern commented 4 years ago

Yes, indeed, that's an issue.

odungern commented 4 years ago

@oalt : Do you have a use-case where the browser-language is not adequate to determine the default language?

odungern commented 4 years ago

Approved in general in telco on 2020-01-29. @oalt points out that there is a need to declare the language in case only string values are provided. It has been agreed that a 'language' property shall be added at resource or statement level. It applies to all properties which have no language definition. It is superseded by a property's language definition.

odungern commented 4 years ago

Implemented with schema v1.0.0,