From 1eea7fe7caa3a41d5651ead3c4604a0fc99f0aba Mon Sep 17 00:00:00 2001 From: DivisionByZero Date: Sun, 5 May 2024 11:05:35 +0200 Subject: [PATCH] refactor(locale): normalize database data (#2873) --- scripts/generate-locales.ts | 1 - src/locales/base/database/collation.ts | 6 ++-- src/locales/base/database/engine.ts | 2 +- src/locales/base/database/type.ts | 34 +++++++++---------- src/locales/de/database/column.ts | 26 +++++++------- src/locales/en/database/column.ts | 18 +++++----- src/locales/eo/database/column.ts | 10 +++--- src/locales/zh_CN/database/column.ts | 20 +++++------ .../__snapshots__/database.spec.ts.snap | 24 ++++++------- 9 files changed, 70 insertions(+), 71 deletions(-) diff --git a/scripts/generate-locales.ts b/scripts/generate-locales.ts index c6760ec4fa4..89321ae2a2d 100644 --- a/scripts/generate-locales.ts +++ b/scripts/generate-locales.ts @@ -313,7 +313,6 @@ async function normalizeLocaleFile(filePath: string, definitionKey: string) { const legacyDefinitions = ['app', 'cell_phone', 'team']; const definitionsToSkip = [ 'company', - 'database', 'date', 'finance', 'internet', diff --git a/src/locales/base/database/collation.ts b/src/locales/base/database/collation.ts index 6ace181b110..b1e0254fe15 100644 --- a/src/locales/base/database/collation.ts +++ b/src/locales/base/database/collation.ts @@ -1,9 +1,9 @@ export default [ - 'utf8_unicode_ci', - 'utf8_general_ci', - 'utf8_bin', 'ascii_bin', 'ascii_general_ci', 'cp1250_bin', 'cp1250_general_ci', + 'utf8_bin', + 'utf8_general_ci', + 'utf8_unicode_ci', ]; diff --git a/src/locales/base/database/engine.ts b/src/locales/base/database/engine.ts index 58048e94484..3b4d880cf75 100644 --- a/src/locales/base/database/engine.ts +++ b/src/locales/base/database/engine.ts @@ -1 +1 @@ -export default ['InnoDB', 'MyISAM', 'MEMORY', 'CSV', 'BLACKHOLE', 'ARCHIVE']; +export default ['ARCHIVE', 'BLACKHOLE', 'CSV', 'InnoDB', 'MEMORY', 'MyISAM']; diff --git a/src/locales/base/database/type.ts b/src/locales/base/database/type.ts index d2c75697ba6..1abfa0beee7 100644 --- a/src/locales/base/database/type.ts +++ b/src/locales/base/database/type.ts @@ -1,26 +1,26 @@ export default [ - 'int', - 'varchar', - 'text', + 'bigint', + 'binary', + 'bit', + 'blob', + 'boolean', 'date', 'datetime', - 'tinyint', - 'time', - 'timestamp', - 'smallint', - 'mediumint', - 'bigint', 'decimal', - 'float', 'double', - 'real', - 'bit', - 'boolean', - 'serial', - 'blob', - 'binary', 'enum', - 'set', + 'float', 'geometry', + 'int', + 'mediumint', 'point', + 'real', + 'serial', + 'set', + 'smallint', + 'text', + 'time', + 'timestamp', + 'tinyint', + 'varchar', ]; diff --git a/src/locales/de/database/column.ts b/src/locales/de/database/column.ts index 5f8020f2c54..8d7aaa8e5e1 100644 --- a/src/locales/de/database/column.ts +++ b/src/locales/de/database/column.ts @@ -1,21 +1,21 @@ export default [ - 'id', - 'titel', - 'name', + 'aktualisiertAm', + 'artikelnummer', + 'avatar', + 'bearbeitetAm', 'email', - 'telefonnummer', - 'token', + 'erstelltAm', + 'geburtsdatum', 'gruppe', + 'id', 'kategorie', - 'passwort', 'kommentar', - 'avatar', + 'nachname', + 'name', + 'passwort', 'status', - 'erstelltAm', - 'aktualisiertAm', - 'bearbeitetAm', + 'telefonnummer', + 'titel', + 'token', 'vorname', - 'nachname', - 'geburtsdatum', - 'artikelnummer', ]; diff --git a/src/locales/en/database/column.ts b/src/locales/en/database/column.ts index f69f530cad6..2b6c541dcd0 100644 --- a/src/locales/en/database/column.ts +++ b/src/locales/en/database/column.ts @@ -1,16 +1,16 @@ export default [ - 'id', - 'title', - 'name', + 'avatar', + 'category', + 'comment', + 'createdAt', 'email', - 'phone', - 'token', 'group', - 'category', + 'id', + 'name', 'password', - 'comment', - 'avatar', + 'phone', 'status', - 'createdAt', + 'title', + 'token', 'updatedAt', ]; diff --git a/src/locales/eo/database/column.ts b/src/locales/eo/database/column.ts index 084ff296d07..35a655af80a 100644 --- a/src/locales/eo/database/column.ts +++ b/src/locales/eo/database/column.ts @@ -1,12 +1,12 @@ export default [ - 'identigilo', - 'titolo', - 'nomo', - 'telefonnumero', 'grupo', + 'identigilo', 'kategorio', - 'pasvorto', 'komento', + 'nomo', + 'pasvorto', 'profilbildo', 'stato', + 'telefonnumero', + 'titolo', ]; diff --git a/src/locales/zh_CN/database/column.ts b/src/locales/zh_CN/database/column.ts index c7b22df9951..08e58f304f4 100644 --- a/src/locales/zh_CN/database/column.ts +++ b/src/locales/zh_CN/database/column.ts @@ -1,16 +1,16 @@ export default [ - '标识', - '标题', - '名称', - '邮箱', - '手机', '令牌', - '组别', - '类别', + '创建于', + '名称', + '头像', '密码', + '手机', + '更新于', + '标识', + '标题', '注释', - '头像', '状态', - '创建于', - '更新于', + '类别', + '组别', + '邮箱', ]; diff --git a/test/modules/__snapshots__/database.spec.ts.snap b/test/modules/__snapshots__/database.spec.ts.snap index 8b3d9490938..74b92566713 100644 --- a/test/modules/__snapshots__/database.spec.ts.snap +++ b/test/modules/__snapshots__/database.spec.ts.snap @@ -1,31 +1,31 @@ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html -exports[`database > 42 > collation 1`] = `"utf8_bin"`; +exports[`database > 42 > collation 1`] = `"cp1250_bin"`; -exports[`database > 42 > column 1`] = `"token"`; +exports[`database > 42 > column 1`] = `"group"`; -exports[`database > 42 > engine 1`] = `"MEMORY"`; +exports[`database > 42 > engine 1`] = `"CSV"`; exports[`database > 42 > mongodbObjectId 1`] = `"8ead331ddf0fc4446b96d368"`; -exports[`database > 42 > type 1`] = `"smallint"`; +exports[`database > 42 > type 1`] = `"double"`; -exports[`database > 1211 > collation 1`] = `"cp1250_general_ci"`; +exports[`database > 1211 > collation 1`] = `"utf8_unicode_ci"`; -exports[`database > 1211 > column 1`] = `"createdAt"`; +exports[`database > 1211 > column 1`] = `"token"`; -exports[`database > 1211 > engine 1`] = `"ARCHIVE"`; +exports[`database > 1211 > engine 1`] = `"MyISAM"`; exports[`database > 1211 > mongodbObjectId 1`] = `"ed4fefa7fbaec9dc4c48fa8e"`; -exports[`database > 1211 > type 1`] = `"geometry"`; +exports[`database > 1211 > type 1`] = `"tinyint"`; -exports[`database > 1337 > collation 1`] = `"utf8_general_ci"`; +exports[`database > 1337 > collation 1`] = `"ascii_general_ci"`; -exports[`database > 1337 > column 1`] = `"email"`; +exports[`database > 1337 > column 1`] = `"createdAt"`; -exports[`database > 1337 > engine 1`] = `"MyISAM"`; +exports[`database > 1337 > engine 1`] = `"BLACKHOLE"`; exports[`database > 1337 > mongodbObjectId 1`] = `"536a7b5fa28d2f9bb79ca46e"`; -exports[`database > 1337 > type 1`] = `"time"`; +exports[`database > 1337 > type 1`] = `"datetime"`;