Skip to content

Commit e001801

Browse files
committed
Language: Add support for Lao (install fixtures and migration)
1 parent a8bf39d commit e001801

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

src/CoreBundle/DataFixtures/LanguageFixtures.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,14 @@ public static function getLanguages(): array
552552
'format' => 'title first_name last_name',
553553
'sort_by' => 'first_name',
554554
],
555+
[
556+
'original_name' => 'ພາສາລາວ',
557+
'english_name' => 'lao',
558+
'isocode' => 'lo',
559+
'available' => 0,
560+
'format' => 'title first_name last_name',
561+
'sort_by' => 'first_name',
562+
],
555563
];
556564
}
557565
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/* For licensing terms, see /license.txt */
6+
7+
namespace Chamilo\CoreBundle\Migrations\Schema\V200;
8+
9+
use Chamilo\CoreBundle\Migrations\AbstractMigrationChamilo;
10+
use Doctrine\DBAL\Schema\Schema;
11+
12+
final class Version20251204120000 extends AbstractMigrationChamilo
13+
{
14+
public function getDescription(): string
15+
{
16+
return 'Languages: insert Lao (lo) if missing.';
17+
}
18+
19+
public function up(Schema $schema): void
20+
{
21+
$this->addSql("
22+
INSERT INTO language (original_name, english_name, isocode, available)
23+
SELECT 'ພາສາລາວ', 'lao', 'lo', 0
24+
WHERE NOT EXISTS (SELECT 1 FROM language WHERE isocode = 'lo')
25+
");
26+
}
27+
28+
public function down(Schema $schema): void
29+
{
30+
$this->addSql("DELETE FROM language WHERE isocode = 'lo'");
31+
}
32+
}

0 commit comments

Comments
 (0)