Extend translation class

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Sergunik
Posts: 12
Joined: 16 Mar 2018, 14:14

Extend translation class

Post by Sergunik » 09 Aug 2018, 12:49

Main issue:
Detect all not translated phrases in project.

Idea:
Replace or extend function aitrans.
My extended function should consist of parent functionality and few extra (dirty) rows:

Code: Select all

IF (phrase has no translation) THEN log this phrase to file
After that need only surf cross the website.

First problem:
aitrans – it's not a function of class. It's only helper. So decided to extend function dt - main functionality from aitrans.

Second problem:
Function dt related to different classes.
Which one need to use and where in project should I place replacement?

---
Laravel: 5.5,
Aimeos: 2018.07,
PHP: 7.0,
Linux

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Extend translation class

Post by aimeos » 10 Aug 2018, 18:59

OUr suggestion would be to write a simple translation decorator that checks $input === $output:
https://github.com/aimeos/aimeos-core/t ... /Decorator

You can add it for tests here:
https://github.com/aimeos/aimeos-larave ... 8n.php#L56

You will get only missing frontend translations and probably almost no errors. In the end, you should fully translate Aimeos to your language: https://www.transifex.com/aimeos/public/ :-)
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply