-
Notifications
You must be signed in to change notification settings - Fork 639
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.x]: Alternative text doesn't translate across sites #11576
Comments
The native Alternative Text inputs aren’t actually translatable yet, so the bug here was that they got the translatable indicator. I’m going to look into making them translatable for Craft 5. |
With all due respect, this sounds like a bug or at the very least, a critical limitation. I can absolutely see people adding a new language to a website and expecting to be able to translate the alt text, only to find that they need to write a migration to move their alt text back to a custom field in order to translate it. |
I guess the path forward is eschewing the baked-in Alt Text field, and rolling your own custom field for it like we used to. That way it will indeed be localizable per-site. |
Agree it’s not ideal. We need to reevaluate how it’s stored for Craft 5. Right now it’s in the |
Thanks for the update. I'll avoid using it and maybe migrate to Alternative Text in Craft 5. |
Craft 4.1.4 is out with the fix to the translation indicator. |
Quick and dirty migration from native <?php
namespace craft\contentmigrations;
use Craft;
use craft\db\Migration;
use craft\elements\Asset;
/**
* m230802_162747_move_assets_alt_text migration.
*/
class m230802_162747_move_assets_alt_text extends Migration
{
/**
* @inheritdoc
*/
public function safeUp(): bool
{
$NEW_FIELD_HANDLE = "altText";
/** @var Asset $asset */
foreach (
Asset::find()
->hasAlt()
->all()
as $asset
) {
$asset->setFieldValue($NEW_FIELD_HANDLE, $asset->alt);
Craft::$app->elements->saveElement($asset);
}
return true;
}
/**
* @inheritdoc
*/
public function safeDown(): bool
{
echo "m230802_162747_move_assets_alt_text cannot be reverted.\n";
return false;
}
} |
Craft 5 is out now with translatable alt text 🚀 |
What happened?
Description
On Craft CMS 4.1.3 changing the alternative text on a Spanish site changes the English version too. The translation icon appears on the field as expected.
Steps to reproduce
Expected behavior
The alternative text should be able to be different per-site
Actual behavior
See steps to reproduce
Craft CMS version
4.1.3
PHP version
8.1.7
Operating system and version
Darwin 21.5.0
Database type and version
MySQL 5.7.38
Image driver and version
Imagick 3.7.0 (ImageMagick 7.1.0-39)
Installed plugins and versions
Dashboard Begone - 2.0.0
DigitalOcean Spaces Filesystem - 2.0.0
Expanded Singles - 2.0.0-beta.1
Neo - 3.1.7
Redactor - 3.0.2
Retour - 4.0.2
SEOmatic - 4.0.6
Table Maker - 4.0.2
The text was updated successfully, but these errors were encountered: