Skip to content

API: locales service returns different structure per repo #472

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

Closed
pascalchevrel opened this issue Jun 10, 2015 · 0 comments
Closed

API: locales service returns different structure per repo #472

pascalchevrel opened this issue Jun 10, 2015 · 0 comments
Assignees
Labels

Comments

@pascalchevrel
Copy link
Member

https://transvision-beta.mozfr.org/api/v1/locales/central/
returns a list with indexed values such as:

{
    "0": "ar",
    "1": "ast",
    "2": "cs"
}

While gaia returns a list without indices:
https://transvision-beta.mozfr.org/api/v1/locales/gaia/

[
    "af",
    "ar",
    "as",
    "ast"
]

This is a bug, we should return the same data structure, the simple one without indices seems more logical to me.

@pascalchevrel pascalchevrel self-assigned this Jun 10, 2015
pascalchevrel added a commit to pascalchevrel/transvision that referenced this issue Jun 10, 2015
… repo

The reason is that we sure asort() which sorts arrays taking keys into account, if the source file is already sorted correctly, asort has no effect and the data returned is a simple array. If asort() changed the order of the locales, the returned array now has numeric keys. We need to use sort().
pascalchevrel added a commit to pascalchevrel/transvision that referenced this issue Jun 10, 2015
… repo

The reason is that we sure asort() which sorts arrays taking keys into account, if the source file is already sorted correctly, asort has no effect and the data returned is a simple array. If asort() changed the order of the locales, the returned array now has numeric keys. We need to use sort().
pascalchevrel added a commit that referenced this issue Jun 10, 2015
Issue #472: API: locales service returns different structure per repo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant