[Internalisation] Why internalisation of an object creates different IDs ? How to have the same ID?

System Information
  • Strapi Version: v4.1.1
  • Operating System: Ubuntu 20.04
  • Database: PostgreSQL
  • Node Version: v14.19.0
  • NPM Version: 6.14.16
  • Yarn Version: using npm

Hello,

I would like to use internalisation feature in Strapi, but I don’t understand why internalisation of a single object creates several id-different objects for each language.

Let’s take this example, I have two classes : event and invitation.

  • Event(id:1, name: “theater”, date:“02/01/2022”), name internalisation enabled with france (name: “théâtre”), id will be 2

What I have :

[
	{
		"id": 1,
		"name": "Theater",
		"locale": "en",
		"published_at": "2022-02-25T12:02:30.383Z",
		"created_at": "2022-02-25T12:02:29.923Z",
		"updated_at": "2022-02-25T12:02:30.393Z",
		"localizations": [
			{
				"id":2,
				"locale": "fr",
				"published_at": "2022-02-25T12:02:24.962Z"
			}
		]
	}
]

What I expect

[
	{
		"id": 1,
		"name": "Theater",
		"locale": "en",
		"published_at": "2022-02-25T12:02:30.383Z",
		"created_at": "2022-02-25T12:02:29.923Z",
		"updated_at": "2022-02-25T12:02:30.393Z",
		"localizations": [
			{
                               // id also 1
				"locale": "fr",
				"published_at": "2022-02-25T12:02:24.962Z"
			}
		]
	}
]

This ID problem become problematic if for example I want to link event to invitation :
Invitation(event: 1, user: 1) => An invitation has to be link with one event and one user

I don’t want to link my invitation to either EventId 1 or EventId 2, because If I want to get all invitation on an event, I don’t want to check both eventId 1 and eventId2. It should be the same

I seems easier just to create several attributes, like each object will have name_en and name_fr, instead of a single name with internalisation enabled

Thank you for your help

Gentle up :slight_smile: