How to force all members to use a fixed language?

Looking for an Extension? Have an Extension request? Post your request here for help. (Note: This forum is community supported; while there is an Extensions Development Team, said team does not dedicate itself to handling requests in this forum)
Scam Warning
thegioiluatsu
Registered User
Posts: 46
Joined: Wed Dec 23, 2020 12:10 pm

How to force all members to use a fixed language?

Post by thegioiluatsu »

Hello everyone,

I am currently managing a forum using phpBB3 and I have an issue related to language settings that I need some help with.

My forum supports multiple languages, and some members have changed their language preferences through the User Control Panel (UCP). However, I would like to force all members to use a fixed language across the entire forum, regardless of their previous settings.

Is there a way to configure this in the ACP? Or, if not, is there an extension that can help me achieve this?

Thank you in advance for your assistance!
I come from Vietnam and I love phpBB. Sorry guys because I don't know English. I have used google translate to be able to communicate with you guys at this forum. Here is my product: diễn đàn luật tự học luật
User avatar
Mannix_
Registered User
Posts: 2003
Joined: Sun Oct 25, 2015 2:56 pm
Name: Matt

Re: How to force all members to use a fixed language?

Post by Mannix_ »

Remove other languages to force users to your the one you want ??
Did I helped You? Consider a donation.
New version of phpBB has been released? My styles aren't validated for it yet? Check my page for the latest downloads!
User avatar
danieltj
Infrastructure Team Member
Infrastructure Team Member
Posts: 518
Joined: Thu May 03, 2018 9:32 pm
Location: United Kingdom
Name: Daniel James

Re: How to force all members to use a fixed language?

Post by danieltj »

Mannix_ wrote: Mon Aug 26, 2024 9:14 am Remove other languages to force users to your the one you want ??
This.

If you don’t want multiple languages then just uninstall all the languages you don’t want. You don’t need an extension for this.
💷 Purchase the Awesome Payments extension today!
Monetise your forum with one off payments and subscriptions.

Need a premium extension created? Send me a PM.
thegioiluatsu
Registered User
Posts: 46
Joined: Wed Dec 23, 2020 12:10 pm

Re: How to force all members to use a fixed language?

Post by thegioiluatsu »

Thank you @Mannix_ and @danieltj. I currently have 2 languages ​​and I still want to keep both of them. At the same time, I want members to only use the forum's default language and not be able to set the language themselves in UCP. Please give me new ideas. Thank you!
I come from Vietnam and I love phpBB. Sorry guys because I don't know English. I have used google translate to be able to communicate with you guys at this forum. Here is my product: diễn đàn luật tự học luật
User avatar
warmweer
Jr. Extension Validator
Posts: 11644
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: How to force all members to use a fixed language?

Post by warmweer »

thegioiluatsu wrote: Mon Aug 26, 2024 2:30 pm Thank you @Mannix_ and @danieltj. I currently have 2 languages ​​and I still want to keep both of them. At the same time, I want members to only use the forum's default language and not be able to set the language themselves in UCP. Please give me new ideas. Thank you!
What's the reasoning/purpose of not allowing users to use their preferred language for the language strings? Surely that can't affect your working on the board?
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
danieltj
Infrastructure Team Member
Infrastructure Team Member
Posts: 518
Joined: Thu May 03, 2018 9:32 pm
Location: United Kingdom
Name: Daniel James

Re: How to force all members to use a fixed language?

Post by danieltj »

thegioiluatsu wrote: Mon Aug 26, 2024 2:30 pm Thank you @Mannix_ and @danieltj. I currently have 2 languages ​​and I still want to keep both of them. At the same time, I want members to only use the forum's default language and not be able to set the language themselves in UCP. Please give me new ideas. Thank you!
What are the two languages you have installed out of curiosity? I'm going to assume that one of them is British English (the default).
💷 Purchase the Awesome Payments extension today!
Monetise your forum with one off payments and subscriptions.

Need a premium extension created? Send me a PM.
User avatar
SpIdErPiGgY
Registered User
Posts: 270
Joined: Sun May 02, 2021 2:11 pm
Location: Erpe-Mere, Aalst, BE
Name: Andy Dm

Re: How to force all members to use a fixed language?

Post by SpIdErPiGgY »

I removed the language selector from all templates were it's being used. So now there is only 1 language. EN is active, but not visible to my users.

I think this is the better solution... Remove the en language can cause update problems I guess...
phpBB NL Extension translations, also on request.
--> Click Here: Myarea51secrets.com <--
User avatar
ssl
Registered User
Posts: 1979
Joined: Sat Feb 08, 2020 2:15 pm
Location: Le Lude, Pays de la Loire - France
Name: Fred Rimbert

Re: How to force all members to use a fixed language?

Post by ssl »

