.skills/discourse-content-localization/SKILL.md
Use this before localizing dynamic Discourse content such as Sidebar sections, Groups, Docs, Events, or other models listed in content-localization status trackers.
plugins/discourse-ai.get_localization must receive records with :localizations preloaded.include Localizable to the source model and a nullable locale column with limit 20.<Model>Localization with include LocaleMatchable, belongs_to :model, a locale string limit 20, translated fields with source-model length limits, and a unique (model_id, locale) index.get_localization for exact, normalized, and optional default-locale fallback behavior. Do not reimplement locale fallback in serializers.ContentLocalization.show_translated_<model>? using SiteSetting.content_localization_enabled, source locale.present?, and !model.in_user_locale?. Match Post/Topic only when show-original behavior is relevant.includes(:localizations) or includes(:localizations, children: :localizations) as needed.localization.field.presence || original_field and expose localization rows only to users who can edit them.localizations arrays only for authorized editors.Candidate, Localizer, regular localize job, and scheduled backfill jobs in discourse-ai only.locale present. Delete localizations whose locale matches the source locale. Skip target locales that normalize to the source locale.
DiscourseAi::Translation.enabled?, backfill_enabled?, configured agents, hourly rate, credits, and error logging patterns used by existing tag/category jobs.get_localization.localizations, and no N+1 on hot routes.include LocaleMatchable, field length limits matching the source, and a unique (model_id, locale) index.plugins/discourse-ai for core models and skips source-locale/self translations.SiteSetting.content_localization_enabled disables all localization behavior, including backfill and detection