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

Adding end point structure for different languages. #15

Open
JianLoong opened this issue Oct 16, 2021 · 0 comments
Open

Adding end point structure for different languages. #15

JianLoong opened this issue Oct 16, 2021 · 0 comments

Comments

@JianLoong
Copy link
Owner

JianLoong commented Oct 16, 2021

Currently, all information is stored in the English language however, a more widely spoken language in Malaysia is Bahasa Malaysia or Bahasa Melayu. So, all entries should have a translated version in the national language itself.

All information with regards to the states can be found in the Wikipedia Bahasa Malaysia for example an entry for Selangor can be found here. essentially the BM entry of Wikipedia for the state of Selangor.

There are a few ways this can be approached either.

  1. Create more directories for example using endpoints like /malaysia-api/state/v1/en/selangor.json to denote that it would be in the English language and /malaysia-api/state/v1/zsm/selangor.json to denote that it would be in Bahasa Malaysia. With zsm denoting that it is standard Malay as per ISO specification here.. Basically, this way would involve creating a directory that house another set of JSON files in the Malay language.

  2. Introduce more fields into the JSON file itself and use _en and _zsm postfix to denote the language. So for example, instead of a single description string in the Selangor.json there would be two. One for the English description and another for the Malay description. (This just means, putting an extra description_zsm in the json file itself)

Both ways have their benefits and their disadvantages.

Notes.

It is indeed possible to use the Content-Negotiation strategy as mentioned here but it was decided not to do so.

30/09/2022 - Included notes regarding Content Negotiation as mentioned in the Stack Overflow post. Also edited post for clarity.

devGuadalajara added a commit to devGuadalajara/malaysia-api that referenced this issue Oct 23, 2021
fixes part of issue JianLoong#15 added contributing_es.md (Spanish translation)
@JianLoong JianLoong added the help wanted Extra attention is needed label Oct 8, 2022
@JianLoong JianLoong removed the help wanted Extra attention is needed label Sep 1, 2023
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

1 participant