Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
S
SiB Core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 110
    • Issues 110
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Packages
    • Packages
    • Container Registry
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Startin blox
  • framework
  • SiB Core
  • Issues
  • #548

Closed
Open
Opened Dec 02, 2019 by Matthieu Fesselier@matthieu
  • Report abuse
Report abuse

Support internationalization

To make our temporary store support internationalization, we need to define which data format we want to use.

In a RDF world, language-tagged properties are expressed this way:
"Project"@en which is implicitely of type rdf:langString. (Spec here)

When using JSON-LD, we have several ways to serialize this (Spec here)

// 1. define language for one property
{
  "name": {
    "@value": "Nom du projet",
    "@language": "fr"
  }
}
// -> can not handle multi-language as we can't have several "name" properties

// 2. to define multiple languages, we have to proceed like this
{
  "@context": {
    "name_fr": {
      "@id": "rdfs:label",
      "@language": "fr"
    },
    "name_en": {
      "@id": "rdfs:label",
      "@language": "en"
    }
  },
  "name_fr": "Nom du projet",
  "name_en": "Name of the project"
}
// -> will be very long for the developers to adapt as it needs to be done for each properties

// 3. to simplify, we can use a default language
{
  "@context": {
    "@language": "fr",
    "name": "rdfs:label",
    "name_en": {
      "@id": "rdfs:label",
      "@language": "en"
    }
  },
  "name": "Nom du projet",
  "name_en": "Name of the project"
}
// -> a bit better but still not convenient

// 4. as an alternative, languages can be expressed like this:
{
  "@context": {
    "name": {
      "@id": "rdfs:label",
      "@container": "@language"
    }
  },
  "name": {
    "en": "Name of the project",
    "fr": "Nom du projet"
  }
}
// -> a bit faster to write, but still not very convenient for the developer

Maybe we can create automatically the needed context on server side to add the needed properties?
@balessan @sylvain @clement Do you have a better idea?

You can find an interesting conversation about the support of internationalization in json-ld here

Update (02/14/20):

Proposed spec

Data structure to support:

{
  "@context": {
    "@language": "fr",
    "name": "rdfs:label",
  },
  "name": "Nom du projet",
}

Determine language

To determine the language, the store must check:

  1. the local storage
  2. the browser language

Change the language

The store must provide a method to change language, which saves the user locale in the local storage.

Communicate with the server

The store must send a header 'Accept-Language' with the locale of the user.

Edited Feb 14, 2020 by Matthieu Fesselier
Assignee
Assign to
0.10
Milestone
0.10
Assign milestone
Time tracking
None
Due date
None
2
Labels
P1 need spec
Assign labels
  • View project labels
Reference: startinblox/framework/sib-core#548