Support localized fields in API responses
See original GitHub issueIn order to fully switch to API v5, we need to support the new localized fields. Instead of directly getting a value for any localized field, we will always receive an object with at least one key/value (the key is the locale, the value is the localized content).
The API v5
should be used to see those localized fields.
See also: https://github.com/mozilla/addons-server/issues/8794
For QA:
This touches pretty much every part of the site. There should be no observable changes, but we should do a fairly comprehensive regression check.
Issue Analytics
- State:
- Created 5 years ago
- Comments:27 (24 by maintainers)
Top Results From Across the Web
REST API localization best practice - Google Groups
I am trying to understand best practices for API localization (support multiple ... Our response contains uniqueId for a field and its value...
Read more >Localization for REST APIs - Stack Overflow
The basic problem is that APIs may need to provide content that is dependent on the user culture, country, language and timezone. For...
Read more >How to localize your API - API UX
Localization (L10n) means making an application work for a particular market, such as French-speaking Canadians. Native Language Support (NLS) ...
Read more >Are API responses localized? - Okta Support
I am wondering if the ErrorSummary and ErrorCauses fields in the OktaException class are localized, or if they are only ever returned in...
Read more >Modifying REST API responses | Contentful
Modifying REST API responses · Choosing fields · Including and excluding objects · Assets · All REST APIs supported · Client library implementation...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@willdurand I’m going to work on this as a code quality issue. Do you think we should assume that we’re only getting one locale back from an API request (as we always pass a
lang
as a query parameter), or is the idea here that we should assume we could be getting multiple locales returned, and we should use the currentlang
to look up the value in the returned object? If the latter, what would we do if we don’t find a match for the current lang? I know that should never happen, but if we’re coding to deal with multiple returned langs, we should also code to deal with that scenario.After testing the frontend functionality as a whole, with more focus on localizations, there were no regressions found.
I’m marking this issue as verified fixed on stage.