Multi-language Responses & Localized Food Names
More info on personalization options in the APIUsers Profile Management section.
Plan & Token Requirements
Feature available in the following LogMeal Plans:
Accessible by the following User Types:
Who does what?
- š“ APIUser: has a language attached to their user profile; most endpoints use this language by default when providing user-facing information.
- ā« APICompany and šµ APIUserManager: can set or override language on behalf of their assigned users.
What It Does
LogMeal's multi-language support lets you return localized names for:
- Detected dishes and food items
- Ingredients (including reference ingredients such as salt, sugar, oil)
- Food groups and food types
- Occasions (breakfast, lunch, etc.)
- Nutritional indicators and custom nutritional indicators
- Measurement units both at dish and ingredient level.
- Custom entities such as custom occasions and custom recipes (via their translation endpoints)
Instead of building your own translation layer, you simply choose a language once (per user or per request) and all supported endpoints will respond in that language.
Currently supported languages (via ISO 639-2/T codes) are:
spaā Spanishengā Englishfreā Frenchitaā Italiannldā Dutchgerā Germangreā Greekturā Turkishhebā Hebrewcatā Catalan
You can always retrieve the up-to-date list programmatically using
GET /info/languages.
When to Use It / Outcomes
Use multi-language responses when:
- Your app UI is not in English (e.g. Spanish, French, Germanā¦) and you need dish names such as
piƱainstead ofpineapple,polloinstead ofchicken, etc. - You operate in multiple countries and want one backend that returns localized labels based on each userās profile.
- You want to avoid maintaining your own translation table for thousands of dishes, ingredients and nutrients.
Expected outcomes:
-
JSON responses where:
food_name,dish_name, ingredient names, food group names, occasions names, nutritional indicator names, etc. are returned in the requested language.- Internal IDs (dish IDs, ingredient IDs, indicator codesā¦) remain stable and language-independent, so you can safely store and query them in your own database.
-
No additional
Ā©
monthly credits,
(D) daily request limits or
(S) per-second request limits are consumed beyond the underlying endpoint calls.
Feature-Specific Details
Supported Languages & Codes
The canonical list of languages and their codes is returned by
GET /info/languages.
Each key in the JSON corresponds to a three-letter ISO 639-2/T code used across the API, for example:
{
"spa": "spanish",
"eng": "english",
"fre": "french",
"ita": "italian",
"nld": "dutch",
"ger": "german",
"gre": "greek",
"tur": "turkish",
"heb": "hebrew",
"cat": "catalan"
}Two Integration Modes
You can integrate multi-language support in two complementary ways:
1. User-Level Default Language (Recommended)
Store a default language (and country) in each š“ APIUser user profile.
- Set or update the userās language via
POST /profile/modifyUserProfileInfo. - Use the
languagefield (e.g."spa") and optionallycountry(e.g."ES") in the profile payload. - Once set, this language will be used as the default for most endpoints, so you donāt need to pass
?language=on every call.
This is the best option when your own users can choose their preferred language in your app settings.
2. Per-Request Language Override
On endpoints that support it, you can dynamically override the language for a single request with the language query parameter:
POST /image/segmentation/complete?language=spalanguagemust be one of the three-letter ISO 639-2/T codes returned by
GET /info/languages.- If omitted, the endpoint falls back to the APIUserās user profile language or English.
Use this option when language depends on runtime context, such as:
- A shared device where end-users change language frequently.
- A multi-tenant backend that needs to forward the language of another system.
Behavior on Invalid or Unsupported Languages
-
Passing an unsupported language code (e.g.
xxx) may result in a 400 Bad Request with a validation error message. -
To avoid this:
- Always use the values returned by
GET /info/languages. - Validate user input on your side before calling the API.
- Always use the values returned by
Related Endpoints
Core language information
- GET /info/languages ā ā« š“ šµ Returns the list of available languages and their ISO 639-2/T codes.
Set the userās default language & country
- POST /profile/modifyUserProfileInfo ā š“ Modify an APIUser user profile, including
language(default response language) andcountry(used for country-aware recognition and nutrition).
Recognition & nutrition endpoints with language support
- POST /image/segmentation/complete ā š“ Multiple dishes segmentation & recognition. Accepts
languageto localize dish and ingredient names in the response. - POST /nutrition/recipe/ingredients ā š“ Returns localized ingredients for detected dishes.
- POST /nutrition/recipe/nutritionalInfo ā š“ Returns localized nutritional indicators and values for detected dishes.
Dataset endpoints with language support
- GET /dataset/dishes ā ā« š“ šµ Returns the dish catalog; names are localized using
language(query) or the APIUserās default user profile language. - GET /dataset/ingredients ā ā« š“ šµ Returns the ingredient catalog; names are localized using
language(query) or the APIUserās default user profile language. - GET /dataset/referenceIngredients ā ā« š“ šµ Returns modulator ingredients (salt, sugar, oilā¦) with localized names.
- GET /dataset/foodGroups ā ā« š“ šµ Returns the food groups catalog; names are localized by the APIUserās default user profile language.
- GET /info/nutrients ā ā« š“ šµ Returns the nutrients catalog; names are localized by the APIUserās default user profile language.
- GET /dataset/weightMeasures/dishes ā ā« š“ šµ Returns dish weight measures and conversion rates; names are localized using
language(query) or the APIUserās default user profile language. - GET /dataset/weightMeasures/ingredients ā ā« š“ šµ Returns ingredient weight measures and conversion rates; names are localized using
language(query) or the APIUserās default user profile language.
Custom translations (advanced)
Use these endpoints if you need to localize your own company-specific labels:
- POST /custom_nutritional_indicator_translation ā ā« šµ Create a custom nutritional indicator translation (e.g. for a proprietary score) in a specific language.
- PATCH /custom_nutritional_indicator_translation ā ā« šµ Edit an existing custom nutritional indicator translation.
- DELETE /custom_nutritional_indicator_translation ā ā« šµ Delete a custom nutritional indicator translation.
- POST /intake/createOccasionTranslation ā ā« šµ Create or update translations for Custom Occasions (e.g.
Desayuno,Comida,Cena).
Typical Workflow
A common integration flow for multi-language food recognition looks like this:
-
Create an APIUser (see User Management docs) and obtain a š“ APIUser token.
-
Let the end-user choose their language and country in your app settings.
-
Update the APIUser user profile with language and country:
- Call POST /profile/modifyUserProfileInfo with
language: "spa"andcountry: "ES".
- Call POST /profile/modifyUserProfileInfo with
-
During day-to-day usage, call your usual recognition endpoints (e.g.
POST /image/segmentation/complete)
without specifyinglanguage:- Responses will automatically come back in Spanish for that APIUser.
-
(Optional) For special cases, override the language per request:
- Append
?language=engor another valid code to temporarily change the response language.
- Append
-
Store IDs (dish IDs, ingredient IDs, indicator codes) in your own database, and only display localized names in your UI.
Related Use Cases
- Personalized food diaries where each user sees their intakes in their own language.
- Multi-country apps that share a backend but offer localized dish and ingredient names.
- Clinical platforms where šµ APIUserManagers review intakes from users in different countries and languages.
- White-labeled apps where you want to change branding and language without re-training models.
Implementation Examples (Recipes)
Follow these recipes to implement the previously mentioned flow:
Set user profile data once to improve label language and regional dishes:
Downloadable Code Examples
These recipes show the core steps in a few languages. For more language options (and complete runnable projects), see Ready-to-Use Code.
Updated 5 months ago
