Skip to content
This repository has been archived by the owner on Jun 18, 2019. It is now read-only.

dynamic languages #54

Closed
wisepotato opened this issue Sep 26, 2014 · 8 comments
Closed

dynamic languages #54

wisepotato opened this issue Sep 26, 2014 · 8 comments

Comments

@wisepotato
Copy link

So, love the package. But I have dynamic languages... Currently I am using a closure for the available languages in the config, but this is less than ideal.

Would this not be a nice addition to the package, to make a language table? It could also include a column for 'active', which could help in real-world applications.

Or atleast make it easier to use dynamic languages, couldnt think of a great way to implement this....

@sdebacker
Copy link
Collaborator

Why not use Config::set('app.locales', […]) somewhere in your app ?

@wisepotato
Copy link
Author

What I'm suggesting is having more flexibility. Both the current option + a dynamic option. Where you can even have 'active' languages, those that can be disabled in the backend of an application for instance.

I would suggest normalising, as in using a 'language_id' in models to pinpoint to specific languages, this would also help in cascading deletion where if you delete a language, all models pertaining to said language would also be deleted.

@sdebacker
Copy link
Collaborator

One reason I like this package is that it's small with one responsibility. Perhaps making another package that extends laravel-translatable should make sense ? What do you think ?

@wisepotato
Copy link
Author

Fair point, Then I would suggest events for this package for easy hooking...I would gladly create this package.

@dimsav
Copy link
Owner

dimsav commented Oct 8, 2014

I agree with @sdebacker, you can do whatever you want with Config::set('app.locales', []), preferably in a service provider.

Sorry but your use case is too specific to be included in this package. Feel free to create an extension or something.

Cheers :)

@dimsav dimsav closed this as completed Oct 8, 2014
@wisepotato
Copy link
Author

Is it really so specific though? Normalising the languages to a database? Ill be writing a package to extend this one but still

@dimsav
Copy link
Owner

dimsav commented Oct 9, 2014

By adding the languages to the database you add extra complexity which is rarely needed. Let's keep the package simple and open for extension.

@daverdalas
Copy link

@wisepotato If you are still looking for a solution for your problem or someone in the future will look, you can see my fork: https://github.com/daverdalas/laravel-translatable

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants