Open-source social media scheduler built for AI agents and the teams behind them. Create, schedule and publish posts to every network through MCP or the REST API, or write them yourself in a composer your team will love.
PHP ai-agentsblueskyfacebookinstagramlaravellinkedinmastodonmcpmcp-serveropen-sourcerest-apiself-hostedsocial-mediasocial-media-managementsocial-media-schedulerthreadstiktokvuejsxyoutube
refactor(tiktok): use i18n for content type description and validator error
Paulo Castellanoc5e667f92ad7
diff --git a/app/Enums/PostPlatform/ContentType.php b/app/Enums/PostPlatform/ContentType.phpindex 5f15b5ec9..6c7b075a5 100644--- a/app/Enums/PostPlatform/ContentType.php+++ b/app/Enums/PostPlatform/ContentType.php@@ -78,27 +78,7 @@ enum ContentType: stringpublic function description(): string{- return match ($this) {- self::InstagramFeed => 'Appears in your feed and profile',- self::InstagramCarousel => 'Multi-slide swipeable post (2-10 images)',- self::InstagramReel => 'Short video up to 90 seconds',- self::InstagramStory => 'Disappears after 24 hours',- self::LinkedInPost, self::LinkedInPagePost => 'Standard post with text and media',- self::LinkedInCarousel, self::LinkedInPageCarousel => 'Swipeable document or images',- self::FacebookPost => 'Standard post on your page',- self::FacebookReel => 'Short video up to 90 seconds',- self::FacebookStory => 'Disappears after 24 hours',- self::TikTokVideo => 'Short-form video content',- self::TikTokPhoto => 'Up to 35 photos as a swipeable carousel',- self::YouTubeShort => 'Vertical video up to 60 seconds',- self::XPost => 'Tweet with text and media',- self::ThreadsPost => 'Text post with optional media',- self::PinterestPin => 'Standard image pin',- self::PinterestVideoPin => 'Video pin (4s - 15min)',- self::PinterestCarousel => 'Multi-image carousel (2-5 images)',- self::BlueskyPost => 'Text post with optional images',- self::MastodonPost => 'Text post with optional media',- };+ return (string) trans("posts.content_types.{$this->value}.description");}public function platform(): SocialPlatformdiff --git a/app/Http/Requests/App/Post/UpdatePostRequest.php b/app/Http/Requests/App/Post/UpdatePostRequest.phpindex c37a54ad9..d5d981191 100644--- a/app/Http/Requests/App/Post/UpdatePostRequest.php+++ b/app/Http/Requests/App/Post/UpdatePostRequest.php@@ -92,9 +92,6 @@ class UpdatePostRequest extends FormRequest$platforms = $this->input('platforms', []);$ids = collect($platforms)->pluck('id')->filter()->all();- // Scope to the current post via the route-bound relation — defensive- // (cross-post leakage is prevented and we use the existing relation- // rather than a separate global query).$platformsById = $this->route('post')->postPlatforms()->whereIn('id', $ids)@@ -106,7 +103,7 @@ class UpdatePostRequest extends FormRequest&& blank(data_get($platform, 'meta.privacy_level'))) {$validator->errors()->add("platforms.{$i}.meta.privacy_level",- 'TikTok privacy level is required when publishing.',+ trans('posts.form.tiktok.privacy_required'),);}}diff --git a/lang/en/posts.php b/lang/en/posts.phpindex a7a684aac..11968b4a5 100644--- a/lang/en/posts.php+++ b/lang/en/posts.php@@ -80,6 +80,7 @@ return ['promotional_paid_title' => 'Your photo/video will be labeled as "Paid partnership".','promotional_description' => 'This cannot be changed once your video is posted.','compliance_incomplete' => 'You need to indicate if your content promotes yourself, a third party, or both.',+ 'privacy_required' => 'TikTok privacy level is required when publishing.','branded_cleared_private' => 'Privacy was cleared because Branded Content cannot be private.','interaction_disabled_by_creator' => 'Disabled by your TikTok account settings.','max_duration_exceeded' => 'Video is :duration s long but this account can only post videos up to :max s.',@@ -404,6 +405,10 @@ return ['label' => 'Video','description' => 'Short-form video content',],+ 'tiktok_photo' => [+ 'label' => 'Photo carousel',+ 'description' => 'Up to 35 photos as a swipeable carousel',+ ],'youtube_short' => ['label' => 'Short','description' => 'Vertical video up to 60 seconds',@@ -418,15 +423,15 @@ return [],'pinterest_pin' => ['label' => 'Pin',- 'description' => 'Image pin with link',+ 'description' => 'Standard image pin',],'pinterest_video_pin' => ['label' => 'Video Pin',- 'description' => 'Video content',+ 'description' => 'Video pin (4s - 15min)',],'pinterest_carousel' => ['label' => 'Carousel',- 'description' => '2-5 images',+ 'description' => 'Multi-image carousel (2-5 images)',],'bluesky_post' => ['label' => 'Post',diff --git a/lang/es/posts.php b/lang/es/posts.phpindex 68777104a..4d7d60773 100644--- a/lang/es/posts.php+++ b/lang/es/posts.php@@ -80,6 +80,7 @@ return ['promotional_paid_title' => 'Tu foto/video será etiquetado como "Asociación pagada".','promotional_description' => 'Esto no se puede cambiar una vez publicado el video.','compliance_incomplete' => 'Debes indicar si tu contenido promociona a ti mismo, a un tercero o a ambos.',+ 'privacy_required' => 'La visibilidad de TikTok es obligatoria al publicar.','branded_cleared_private' => 'La visibilidad se borró porque el contenido de marca no puede ser privado.','interaction_disabled_by_creator' => 'Desactivado por la configuración de tu cuenta TikTok.','max_duration_exceeded' => 'El video dura :duration s pero esta cuenta solo permite videos de hasta :max s.',@@ -404,6 +405,10 @@ return ['label' => 'Video','description' => 'Contenido de video corto',],+ 'tiktok_photo' => [+ 'label' => 'Carrusel de fotos',+ 'description' => 'Hasta 35 fotos en un carrusel deslizable',+ ],'youtube_short' => ['label' => 'Short','description' => 'Video vertical de hasta 60 segundos',@@ -418,15 +423,15 @@ return [],'pinterest_pin' => ['label' => 'Pin',- 'description' => 'Pin de imagen con enlace',+ 'description' => 'Pin de imagen estándar',],'pinterest_video_pin' => ['label' => 'Pin de video',- 'description' => 'Contenido de video',+ 'description' => 'Pin de video (4s - 15min)',],'pinterest_carousel' => ['label' => 'Carrusel',- 'description' => '2-5 imágenes',+ 'description' => 'Carrusel multi-imagen (2-5 imágenes)',],'bluesky_post' => ['label' => 'Post',diff --git a/lang/pt-BR/posts.php b/lang/pt-BR/posts.phpindex d7a4da213..a369fa864 100644--- a/lang/pt-BR/posts.php+++ b/lang/pt-BR/posts.php@@ -80,6 +80,7 @@ return ['promotional_paid_title' => 'Sua foto/vídeo será rotulado como "Parceria paga".','promotional_description' => 'Isso não poderá ser alterado após a publicação.','compliance_incomplete' => 'Você precisa indicar se o conteúdo promove você mesmo, terceiros ou ambos.',+ 'privacy_required' => 'A visibilidade do TikTok é obrigatória ao publicar.','branded_cleared_private' => 'A visibilidade foi limpa porque conteúdo de marca não pode ser privado.','interaction_disabled_by_creator' => 'Desativado pelas configurações da sua conta TikTok.','max_duration_exceeded' => 'Vídeo tem :duration s mas esta conta só permite vídeos de até :max s.',@@ -404,6 +405,10 @@ return ['label' => 'Vídeo','description' => 'Conteúdo de vídeo curto',],+ 'tiktok_photo' => [+ 'label' => 'Carrossel de fotos',+ 'description' => 'Até 35 fotos em um carrossel deslizável',+ ],'youtube_short' => ['label' => 'Short','description' => 'Vídeo vertical de até 60 segundos',@@ -418,15 +423,15 @@ return [],'pinterest_pin' => ['label' => 'Pin',- 'description' => 'Pin de imagem com link',+ 'description' => 'Pin de imagem padrão',],'pinterest_video_pin' => ['label' => 'Pin de Vídeo',- 'description' => 'Conteúdo em vídeo',+ 'description' => 'Pin de vídeo (4s - 15min)',],'pinterest_carousel' => ['label' => 'Carrossel',- 'description' => '2-5 imagens',+ 'description' => 'Carrossel multi-imagem (2-5 imagens)',],'bluesky_post' => ['label' => 'Post',