How to remove or hide languages in users profile?

Daniel Teich Posted in Component Development 5 years ago

Hey 🤗

How can I hide the language selection for my users?
I only want German anguage on my community

Replies
Breton Rafael [redcrested.net] Replied 3 years ago

@Daniel, your tip saved me a lot of time. Thanks.

But, to help anyone in the future, the file is components\OssnProfile\plugins\default\forms\OssnProfile\edit.php

I found searching by string "language #546" :-)

German Daniel Teich Replied 5 years ago

ok i have it :-) use this code in the edit.php

   <div id="Sprache">
<label><?php echo ossn_print('language');?></label>
<?php
    //profile edit form shows wrong default language #546
    $userlanguage = ossn_site_settings('language');
    echo ossn_plugin_view('input/dropdown', array(
                'name' => 'language',
                'value' => $userlanguage,
                'options' => ossn_get_installed_translations(false),
    ));
?>
<script>
window.onload = function() {
  var x = document.getElementById("Sprache");
    x.style.display = "none";
}
</script>