Feature: multi language (VI, EN, JA)

CR: sonh (fake)
This commit is contained in:
2021-08-23 15:19:49 +07:00
parent 7057e5b35c
commit eb88996797
37 changed files with 788 additions and 327 deletions

View File

@@ -40,15 +40,15 @@ class CaptureLogs extends \yii\db\ActiveRecord {
*/
public function attributeLabels() {
return [
'id' => 'ID',
'time' => 'Thời gian',
'image' => 'Hình ảnh',
'status' => 'Status',
'remark' => 'Remark',
'staff_name' => "Name",
'staff_image' => "Hình ảnh đăng kí",
'confidence' => 'Độ tin cậy',
'sync_status' => 'Trạng thái đồng bộ'
'id' => Yii::t("app", "ID"),
'time' => Yii::t("app", "THOI_GIAN"),
'image' => Yii::t("app", "HINH_ANH"),
'status' => Yii::t("app", "TRANG_THAI"),
'remark' => Yii::t("app", "REMARK"),
'staff_name' => Yii::t("app", "TEN"),
'staff_image' => Yii::t("app", "HINH_ANH_DANG_KI"),
'confidence' => Yii::t("app", "DO_TIN_CAY"),
'sync_status' => Yii::t("app", "TRANG_THAI_DONG_BO")
];
}

View File

@@ -45,19 +45,19 @@ class ListManagement extends \yii\db\ActiveRecord {
*/
public function attributeLabels() {
return [
'id' => 'ID',
'code' => 'ID',
'type' => 'Loại',
'name' => 'Tên',
'image' => 'Hình ảnh đăng kí',
'gender' => 'Giới tính',
'birthday' => 'Ngày sinh',
'telephone' => 'Điện thoại',
'address' => 'Đơn vị',
'time' => 'Thời gian đăng kí',
'id' => Yii::t("app", "ID"),
'code' => Yii::t("app", "ID"),
'type' => Yii::t("app", "LOAI"),
'name' => Yii::t("app", "TEN"),
'image' => Yii::t("app", "HINH_ANH_DANG_KI"),
'gender' => Yii::t("app", "GIOI_TINH"),
'birthday' => Yii::t("app", "NGAY_SINH"),
'telephone' => Yii::t("app", "DIEN_THOAI"),
'address' => Yii::t("app", "DON_VI"),
'time' => Yii::t("app", "THOI_GIAN_DANG_KI"),
'last_modified' => 'Last Modified',
'abbreviated_name' => 'Tên hiển thị',
'staff_id' => 'ID'
'abbreviated_name' => Yii::t("app", "TEN_HIEN_THI"),
'staff_id' => Yii::t("app", "ID"),
];
}
@@ -86,14 +86,19 @@ class ListManagement extends \yii\db\ActiveRecord {
}
}
public static $typeArray = [
"wl" => "Whitelist",
"bl" => "Blacklist"
];
public static $genderArray = [
"Male" => "Nam",
"Female" => "Nữ"
];
public static function typeArray() {
return [
"wl" => Yii::t("app", "WHITE_LIST"),
"bl" => Yii::t("app", "BLACK_LIST")
];
}
public static function genderArray() {
return [
"Male" => Yii::t("app", "MALE"),
"Female" => Yii::t("app", "FEMALE"),
];
}
public static function nameArray() {
$res = [""];

View File

@@ -220,4 +220,12 @@ class common extends \yii\db\ActiveRecord {
return $str;
}
public static function allLanguage() {
return [
["icon" => "vi.png", "name" => "vi-VI", "description" => "Tiếng Việt"],
["icon" => "en.png", "name" => "en-EN", "description" => "English"],
["icon" => "jp.png", "name" => "ja-JA", "description" => "Japanese"]
];
}
}