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

Document that the API urls are multilingual #1497

Open
susanodd opened this issue Feb 10, 2025 · 0 comments · May be fixed by #1503
Open

Document that the API urls are multilingual #1497

susanodd opened this issue Feb 10, 2025 · 0 comments · May be fixed by #1503
Assignees

Comments

@susanodd
Copy link
Collaborator

susanodd commented Feb 10, 2025

  • The API urls are multilingual. They have already been multilingual since last October, because the UvA users use the Dutch phonology.

  • Because the Wiki examples page was removed, it is not evident on Swagger that the urls are multilingual, because Swagger does not accommodate the Accept-Language header.

  • It is not feasible to add the Accept-Language code to Swagger, without hacking Swagger. (There are examples of this on the web, but those users are not using Django.)

The easiest, least amount of English and Json typing is to simply do it this way:

Issue: Document that the API also works with gloss fields and field choices in Dutch.

Propose to do it this way:

  • add an optional language code to the url itself as shown below:

This can be done simply with an illustration of one url:

get_gloss_data/{datasetid}/{glossid}/
get_gloss_data/{datasetid}/{glossid}/(en|nl|zh-hans)/

In the first case, the exact same url is used. This defaults to English, unless the user is using the Accept-Language in their request.
This is what happens with Swagger, which uses English.

For the second case, the Swagger example is added:

get_gloss_data/{datasetid}/{glossid}/nl/

For this, the Dutch fields and example output with Dutch phonology can be shown. This can also be done for Chinese.

@susanodd susanodd changed the title Document that the API is multilingual for gloss fields and phonology Make the API urls be multilingual Feb 13, 2025
@susanodd susanodd self-assigned this Feb 13, 2025
@susanodd susanodd changed the title Make the API urls be multilingual Document that the API urls are multilingual Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant