Note that there are some explanatory texts on larger screens.

plurals
  1. POChange Error message in multi-languages in Cakephp
    primarykey
    data
    text
    <p>I need to change the error messages based on the language changes.</p> <p>i have created <code>default.po</code> file in the <code>/locale/en/LC_MESSAGES/default.po</code></p> <p>in that have created msgid as ID-1 and same way</p> <p>did it for spain</p> <pre><code>/locale/spa/LC_MESSAGES/default.po </code></pre> <p>in view file:</p> <pre><code>&lt;label class="control-label"&gt;&lt;?php echo __('ID-1'); ?&gt;&lt;span class="red"&gt;*&lt;/span&gt;&lt;/label&gt; &lt;div class="controls"&gt; &lt;?php echo $this-&gt;Form-&gt;input('Patient.fname', array('label' =&gt; false,'required'=&gt;true, 'div' =&gt; false,'Placeholder' =&gt; 'First Name','class'=&gt;'','maxlength'=&gt;'20','size'=&gt;"30")); ?&gt; &lt;/div&gt; </code></pre> <p>controller:</p> <pre><code> if ($this-&gt;request-&gt;is('ajax')) { if (!empty($this-&gt;request-&gt;data)) { $this-&gt;Patient-&gt;save($this-&gt;request-&gt;data); } } </code></pre> <p>and Model file:</p> <pre><code>App::uses('Model', 'Model'); /** * Application model for Cake. * * Add your application-wide methods in the class below, your models * will inherit them. * * @package app.Model */ class Patient extends Model { var $useTable = 'patients'; var $actsAs = array('Logable'); var $validate = array( 'fname' =&gt; array( 'required' =&gt; array( 'rule' =&gt; 'notEmpty', 'message' =&gt; "Please Enter Your FristName." ) ), } } </code></pre> <p>so when i change language from English to spain that time, MODEL VALIDATION ERROR MESSAGES ARE NOT GETTING CHANGE.</p> <p>Can anyone help me out in this?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload