Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support multiple languages #14

Open
elf-pavlik opened this issue Jul 5, 2015 · 5 comments
Open

support multiple languages #14

elf-pavlik opened this issue Jul 5, 2015 · 5 comments

Comments

@elf-pavlik
Copy link

Some canteens must already provide information in multiple languages. With increasing number of people moving around the globe more freely, supporting multiple languages sounds like a natural evolution.

Interesting tool used by frontend web apps, which uses Wikidata as source for food names
http://googleknowledge.github.io/qlabel/demo/menu/

Since I work with linked data, I find it offering some helpful ways to manage multilingual content. From API perspective and recognizing JSON becoming most popular serialization in world of web APIs, this feature of JSON-LD looks very helpful - http://www.w3.org/TR/json-ld/#string-internationalization

@jgraichen
Copy link
Member

Just to make sure, this is about (auto-)translating the meal data? (In addition to providing a localized openmensa app)

For exposing this to the API, why a format-dependent JSON-LD transport instead of Accept-Language and Content-Language headers maybe combined with Link headers for alternatives?

@elf-pavlik
Copy link
Author

Just to make sure, this is about (auto-)translating the meal data? (In addition to providing a localized openmensa app)

Yes

For exposing this to the API, why a format-dependent JSON-LD transport instead of Accept-Language and Content-Language headers maybe combined with Link headers for alternatives?

I just thought about scenario when single response contains data in many/all available languages, not just a single one. Do you have links to some real world examples of canteen data available in more than single language?

@cmur2
Copy link
Member

cmur2 commented Jul 5, 2015

I'm currently working on a parser for a canteen that outputs german and english meal descriptions along. (Since as you mentioned some canteens known the fact of more people moving around the globe, too.)

@elf-pavlik
Copy link
Author

$ curl http://openmensa.org/api/v2/canteens/234/days/2015-07-07/meals
[
  {
    "id": 1419706,
    "name": "Drillinge aus dem Backofen mit Meersalz und drei verschiedenen Saucen (2)",
    "category": "Mittagsmenü",
    "prices": {
      "students": null,
      "employees": null,
      "pupils": null,
      "others": null
    },
    "notes": [
      "(2) Milch"
    ]
  }
]

with JSON-LD one would do something in lines

  {
    "id": 1419706,
    "name": {
      "de": "Drillinge aus dem Backofen mit Meersalz und drei verschiedenen Saucen (2)",
      "en": "Ovenpotatoes with seasalt and 3 sauces (2)"
    },
    "category": { 
      "de": "Mittagsmenü",
      "en": "Lunch menu"
    },
    "prices": {
      "students": null,
      "employees": null,
      "pupils": null,
      "others": null
    },
    "notes": [
      { "de": "(2) Milch", "en": "(2) Milk" }
    ]
  }

where for cases like Milk, linking to wikidata could make a lot of sense: https://www.wikidata.org/wiki/Q8495

@mswart
Copy link
Member

mswart commented Jul 8, 2015

Changes to JSON-LD would be a major API break. Therefore it would require a API v3. In addition I miss in this example which language are native provided by the parser and which are translated.

Before we can auto-translate stuff we have to prepare the backend to handle/store menu information in multiple languages and extent the feed to allow parsers to provided meal information within multiple languages. This is on the road map but it will take some time until I find time to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants