yii用户和权限模块多语言

时间:2014-09-11 11:18:45

标签: php yii multilingual yii-modules

您可以使用yii的{​​{1}}和users模块进行用户管理。他们实施了Rights和许多功能。

他们都实现了多语言目的。因此,他们在目录层次结构下有一个RBAC文件夹:

messages

他们还没有包含所有语言。如果您已根据自己的语言对其进行了自定义,请分享。

1 个答案:

答案 0 :(得分:1)

我写的是波斯语(fa_ir)。将您的应用语言更改为fa_ir,将以下代码放在messages文件夹下即可享受。

- 保护的/模块/用户/消息/ fa_ir / user.php的:

<?php
return array(
'Registration' => 'ثبت نام',
'Register' => 'ثبت نام',
'Login' => 'ورود',
'Logout' => 'خروج',
'username' => 'نام کاربری',
'username or email' => 'نام کاربری یا ایمیل',
'password' => 'رمز عبور',
'Remember me next time' => 'مرا در این رایانه به یاد داشته باش.',
'Username is incorrect.' => 'نام کاربری اشتباه است',
'Email is incorrect.' => 'ایمیل اشتباه است.',
'This user\'s name already exists.' => 'نام کاربر قبلا ثبت شده است.',
'This user\'s email address already exists.' => 'ایمیل کاربر قبلا ثبت شده است.',
'You registered from {site_name}' => 'شما از سایت  {site_name} ثبت نام کردید.',
'Please activate you account go to {activation_url}' => 'لطفا حساب کاربری خود را فعال کنید. برو به {activation_url}',
'You account is not activated.' => 'حساب کاربری شما فعال نیست',
'You account is blocked.' => 'حساب کاربری شما مسدود شده است.',
'Password is incorrect.' => 'رمز عبور اشتباه است.',
'E-mail' => 'رایانامه',
'Verification Code' => 'Verification Code',
'Retype Password' => 'تکرار رمز عبور',
'Retype Password is incorrect.' => 'تکرار رمز عبور اشتباه است.',
'Incorrect password (minimal length 4 symbols).' => 'رمز عبور اشتباه است. حداقل 4 رقم.',
'Incorrect username (length between 3 and 20 characters).' => 'نام کاربری باید بین 3 تا 20 حرف باشد.',
'Incorrect symbol\'s. (A-z0-9)' => 'حرف اشتباه وارد کرده اید. حرف و عدد پذیرفته می شود.',
'Variable name may consist of a-z, 0-9, underscores, begin with a letter.'=>'اسم متغیر باید از حرف و رقم و خط زیر تشکیل شده باشد و با حرف شروع شود.',
"Length of ' + n + ' must be between '+min+' and '+max+'."=>"Length of ' + n + ' must be between '+min+' and '+max+'.",
'Please enter the letters as they are shown in the image above.' => 'لطفا حروف را مطابق تصویر وارد نمایید.',
'Letters are not case-sensitive.' => 'نسبت به حروف بزرگ و کوچک حساس نیست.',
'Minimal password length 4 symbols.' => 'حداقل تعداد حروف رمز عبور 4 تاست.',
'Lost Password?' => 'فراموشی رمز عبور',
'Profile' => 'پروفایل',
'activation key' => 'کلید فعال سازی',
'User activation' => 'فعال سازی کاربر',
'You account is active.' => 'حساب کاربری شما فعال است',
'You account is activated.' => 'حساب کاربری شما فعال می شود.',
'Incorrect activation URL.' => 'مسیر وارد شده برای فعال سازی صحیح نیست.',
'Registration date' => 'تاریخ ثبت',
'Last visit' => 'آخرین بازدید',
'Superuser' => 'مدیر',
'Status' => 'وضعیت',
'Ok' => 'خب',
'Show all'=> 'نمایش همه',
'Save' => 'ذخیره',
'Cancel'=> 'انصراف',
'New password is saved.' => 'رمز عبور جدید ذخیره شد.',
'Change password' => 'تغییر رمز عبور',
'Your profile' => 'پروفایل شما',
'Thank you for your registration. Please check your email or login.' => 'با تشکر از ثبت نام شما، لطفا ایمیل خود را بررسی نمایید یا وارد سایت شوید.',
'Thank you for your registration. Please check your email.' => 'با تشکر از ثبت نام شما، لطفا ایمیل خود را بررسی نمایید.',
'Please check your email. An instructions was sent to your email address.' => 'لطفا ایمیل خود را چک کنید. یک دستورالعمل به ایمیل شما فرستاده شد.',
'Thank you for your registration. Please {{login}}.' =>  'با تشکر از ثبت نام شما لطفا {{login}}.',
'Thank you for your registration. Contact Admin to activate your account.' =>  'با تشکر از ثبت نام شما. از مدیر سیستم بخواهید حساب کاربری شما را فعال کند.',
'Restore' => 'Restore',
'Please enter your login or email addres.' => 'لطفا نام کاربری یا ایمیل خود را وارد نمایید.',
'Incorrect recovery link.' => 'لینک ریکاوری اشتباه است.',
'Already exists.' => 'قبلا ثبت شده است.',
'First Name' => 'نام',
'Last Name' => 'نام خانوادگی',
'No' => 'خیر',
'Yes' => 'بله',
'Yes and show on registration form' => 'بله، در فرم ثبت نام هم نمایش داده شود.',
'No, but show on registration form' => 'خیر، ولی در فرم ثبت نام نمایش داده شود.',
'Not active' => 'غیر فعال',
'Active' => 'فعال',
'Banned' => 'محدود',
'Please fill out the following form with your login credentials:' => 'لطفا فرم زیر با کامل کنید:',
'Fields with <span class="required">*</span> are required.' => 'فیلدهای مشخص شده با <span class="required">*</span> الزامی است.',
'List User' => 'لیست کاربران',
'Edit' => 'ویرایش',
'Edit profile' => 'ویرایش پروفایل',
'Create User' => 'ایجاد کاربر جدید',
'Create' => 'ایجاد',
'Manage' => 'مدیریت',
'Manage Users' => 'مدیریت کاربران',
'Users' => 'کاربران',
'Update User' => 'به روزرسانی کاربر',
'Delete User' => 'حذف کاربر',
'Delete file' => 'حذف فایل',
'View User' => 'مشاهده ی کاربر',
'Are you sure to delete this item?' => 'آیا برای حذف اینها مطمئن هستید؟',
'Changes is saved.' => 'تغییرات ذخیره شد.',
'Manage Profile Field' => 'مدیریت فیلد پروفایل',
'Variable name' => 'نام متغیر',
'Title' => 'عنوان',
'Field Type' => 'نوع فیلد',
'Field Size' => 'اندازه فیلد',
'Field Size min' => 'حداقل اندازه فیلد',
'Required' => 'الزامی',
'Match' => 'تطابق',
'Range' => 'محدوده',
'Error Message' => 'پیغام خطا',
'Other Validator' => 'ارزیاب دیگر',
'JSON string (example: {example}).' => 'رشته Json، مثل: {example}.',
'Default' => 'پیش فرض',
'Position' => 'مکان',
'Visible' => 'قابل مشاهده',
'Registered users' => 'کاربران ثبت نام کرده',
'For all' => 'برای همه',
'Only owner' => 'فقط صاحب',
'Hidden' => 'پنهان',
'Profile Fields' => 'فیلدهای پروفایل',
'View Profile Field #' => 'مشاهده فیلد پروفایل#',
'Manage Profile Fields' => 'مدیریت فیلدهای پروفایل',
'Create Profile Field' => 'ایجاد فیلد پروفایل',
'List Profile Field' => 'لیست فیلدهای پروفایل',
'View Profile Field' => 'مشاهده فیلد پروفایل',
'Delete Profile Field' => 'حذف فیلد پروفایل',
'Update Profile Field' => 'به روزرسانی فیلد پروفایل',
'Widget'=>'ویجت',
'Widget parametrs'=>'پارامترهای ویجت',
'Widget name.'=>'نام ویجت.',
'Allowed lowercase letters and digits.' => 'حروف کوچک و رقم مجاز است.',
'Field name on the language of "sourceLanguage".' => 'نام فیلد در زبان "SourceLanguage".',
'Field type column in the database.' => 'نوع ستون فیلد در پایگاه داده.',
'Field size column in the database.' => 'اندازه ستون فیلد در پایگاه داده.',
'The minimum value of the field (form validator).' => 'مقدار حداقل فیلد در ارزیابی فرم.',
'Required field (form validator).' => 'فیلد الزامی در ارزیابی فرم.',
"Regular expression (example: '/^[A-Za-z0-9\s,]+$/u')." => "عبارت منظم، مثل: '/^[A-Za-z0-9\s,]+$/u'.",
'Predefined values (example: 1;2;3;4;5 or 1==One;2==Two;3==Three;4==Four;5==Five).' => 'Predefined values (example: 1;2;3;4;5 or 1==One;2==Two;3==Three;4==Four;5==Five).',
'Error message when you validate the form.' => 'پیغام خطا هنگام ارزیابی فرم.',
'The value of the default field (database).' => 'مقدا فیلد پیشفرض در پایگاه داده',
'Display order of fields.' => 'نمایش ترتیب فیلدها',
'Not visited' => 'مشاهده نشده',
);

