DEV: Add locale column to categories (#32962)

Previously we had omitted determining the locale of categories, as
unlike posts, categories are usually single words and are usually only
translated once.

Since there is no locale, a category called "Staff" would also have an
English translation. With LLMs that perform poorly, we see that
translating "Staff" to English may result in something entirely
different (like "Personnelle" or "Personal").

Thus adding locale support to categories can mitigate this issue due to
the uncertainty.
This commit is contained in:
Natalie Tay
2025-05-28 13:49:26 +08:00
committed by GitHub
parent f99c17d52b
commit 435088f62c
2 changed files with 8 additions and 0 deletions
+1
View File
@@ -1388,6 +1388,7 @@ end
# style_type :integer default("square"), not null
# emoji :string
# icon :string
# locale :string(20)
#
# Indexes
#
@@ -0,0 +1,7 @@
# frozen_string_literal: true
class AddLocaleToCategories < ActiveRecord::Migration[7.2]
def change
add_column :categories, :locale, :string, limit: 20
end
end