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

Prevent invalid language choice errors #78

Open
mandolyte opened this issue Feb 4, 2021 · 0 comments
Open

Prevent invalid language choice errors #78

mandolyte opened this issue Feb 4, 2021 · 0 comments

Comments

@mandolyte
Copy link
Collaborator

mandolyte commented Feb 4, 2021

Today tc-create allows the user to select an org and resource and language combination that is not valid. When that happens this error is shown:

image.png

In this case: QA DCS, org: translate_test, resource type: any, language: vi

Once the org is known, the valid languages can be determined. In the case above the API call is:
https://qa.door43.org/api/v1/users/translate_test

Which returns:

{
  "id": 24384,
  "login": "translate_test",
  "full_name": "",
  "email": "",
  "avatar_url": "https://qa.door43.org/user/avatar/translate_test/-1",
  "language": "",
  "is_admin": false,
  "last_login": "0001-01-01T00:00:00Z",
  "created": "2020-06-18T17:22:49Z",
  "repo_languages": [
    "en",
    "hi",
    "kn"
  ],
  "username": "translate_test"
}

Notice that only three languages are being used: "en", "hi", and "kn". So in this case I would not have been able to select "vi" in the first place and thus could have avoided the error (which doesn't come until you select a file to edit/translate).

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

2 participants