forked from EasyCorp/EasyAdminBundle
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature EasyCorp#1464 Translated interface to Arabic and allowed RTL …
…languages (badr el ghailani, javiereguiluz) This PR was merged into the master branch. Discussion ---------- Translated interface to Arabic and allowed RTL languages Commits ------- 6187a6f Fixed the Markdown syntax 12a19be Tweaked the documentation 684b96c Added tests 7117a01 Tweaks a9a935d Added Arabic translation for interface (RTL) Right-to-Left Language Support
- Loading branch information
Showing
12 changed files
with
340 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||
<file source-language="en" target-language="ar" datatype="plaintext" original="file.ext"> | ||
<body> | ||
<!-- page titles --> | ||
<trans-unit id="new.page_title"> | ||
<source>new.page_title</source> | ||
<target>"%entity_name%" جديد</target> | ||
</trans-unit> | ||
<trans-unit id="show.page_title"> | ||
<source>show.page_title</source> | ||
<target>(#%entity_id%) %entity_name%</target> | ||
</trans-unit> | ||
<trans-unit id="edit.page_title"> | ||
<source>edit.page_title</source> | ||
<target>(#%entity_id%) %entity_name% تعديل</target> | ||
</trans-unit> | ||
<trans-unit id="list.page_title"> | ||
<source>list.page_title</source> | ||
<target>%entity_name%</target> | ||
</trans-unit> | ||
<trans-unit id="search.page_title"> | ||
<source>search.page_title</source> | ||
<target><![CDATA[{0} لا توجد اي نتائج |{1} العثور على نتيجة وحيدة|]1,Inf] العثور على <strong>%count%</strong> نتيجة ]]></target> | ||
</trans-unit> | ||
|
||
<!-- 'search' view --> | ||
<trans-unit id="search.no_results"> | ||
<source>search.no_results</source> | ||
<target>لا توجد اي نتائج</target> | ||
</trans-unit> | ||
|
||
<!-- 'list' view --> | ||
<trans-unit id="list.row_actions"> | ||
<source>list.row_actions</source> | ||
<target>إجراءات</target> | ||
</trans-unit> | ||
|
||
<!-- paginator --> | ||
<trans-unit id="paginator.first"> | ||
<source>paginator.first</source> | ||
<target>الأول</target> | ||
</trans-unit> | ||
<trans-unit id="paginator.previous"> | ||
<source>paginator.previous</source> | ||
<target>السابق</target> | ||
</trans-unit> | ||
<trans-unit id="paginator.next"> | ||
<source>paginator.next</source> | ||
<target>التالي</target> | ||
</trans-unit> | ||
<trans-unit id="paginator.last"> | ||
<source>paginator.last</source> | ||
<target>الأخير</target> | ||
</trans-unit> | ||
<trans-unit id="paginator.counter"> | ||
<source>paginator.counter</source> | ||
<target><![CDATA[<strong>%results%</strong> / <strong>%end%</strong> - <strong>%start%</strong>]]></target> | ||
</trans-unit> | ||
|
||
<!-- labels --> | ||
<trans-unit id="label.true"> | ||
<source>label.true</source> | ||
<target>نعم</target> | ||
</trans-unit> | ||
<trans-unit id="label.false"> | ||
<source>label.false</source> | ||
<target>لا</target> | ||
</trans-unit> | ||
<trans-unit id="label.empty"> | ||
<source>label.empty</source> | ||
<target>فارغ</target> | ||
</trans-unit> | ||
<trans-unit id="label.null"> | ||
<source>label.null</source> | ||
<target>لا شيء</target> | ||
</trans-unit> | ||
<trans-unit id="label.nullable_field"> | ||
<source>label.nullable_field</source> | ||
<target>اتركه فارغ</target> | ||
</trans-unit> | ||
<trans-unit id="label.object"> | ||
<source>label.object</source> | ||
<target>Objet PHP</target> | ||
</trans-unit> | ||
<trans-unit id="label.inaccessible"> | ||
<source>label.inaccessible</source> | ||
<target>لا يمكن الوصول إليها</target> | ||
</trans-unit> | ||
<trans-unit id="label.inaccessible.explanation"> | ||
<source>label.inaccessible.explanation</source> | ||
<target>لا يوجد وصف الوصول لهذه الخاصية أو أنها ليست عامة.</target> | ||
</trans-unit> | ||
|
||
<!-- user --> | ||
<trans-unit id="user.logged_in_as"> | ||
<source>user.logged_in_as</source> | ||
<target>تسجيل الدخول باسم</target> | ||
</trans-unit> | ||
<trans-unit id="user.unnamed"> | ||
<source>user.unnamed</source> | ||
<target>مستخدم بدون اسم</target> | ||
</trans-unit> | ||
<trans-unit id="user.anonymous"> | ||
<source>user.anonymous</source> | ||
<target>مستخدم مجهول</target> | ||
</trans-unit> | ||
|
||
<!-- misc. elements --> | ||
<trans-unit id="toggle_navigation"> | ||
<source>toggle_navigation</source> | ||
<target>اتاحة أو تعطيل التصفح</target> | ||
</trans-unit> | ||
<trans-unit id="delete_modal.title"> | ||
<source>delete_modal.title</source> | ||
<target>هل تريد حذف هذا العنصر؟</target> | ||
</trans-unit> | ||
<trans-unit id="delete_modal.content"> | ||
<source>delete_modal.content</source> | ||
<target>هذا الإجراء غير قابل للالغاء.</target> | ||
</trans-unit> | ||
<trans-unit id="delete_modal.action"> | ||
<source>delete_modal.action</source> | ||
<target>حذف</target> | ||
</trans-unit> | ||
<trans-unit id="action.add_new_item"> | ||
<source>action.add_new_item</source> | ||
<target>إضافة عنصر جديد</target> | ||
</trans-unit> | ||
<trans-unit id="action.add_another_item"> | ||
<source>action.add_another_item</source> | ||
<target>إضافة عنصر آخر</target> | ||
</trans-unit> | ||
<trans-unit id="action.remove_item"> | ||
<source>action.remove_item</source> | ||
<target>حذف العنصر</target> | ||
</trans-unit> | ||
<trans-unit id="errors"> | ||
<source>errors</source> | ||
<target>خطأ | أخطاء</target> | ||
</trans-unit> | ||
<trans-unit id="form.are_you_sure"> | ||
<source>form.are_you_sure</source> | ||
<target>لم يتم حفظه التغييرات.</target> | ||
</trans-unit> | ||
<trans-unit id="show.remaining_items"> | ||
<source>show.remaining_items</source> | ||
<target><![CDATA[{1} هناك عنصر آخر لم يتم عرضه في هذه القائمة|]1,Inf] عنصر آخر لم يتم عرضه في هذه القائمة %count% ]]></target> | ||
</trans-unit> | ||
</body> | ||
</file> | ||
</xliff> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||
<file source-language="en" target-language="ar" datatype="plaintext" original="file.ext"> | ||
<body> | ||
<!-- generic actions displayed on buttons and links --> | ||
<trans-unit id="action.new"> | ||
<source>action.new</source> | ||
<target>%entity_name% جديد</target> | ||
</trans-unit> | ||
<trans-unit id="action.show"> | ||
<source>action.show</source> | ||
<target>إطلاع</target> | ||
</trans-unit> | ||
<trans-unit id="action.edit"> | ||
<source>action.edit</source> | ||
<target>تعديل</target> | ||
</trans-unit> | ||
<trans-unit id="action.search"> | ||
<source>action.search</source> | ||
<target>بحث</target> | ||
</trans-unit> | ||
<trans-unit id="action.delete"> | ||
<source>action.delete</source> | ||
<target>حذف</target> | ||
</trans-unit> | ||
<trans-unit id="action.save"> | ||
<source>action.save</source> | ||
<target>حفظ</target> | ||
</trans-unit> | ||
<trans-unit id="action.cancel"> | ||
<source>action.cancel</source> | ||
<target>الغاء</target> | ||
</trans-unit> | ||
<trans-unit id="action.list"> | ||
<source>action.list</source> | ||
<target>رجوع إلى القائمة</target> | ||
</trans-unit> | ||
<trans-unit id="label.form.empty_value"> | ||
<source>label.form.empty_value</source> | ||
<target>لا شيء</target> | ||
</trans-unit> | ||
|
||
<!-- forms --> | ||
<trans-unit id="form.label.collections"> | ||
<!-- don't change this "translation" --> | ||
<source>__name__label__</source> | ||
<target>__name__label__</target> | ||
</trans-unit> | ||
</body> | ||
</file> | ||
</xliff> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the EasyAdminBundle. | ||
* | ||
* (c) Javier Eguiluz <javier.eguiluz@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace JavierEguiluz\Bundle\EasyAdminBundle\Tests\Controller; | ||
|
||
use JavierEguiluz\Bundle\EasyAdminBundle\Tests\Fixtures\AbstractTestCase; | ||
|
||
class RtlTest extends AbstractTestCase | ||
{ | ||
public function setUp() | ||
{ | ||
parent::setUp(); | ||
|
||
$this->initClient(array('environment' => 'rtl')); | ||
} | ||
|
||
public function testRtlAutodetection() | ||
{ | ||
$this->getBackendHomepage(); | ||
|
||
$backendConfig = $this->client->getContainer()->get('easyadmin.config.manager')->getBackendConfig(); | ||
$this->assertTrue($backendConfig['design']['rtl'], 'RTL is enabled automatically for the "ar" locale.'); | ||
} | ||
|
||
public function testRtlWebAssets() | ||
{ | ||
$crawler = $this->getBackendHomepage(); | ||
|
||
$this->assertSame( | ||
'/bundles/easyadmin/stylesheet/easyadmin-all.min.css', | ||
$crawler->filter('link[rel="stylesheet"]')->eq(0)->attr('href') | ||
); | ||
|
||
$this->assertSame( | ||
'/bundles/easyadmin/stylesheet/bootstrap-rtl.min.css', | ||
$crawler->filter('link[rel="stylesheet"]')->eq(1)->attr('href') | ||
); | ||
|
||
$this->assertSame( | ||
'/bundles/easyadmin/stylesheet/adminlte-rtl.min.css', | ||
$crawler->filter('link[rel="stylesheet"]')->eq(2)->attr('href') | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
imports: | ||
- { resource: config.yml } | ||
|
||
# use 'ar' (Arabic) as the locale of the app to force the detection of RTL languages | ||
parameters: | ||
locale: ar | ||
framework: | ||
default_locale: ar | ||
|
||
easy_admin: | ||
entities: | ||
Category: AppTestBundle\Entity\FunctionalTests\Category |