warmweer wrote: Mon Aug 26, 2024 4:24 pm
thegioiluatsu wrote: Mon Aug 26, 2024 2:30 pm Thank you @Mannix_ and @danieltj. I currently have 2 languages ​​and I still want to keep both of them. At the same time, I want members to only use the forum's default language and not be able to set the language themselves in UCP. Please give me new ideas. Thank you!
What's the reasoning/purpose of not allowing users to use their preferred language for the language strings? Surely that can't affect your working on the board?
I think this is to prevent users from using British English (phpBB's default language) and only being able to use the default language of the board (Vietnamese).
phpBB does not allow this function, the extension request is legitimate
Sorry for my English ... I do my best! :anger_right:

:point_right_tone3: phpBB: 3.3.13 | PHP: 8.3.9
:point_right_tone4: [Kill spam on phpBB] - [Some French translation of extensions]
"Mistress, Mistress someone is bothering me in pm"
User avatar
warmweer
Jr. Extension Validator
Posts: 11644
Joined: Fri Jul 04, 2003 6:34 am
Location: Van Allen Bel ... gium

Re: How to force all members to use a fixed language?

Post by warmweer »

ssl wrote: Tue Aug 27, 2024 8:01 am
I think this is to prevent users from using British English (phpBB's default language) and only being able to use the default language of the board (Vietnamese).
phpBB does not allow this function, the extension request is legitimate
OK, but the board's default language can be set to Vietnamese, so all new users will have Vietnamese as language unless they explicitly (on purpose) select British English as language (the first page of registration uses the default language, but prospective members can select another language (if it's installed , which should always be the case for British English).
So basically the extension removes the choice.

Honestly ... British English will only be used if the prospective member actively selects that when registering so the "feature" requested (hiding British English completely) can't even be considered user-friendly.
Spelling is freeware, which means you can use it for free.
On the other hand, it is not open source, which means you cannot change it or publish it in a modified form.


Time flies like an arrow, but fruit flies like a banana.
User avatar
Anișor
Translator
Posts: 330
Joined: Tue Jan 08, 2013 9:36 pm
Location: Arbroath, Angus, Scotland

Re: How to force all members to use a fixed language?

Post by Anișor »

You can run this mysql query to change all users default language to english apart from visitors and bots.
From there you can add a restriction (maybe add an if U_ACP) statement to UCP to allow only admins to change their language.

Code: Select all

UPDATE phpbb_users
SET user_lang = 'en'
WHERE user_type <> 2;
thegioiluatsu
Registered User
Posts: 46
Joined: Wed Dec 23, 2020 12:10 pm

Re: How to force all members to use a fixed language?

Post by thegioiluatsu »

Thank you very much danieltj, SpIdErPiGgY, ssl, warmweer and Anișor for giving me more useful information.
@Anișor do you mean:

Code: Select all

UPDATE phpbbx7users SET user_lang = replace(user_lang, 'en', 'vi');
I followed your instructions, it's great that all forum members have switched to the default language I want now which is Vietnamese. The reason I want to do this is because I need to revise some English language translations, during which time members can use Vietnamese to access the forum.
I come from Vietnam and I love phpBB. Sorry guys because I don't know English. I have used google translate to be able to communicate with you guys at this forum. Here is my product: diễn đàn luật tự học luật
User avatar
Anișor
Translator
Posts: 330
Joined: Tue Jan 08, 2013 9:36 pm
Location: Arbroath, Angus, Scotland

Re: How to force all members to use a fixed language?

Post by Anișor »

No, Please don’t run that command. Replace in mysql doesn’t work like that.
Instead, run my command with “vi” instead of “en”.

Code: Select all

UPDATE phpbbx7users
SET user_lang = 'vi'
WHERE user_type <> 2;
thegioiluatsu
Registered User
Posts: 46
Joined: Wed Dec 23, 2020 12:10 pm

Re: How to force all members to use a fixed language?

Post by thegioiluatsu »

Thank you very much.
From there you can add a restriction (maybe add an if U_ACP) statement to UCP to allow only admins to change their language.
Can you give me more detailed instructions on this issue?
I come from Vietnam and I love phpBB. Sorry guys because I don't know English. I have used google translate to be able to communicate with you guys at this forum. Here is my product: diễn đàn luật tự học luật
User avatar
Anișor
Translator
Posts: 330
Joined: Tue Jan 08, 2013 9:36 pm
Location: Arbroath, Angus, Scotland

Re: How to force all members to use a fixed language?

Post by Anișor »

In styles/your_style/template/ucp_prefs_personal.html
You have the following code:

Code: Select all

<!-- IF S_MORE_LANGUAGES -->
		<dl>
			<dt><label for="{{ LANG_OPTIONS.id }}">{L_BOARD_LANGUAGE}{L_COLON}</label></dt>
			<dd>
				{{ FormsSelect(LANG_OPTIONS) }}
			</dd>
		</dl>
	<!-- ENDIF -->
You can change it to:

Code: Select all

<!-- IF U_ACP or U_MCP --><!-- IF S_MORE_LANGUAGES -->
		<dl>
			<dt><label for="{{ LANG_OPTIONS.id }}">{L_BOARD_LANGUAGE}{L_COLON}</label></dt>
			<dd>
				{{ FormsSelect(LANG_OPTIONS) }}
			</dd>
		</dl>
	<!-- ENDIF --><!-- ENDIF -->
And now only administrators & moderators can see the language option in UCP.
Don’t forget to purge the cache after edits.
thegioiluatsu
Registered User
Posts: 46
Joined: Wed Dec 23, 2020 12:10 pm

Re: How to force all members to use a fixed language?

Post by thegioiluatsu »

@Anișor, your instructions are exactly what I needed. My problem has been resolved. You are a great professional. Thank you very much for your very detailed and specific instructions.

I still have one more problem, I hope you can guide me on how to solve it. You can see my issue here: viewtopic.php?t=2655988
I come from Vietnam and I love phpBB. Sorry guys because I don't know English. I have used google translate to be able to communicate with you guys at this forum. Here is my product: diễn đàn luật tự học luật

Return to “Extension Requests”