Make component only available for specific language?

Dominik L Posted in Component Development 11 months ago

hey, I've a dumb question:

is it possible to modify the ossn_com.php, so that the component is only available for people who has "German" as their profile language?

I have a component, which is specifically only available for German users in German language.

Is there a way to modify the component to get the users language and if the language is e.g. German, the component is showing for him?

Replies
German Michael Zülsdorff Replied 11 months ago

What exactly are you missing in Arsalan's solution, David?

Dutch David Vaughan Replied 11 months ago

Any another way available? if yes please share with me.

Indonesian Arsalan Shah Replied 11 months ago

If you developed the component then you may know how to show pages of that component for specific langauge users example

if($user->language == 'de') { do the action}

I am afraid there is no way you disable and enable components based on langauge, there is one way to do is to unset the initialization callback, but again this need to be done by a developer who knows what are the effects of it.