Skip to content

Is not working with multiple translation files #13

@ursuleacv

Description

@ursuleacv

This is what I have in config

'preload' => array('log', 'jsTrans'),
'components' => array(
    'jsTrans'=>array( 
         'class'=>'application.extensions.JsTrans.JsTrans', 
            'categories'=>array('frontend', 'backend'), // the categories to be made available 
            'languages'=>array('en', 'fr'), // the languages to be made available
        ), 

the dictionary files are created in assets folder.

I have this structure for messages

protected/

  • messages/
    • en/
      • backend.php
      • frontend.php
    • fr/
      • backend.php
      • frontend.php

and is working fine in php, But when I try in JavaScript with JsTrans I can access only variables from frontend

Yii.t('frontend', 'TRANS_VARIABLE') - working fine
Yii.t('backend', 'TRANS_VARIABLE') - not working

even though TRANS_VARIABLE exists in both frontend and backend
Can you help me please.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions