Disable language chooser

polle

Active member
How can I set a language for the forum and disable all other languages for the users ?

I need to have english, spanish and spanish childs for addons, but I want the user to have Spanish and no option available to change the language.

Thanks.
 
In the Admin CP, go to Appearance > Templates and find the template called footer

Remove this code:

Code:
                <xen:if is="{$canChangeLanguage}">
                    <dt>{xen:phrase language}</dt>
                    <dd><a href="{xen:link 'misc/language', '', 'redirect={$requestPaths.requestUri}'}" class="OverlayTrigger Tooltip" title="{xen:phrase language_chooser}" rel="nofollow">{$visitorLanguage.title}</a></dd>
                </xen:if>

That will remove the language chooser.
 
Hi Yorik.

And how about the user profile where the lang can be selected ?
Isn't there an option to just use one language and block all the others for users ?

I don't want to have to edit the templated all the time for updates, etc...

Thanks.
 
Admin CP -> Appearance -> Templates -> account_preferences

Add the red code:

Rich (BB code):
	<xen:if is="{$canChangeLanguage} AND false">
		<dl class="ctrlUnit">
			<dt><label for="ctrl_language_id">{xen:phrase language}:</label></dt>
			<dd>
				<select name="language_id" class="textCtrl" id="ctrl_language_id">
					<xen:foreach loop="$languages" key="$languageId" value="$language">
						<option value="{$languageId}" {xen:selected '{$languageId} == {$visitor.effectiveLanguageId}'}>{$language.title}</option>
					</xen:foreach>
				</select>
				<p class="explain">{xen:phrase interface_of_site_can_be_displayed_using_any_languages}</p>
			</dd>
		</dl>
	<xen:else />
		<input type="hidden" name="language_id" value="{$visitor.effectiveLanguageId}" />
	</xen:if>
 
Hi @Jake Bunce If I need to hide in account_preferences only one language for the list of languages, because I edit my languages like childs for not lost my own changes when the language is updated. It is posible? Thanks in advance.
 
Admin CP -> Appearance -> Templates -> account_preferences

Add the red code:

Rich (BB code):
    <xen:if is="{$canChangeLanguage} AND false">
        <dl class="ctrlUnit">
            <dt><label for="ctrl_language_id">{xen:phrase language}:</label></dt>
            <dd>
                <select name="language_id" class="textCtrl" id="ctrl_language_id">
                    <xen:foreach loop="$languages" key="$languageId" value="$language">
                        <option value="{$languageId}" {xen:selected '{$languageId} == {$visitor.effectiveLanguageId}'}>{$language.title}</option>
                    </xen:foreach>
                </select>
                <p class="explain">{xen:phrase interface_of_site_can_be_displayed_using_any_languages}</p>
            </dd>
        </dl>
    <xen:else />
        <input type="hidden" name="language_id" value="{$visitor.effectiveLanguageId}" />
    </xen:if>
This code (AND false), works perfectly for hide the language selector of preferences. Thanks!
 
If there is this conditional <xen:if is="{$canChangeLanguage}"> then why do we need to make template changes in order to achieve this? If there is that conditional then I guess that somewhere in the software there is an option to set whether people are allowed to change language or not?
 
No, it's nothing like that:

PHP:
'canChangeLanguage' => (count($languages) > 1),

You "can change language" if the number of languages on your board is greater than 1. There's nothing more complicated to it than that.
 
No, it's nothing like that:

PHP:
'canChangeLanguage' => (count($languages) > 1),

You "can change language" if the number of languages on your board is greater than 1. There's nothing more complicated to it than that.

And how to remove completely that option ?

1- I install Xenforo and it comes with english.
2- I install my language.
3- I don't want to have the option to choose a language at all, just use mine for everyone.

How ?

Thanks.
 
That means delete the language in the admin and have no english at all or use what Jake recommends above ?

There should be an option like in styles, "Let the user select" thing.

Thanks.
 
Sorry for bump this thread.
I'm looking exactly the same, I want to have my ACP in English and the the front end in other different language.
but I don't want the users have the option to change the language. plus I don't want to edit the 2 templates all the time. XF should have the option to choose the language in ACP and Front end.
any clue? I'll really appreciate some help.
 
There is no distinction between the ACP and front end - phrases are not separated like that.

As already stated, it is not possible to have a separate language for the ACP which isn't selectable by regular members.
 
Top Bottom