🛠️ User locale for migration (#895)

This commit is contained in:
Montassar Ghanmy
2025-05-19 11:14:18 +01:00
committed by GitHub
parent d831ffc5fe
commit 87417b5ada
2 changed files with 3 additions and 1 deletions
@@ -64,6 +64,7 @@ const migrateUsersCommand: yargs.CommandModule<unknown, unknown> = {
id: userId, id: userId,
email: user.email_canonical, email: user.email_canonical,
name: `${user.first_name} ${user.last_name}`, name: `${user.first_name} ${user.last_name}`,
locale: user.preferences?.locale || "fr",
}; };
if (!dryRun) { if (!dryRun) {
@@ -38,6 +38,7 @@ export async function createCozyInstance(user: {
email: string; email: string;
name: string; name: string;
_id: string; _id: string;
locale: string;
}) { }) {
console.log(`🚀 Creating Cozy instance for ${user.email}...`); console.log(`🚀 Creating Cozy instance for ${user.email}...`);
@@ -51,7 +52,7 @@ export async function createCozyInstance(user: {
domain: COZY_DOMAIN, domain: COZY_DOMAIN,
email: user.email, email: user.email,
public_name: user.name, public_name: user.name,
locale: "fr", locale: user.locale,
oidc: user.id, oidc: user.id,
}, },
{ {