* Default AI content language to Ukrainian * Keep English as the default content language * refactor: update content language handling in workspace creation - Changed the default content language in CreateWorkspace to inherit the app's locale instead of defaulting to English. - Updated related tests to reflect this change, ensuring that the content language aligns with the application's current locale settings. - Cleaned up unnecessary code in the BrandTab component for better readability. * Add Ukrainian as a full platform UI locale. Wire uk into languages config with complete lang/uk translations and restore ContentLanguage↔UI parity checks. Co-authored-by: Cursor <cursoragent@cursor.com> * Wire Ukrainian into dayjs and locale coverage tests. Import the uk dayjs locale with Monday week-start and cover uk/uk-UA in brand autofill and SetLocale assertions. Co-authored-by: Cursor <cursoragent@cursor.com> * Harden Ukrainian UI and AI content-language coverage. Cover generator/reviewer/humanizer/image prompts, workspace pickers, persona labels, UI locale switch, and README for uk as a first-class platform language. Co-authored-by: Cursor <cursoragent@cursor.com> * Add Ukrainian Pinterest form strings after main merge. Restore lang/uk posts.php key parity for the new pin title and destination link fields. Co-authored-by: Cursor <cursoragent@cursor.com> * List every supported UI language in the README. Replace the abbreviated multi-language blurb with the full locale set from config. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Paulo Castellano <paulo@castellanos.llc> Co-authored-by: Cursor <cursoragent@cursor.com>
45 lines
1.5 KiB
PHP
45 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Ai\Agents\PostContentHumanizer;
|
|
use App\Enums\PostPlatform\ContentType;
|
|
use App\Models\Workspace;
|
|
|
|
test('instructions inject the platform character cap so the rewrite cannot drift over it', function () {
|
|
$workspace = Workspace::factory()->make(['content_language' => 'en']);
|
|
|
|
$agent = new PostContentHumanizer(
|
|
workspace: $workspace,
|
|
platformContext: ContentType::XPost->value,
|
|
);
|
|
|
|
$instructions = $agent->instructions();
|
|
|
|
// X caps at 280 chars — the humanizer must be told, mirroring the generator.
|
|
expect($instructions)->toContain('280');
|
|
expect($instructions)->toContain('Hard cap');
|
|
});
|
|
|
|
test('instructions omit the length section when no platform context is given', function () {
|
|
$workspace = Workspace::factory()->make(['content_language' => 'en']);
|
|
|
|
$agent = new PostContentHumanizer(workspace: $workspace);
|
|
|
|
expect($agent->instructions())->not->toContain('Hard cap');
|
|
});
|
|
|
|
test('instructions still render the AI-tell removal rules', function () {
|
|
$workspace = Workspace::factory()->make(['content_language' => 'en']);
|
|
|
|
$agent = new PostContentHumanizer(workspace: $workspace);
|
|
|
|
expect($agent->instructions())->toContain('AI-tells');
|
|
});
|
|
|
|
test('instructions use Ukrainian when the workspace content language is uk', function () {
|
|
$workspace = Workspace::factory()->make(['content_language' => 'uk']);
|
|
|
|
expect((new PostContentHumanizer(workspace: $workspace))->instructions())
|
|
->toContain('Output language: uk.');
|
|
});
|