Make a normal translation for a site similar to Laravel |
A question for developers, you can implement the translation of the application in a similar manner as in Laravel so that you can call a simple function __ ('translation', parameter) from anywhere. Because it’s not very convenient to create arrays of translation, for example, how you implemented
PHP Code: return [ and do like this PHP Code: return [ and then call us like this __ ('Opciones:') anywhere
There are many ways of implementing translations. In fact, in Laravel you can do it also in couple of ways.
You can always create a static helper class e.g TextHelper and based your translations provider call -> TextHelper::getText(translationKey) In that sense I don't quite feel that need to create a special translation solution in CI. I hope have understood your point correctly. (10-10-2019, 09:17 AM)milengardev1994 Wrote: There are many ways of implementing translations. In fact, in Laravel you can do it also in couple of ways.the problem is that there are no examples, ways to implement this, so I showed an example of how I did it in 3 versions. So I wrote my own version, I wanted the professionals to finalize it, maybe I did something wrong, can be done much better. (10-15-2019, 01:57 PM)kris2 Wrote: I am interested with an exemple for translation.I use a smart template engine and here in the code you can see how the translation should be __ ('Автопарк') Code: <div class="content-bk"> Code: return [ |
Welcome Guest, Not a member yet? Register Sign In |