problem with language and views

I’ve start new web application and I’ve chose to built it in Arabic language,

I use the option in the main config file


'language'=>'ar', 

everything seems to work fine ,

once I use gii , I’ve problem with views genreated by the gii/crud

it was specially in the _form view which give me this error


MessageFormatter::__construct(): msgfmt_create: message formatter creation failed

any help ?!

By the look of error it seems something to be something about intl.

it has to be , but am not sure , what I have to do ? to fix it >> it is problem everytime I try to use different base language

Try specifying locale additionally to the language as noted in docs.

hmmm… am not sure what do u mean additionally ?!

but u may say I should use something like this


\Yii::$app->language = 'ar';

should I make new views for it , i.e ar/views ?

gotttttttttt the Solution !!

It seems , u people in YII have problem in messages in Arabic language

I replace the following lines




    '{attribute} should contain at most {max, number} {max, plural, one{character} other{characters}}.' => '{attribute} يجب أن لا يحتوي على أكثر من {max, number} {max, plural, one{حرف} few{حروف} many{حرف}}.',

    '{attribute} should contain {length, number} {length, plural, one{character} other{characters}}.' => '{attribute}  يجب أن يحتوي على {length, number} {length, plural, one{حرف} few{حروف} many{حرف}}.',



with




 '{attribute} should contain at most {max, number} {max, plural, one{character} other{characters}}.' => '{attribute} يجب أن لا يحتوي على أكثر من {max, number} حرف.',

    '{attribute} should contain {length, number} {length, plural, one{character} other{characters}}.' => '{attribute}  يجب أن يحتوي على {length, number} حرف.',



Well, it seems you either don’t have intl installed or intl data is outdated. Because of that in your case it’s unable to handle plurals.