- 模/权/消息/ fa_ir / core.php中:

<?php


return array(
'A descriptive name for this item.' => 'یک عبارت توضیحی برای این عنصر',
'A role is group of permissions to perform a variety of tasks and operations, for example the authenticated user.' => 'یک نقش، دربردارنده ی گروهی از مجوزها برای انجام تکلیف ها و عمل های متعدد است.',
'A task is a permission to perform multiple operations, for example accessing a group of controller action.' => 'تکلیف، مجوزی است برای انجام چند عمل، برای مثال دسترسی به گروهی از controller actionها',
'Additional data available when executing the business rule.' => 'هنگام اجرای قانون، داده های بیشتری موجود خواهد بود.',
'An operation is a permission to perform a single operation, for example accessing a certain controller action.' => 'یک عمل، مجوزی است برای انجام یک عمل تنها، مثلا دسترسی به یک controller action خاص.',
'Are you sure you want to delete this operation?' => 'آیا نسبت به حذف این عمل اطمینان دارید؟',
'Are you sure you want to delete this role?' => 'آیا اطمینان به حذف این نقش دارید؟',
'Are you sure you want to delete this task?' => 'آیا اطمینان به حذف این تکلیف دارید؟',
'Assign item' => 'تخصیص عنصر',
'Authorization item' => 'عنصر دسترسی',
'Authorization items can be managed under {roleLink}, {taskLink} and {operationLink}.' => 'برای مدیریت عناصر تصدیق هویت به {roleLink}, {taskLink} و {operationLink} مراجعه کنید.',
'Business rule cannot be empty.' => 'قانون نمی تواند خالی باشد.',
'Cancel' => 'انصراف',
'Code that will be executed when performing access checking.' => 'کدی که هنگام بررسی سطح دسترسی اجرا می شود.',
'Do not change the name unless you know what you are doing.' => 'نام ها را بی جهت تغییر ندهید. مگر اینکه به انجام این کار آگاه باشید.',
'Generate items' => 'تولید عناصر',
'Generate items for controller actions' => 'تولید عناصر برای  Controller actions',
'Here you can view and manage the permissions assigned to each role.' => 'در این قسمت می توانید مجوزهای تخصیص یافته به هر نقش را مشاهده و مدیریت کنید.',
'Here you can view which permissions has been assigned to each user.' => 'در این قسمت می توانید ببینید که به هر کاربر چه مجوزهایی تخصیص یافته است.',
'Item' => 'عنصر',
'Name of the superuser cannot be changed.' => 'نام کاربر ویژه قابل تغییر نیست.',
'No actions found.' => 'هیچ اکشنی یافت نشد.',
'No assignments available to be assigned to this user.' => 'هیچ تخصیصی برای این کاربر یافت نشد.',
'No children available to be added to this item.' => 'هیچ فرزندی برای اضافه کردن به این عنصر وجود ندارد.',
'Operations exist below tasks in the authorization hierarchy and can therefore only inherit from other operations.' => 'در سلسه مراتب تصدیق هویت، عمل ها زیر تکلیف ها قرار می گیرند. لذا هر عمل فقط می تواند از عمل های دیگر ارث بری کند.',
'Permission :name assigned.' => 'مجوز :name تخصیص یافت.',
'Permission :name revoked.' => 'مجوز :name صلب شد.',
'Please select which items you wish to generate.' => 'لطفا عناصری را می خوهید تولید شوند انتخاب کنید.',
'Roles exist at the top of the authorization hierarchy and can therefore inherit from other roles, tasks and/or operations.' => 'نقش ها در بالای سلسله مراتب تصدیق هویت قرار می گیرند. لذا از نقشها و تکلیف ها و عمل ها می توانند ارث بری کنند.',
'Source' => 'منبع',
'Tasks exist below roles in the authorization hierarchy and can therefore only inherit from other tasks and/or operations.' => 'تکلیف ها در سلسله مراتب تصدیق هویت زیر نقش ها قرار می گیرند. لذا فقط می توانند از تکلیف ها و عمل ها ارث بری کنند.',
'There must be at least one superuser!' => 'حداقل باید یک کاربرویژه (superuser) وجود داشته باشد.',
'This user has not been assigned any items.' => 'هیچ عنصری به این کاربر تخصیص نیافته است.',
'Type' => 'نوع',
'Update :name' => 'تغییر :name',
':name created.' => ':name ایجاد شد.',
':name deleted.' => ':name حذف شد.',
':name updated.' => ':name تغییر یافت.',
'Add' => 'اضافه کردن',
'Add Child' => 'اضافه کردن فرزند',
'An item with this name already exists.' => 'عنصری با این نام قبلا ثبت شده است.',
'Application' => 'برنامه',
'Assign' => 'تخصیص',
'Assignments' => 'تخصیص یافته ها',
'Assignments for :username' => 'تخصیص یافته ها به :username',
'Authorization items created.' => 'عناصر تصدیق هویت ایجاد شد.',
'Business rule' => 'قانون',
'Child :name added.' => 'فرزند با عنوان :name اضافه شد',
'Child :name removed.' => 'فرزند با عنوان :name حذف شد.',
'Children' => 'فرزندان',
'Create :type' => 'ایجاد :type',
'Create a new operation' => 'ایجاد عمل جدید',
'Create a new role' => 'ایجاد نقش جدید',
'Create a new task' => 'ایجاد تکلیف جدید',
'Data' => 'تاریخ',
'Delete' => 'حذف',
'Description' => 'توضیحات',
'Generate' => 'تولید',
'Hover to see from where the permission is inherited.' => 'ماوس را نگه دارید تا ارث بری این مجوز را ببینید.',
'Inherited' => 'ارث برده',
'Invalid authorization item type.' => 'نوع عنصر تصدیق هویت ناصحیح است.',
'Invalid request. Please do not repeat this request again.' => 'درخواست اشتباه است.',
'Modules' => 'ماژول ها',
'Name' => 'نام',
'No authorization items found.' => 'هیچ عنصر تصدیق هویت یافت نشد.',
'No operations found.' => 'هیچ عملی یافت نشد.',
'No relations need to be set for the superuser role.' => 'نقش کاربر ویژه نیاز به تنظیم هیچ گونه رابطه ای نیست.',
'No roles found.' => 'هیچ نقشی یافت نشد.',
'No tasks found.' => 'هیچ تکلیفی یافت نشد.',
'No users found.' => 'هیچ کاربری یافت نشد.',
'Operation' => 'عمل',
'Operations' => 'عمل ها',
'Parents' => 'والدین',
'Permissions' => 'مجوزها',
'Relations' => 'رابطه ها',
'Remove' => 'حذف',
'Revoke' => 'صلب',
'Role' => 'نقش',
'Roles' => 'نقش ها',
'Save' => 'ذخیره',
'Select all' => 'انتخاب همه',
'Select none' => 'عدم انتخاب',
'Super users are always granted access implicitly.' => 'کاربر ویژه به صورت ضمنی دسترسی دارد.',
'Task' => 'تکلیف',
'Tasks' => 'تکلیف ها',
'The requested page does not exist.' => 'صفحه مورد نظر یافت نشد.',
'This item has no children.' => 'این عنصر، هیچ فرزندی ندارد.',
'This item has no parents.' => 'این عنصر هیچ والدینی ندارد.',
'Values within square brackets tell how many children each item has.' => 'مقادیر داخل براکت تعداد فرزندان هر عنصر را نشان می دهد.',
'You are not authorized to perform this action.' => 'شما اجازه انجام این کار را ندارید.',
);

如何改变我的yii app语言?

config/main.php下的

添加:

return array(
...
'language' => 'fa_ir',
...
);
相关问题