Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dinamic translate from database #80

Closed
igortsev opened this issue May 11, 2016 · 1 comment
Closed

Dinamic translate from database #80

igortsev opened this issue May 11, 2016 · 1 comment
Labels

Comments

@igortsev
Copy link

igortsev commented May 11, 2016

The default language is set to Italian. When choosing another language everything works great except for those elements which are stored in the database.

In the database I store the products. Through the settings added to the translation table products with fields : name and description.

Yu can see it
https://voilasrl.com/product/index
And choose another lang

'tables' => [ // Properties of individual tables
[
'connection' => 'db', // connection identifier
'table' => '{{%language}}', // table name
'columns' => ['name', 'name_ascii'],// names of multilingual fields
// 'category' => 'database-table-name',// the category is the database table name
],
[
'connection' => 'db', // connection identifier
'table' => '{{%product}}', // table name
'columns' => ['name', 'description'],// names of multilingual fields
],
[
'connection' => 'db', // connection identifier
'table' => '{{%product_category}}', // table name
'columns' => ['name', 'description'],// names of multilingual fields
],
[
'connection' => 'db', // connection identifier
'table' => '{{%tax}}', // table name
'columns' => ['name'],// names of multilingual fields
]
]

Explanation

The language is set as Italian, change the language to Spanish. Product name and description remains in Italian, everything else from the database is translated.

@moltam
Copy link
Collaborator

moltam commented May 6, 2017

Your tables configuration looks good. You should use the \lajax\translatemanager\helpers\Language::d($text) helper method to translate texts retrieved from your database.

I am closing this due to inactivity. If the problem still present, please reopen the issue, and provide more detail about what is not working exactly.

@moltam moltam closed this as completed May 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants