Thursday, July 26, 2012

SugarCRM: Vietnamese language pack

(Anhgolden's Blog)-Tiếp theo bài viết chia sẻ cách Việt hóa cho SugarCRM. Tôi xin chia sẻ thêm cách tạo 1 file cài đặt (SugarCRM Vietnamese language pack) và sử dụng Module Loader để Upload bộ ngôn ngữ tiếng Việt cho SugarCRM.

Bước 1: Việt hóa các file en_us.lang.php thành các file vn_vn.lang.php và các cây thư mục:
include\language\vn_vn.lang.php
modules\[tên module]\language\vn_vn.lang.php

Bước 2: Tạo 1 file manifest.php đặt cùng với thư mục include và modules ở trên.
Nội dung như sau:

<?php
$manifest = array( 
 'name' => 'Vietnamese language pack',
        'description' => 'Visit: <a href="http://www.anhgolden.com" target="_blank">http://www.anhgolden.com</a>',
 'type' => 'langpack',
 'is_uninstallable' => 'Yes',
 'version' => '6.2.0',
 'acceptable_sugar_flavors' => array ( 0 => "CE", 1 => "PRO", 2 => "CORP", 3 => "ENT", 4 => "ULT"),
 'author' => 'Anhgolden',
 'acceptable_sugar_versions' => array ( "exact_matches" => array (), "regex_matches" => array ( 0 => "6.*.[0-9][a-z]?" ), ),
 'published_date' => '23-07-2012',
);

$installdefs = array(
 'id'=> 'vn_vn',
 'image_dir'=>'<basepath>/images',
 'copy' => array(
 array('from'=> '<basepath>/include','to'=> 'include',),
 array('from'=> '<basepath>/modules','to'=> 'modules'))
);
?>

Bước 3: Tạo 1 file nén *.zip bao gồm file manifest.php và các thư mục đã Việt hóa (include, modules...)

Đến đây ta đã hoàn thành việc tạo 1 file SugarCRM Vietnamese language pack.

Với cách làm này, ta có thể áp dụng để tạo các file SugarCRM Module Upload khác.
Lưu ý: Một số trường hợp báo lỗi, thường liên quan đến Permission của file và thư mục. Bạn cần phải kiểm tra và set lại quyền cho phép chép lên thư mực của SugarCRM.

Đối với việc Việt hóa các Module bổ sung thêm khác, ta làm tương tự và điều chỉnh lại file minifest như sau:
<?php
$manifest = array( 
 'name' => 'AOS Module - Vietnamese language pack',
    'description' => 'www.anhgolden.com',
 'type' => 'module',
 'is_uninstallable' => 'Yes',
 'version' => '6.2.*',
 'acceptable_sugar_flavors' => array ( 0 => "CE", 1 => "PRO", 2 => "CORP", 3 => "ENT", 4 => "ULT"),
 'author' => 'Anhgolden',
 'acceptable_sugar_versions' => array ( "exact_matches" => array (), "regex_matches" => array ( 0 => "6.*.[0-9][a-z]?" ), ),
 'published_date' => '05-10-2012',
);

$installdefs =array(
        'id' => 'package_1341607504',
        'copy' => array(
            0 => array(
                'from' => '<basepath>/modules',
                'to' => 'modules',
            ),
        ),
);
?>

Xin chia sẻ file SugarCRM Vietnamese Language Package:
[Download] - Update 2012-10-05

1 comment:

Unknown said...
This comment has been removed by a blog administrator.

Post a Comment