hpolthof's avatar

Easy Localization and Translation (in database)

As I was getting tired of creating translation files and maintaining big arrays of translations, I looked around for a package that would help me to easy the job. But none of the packages I tried did what I wanted.

So I made the following list of my requirements:

  • I want to define a key in my code and this has to be added automatically. No key lookups and copy & paste for me.
  • A simple interface to translate a key from my base language to any other. Other translators need to understand how this works.
  • I should be fast.
  • If a key gets deleted from the code I need a way to track that it's no longer in use.

I'd like to know what you guys think of it and if you would use the package?

You can find it at: https://github.com/hpolthof/laravel-translations-db

0 likes
4 replies
luceos's avatar

How does it work? I read the git page but you did not document how your package is going to gather the translation keys.

It looks interesting.

hpolthof's avatar

It's an in-place replacement for Illuminate's TranslationsServiceProvider.

You can just use it as described in the Documentation.

This can be done by calling the trans() or Lang::get() functions.

I'll add some more info for clearity to readme.

1 like
luceos's avatar

I would make the interface optional. And if you do not want to do that I would make an option that allowed disabling the route. No need to force a route into everyone's applications without authentication etc where actual changes can be made.

Knowing this exists, I might use it (in the future). But it depends on how maintained the package will be.

1 like
hpolthof's avatar

Thanks for the hint! I'll add this setting to the master.

Please or to participate in this conversation.