Jump to content

How to change language flags on v8?


hkhost

Recommended Posts

8 hours ago, hkhost said:

When using the Twenty-One theme, the Chinese flag for Traditional Chinese language is wrong.

oh it's showing the Taiwan flag instead  - that's embarrassing for WHMCS and controversial! 🙄

you know it's worse than just China being wrong...

  • Arabic -> Argentina Flag (really? - just because Arabic starts with AR, the country code used is AR ??)
  • Catalan -> Andorra Flag (it's a different country (yeah I know Catalonia isn't an official country) - though at least physically closer than Argentina is to being an Arabic-speaking country)... appears not to be a Catalan flag option in the sprite file.
  • English -> Hard coded to use USA Flag in the template.... you can tweak it to show Australia/New Zealand flags etc, but the template would effectively prevent you from using the UK flag... viable ways around that would be to edit the template and remove that condition, or use another hook to change the css class to use the correct flag.

I can't help thinking there is a WHMCS programmer stuck in a basement somewhere in Houston that has never left the States - nobody at WHMCS internally or externally noticed this during testing ??? 🙄

8 hours ago, hkhost said:

Can someone explain how to change it?

quick fix would be to use a hook...

<?php

# Change Country Flags Footer Hook
# Written by brian!

function change_country_flags_hook($vars) {
	
	$activelocale = $vars['activeLocale'];
	if ($activelocale["language"] == "arabic") {
		$activelocale["countryCode"] = "EG";
	}
	elseif ($activelocale["language"] == "chinese") {
		$activelocale["countryCode"] = "CN";
	}
	elseif ($activelocale["language"] == "english") {
		//$activelocale["countryCode"] = "AU";
	}		
	return array("activeLocale" => $activelocale);
}
add_hook("ClientAreaPage", 1, "change_country_flags");

you might want to report it as a bug so that this gets updated for the next release.

Edited by brian!
Link to comment
Share on other sites

1 hour ago, brian! said:

oh it's showing the Taiwan flag instead  - that's embarrassing for WHMCS and controversial!

Yes! I don't know how many clients we lost because of this very sensitive issue.

1 hour ago, brian! said:

nobody at WHMCS internally or externally noticed this during testing ???

Exactly! I wonder what testing are they doing during the Beta Releases...

Anyway, thanks for the help, I will go ahead and report this bug.

Link to comment
Share on other sites

18 hours ago, hkhost said:

Yes! I don't know how many clients we lost because of this very sensitive issue.

I can well imagine how offensive some users will have found it to have that flag appearing representing China.

English shouldn't even be hardcoded in the template to default to the US flag - a value for English should be taken from the Default Country value in the localisation settings if it's UK, US, Canada, Australia, New Zealand etc - if it's not one of them, then I wouldn't object to it being automatically set to USA.

Link to comment
Share on other sites

9 minutes ago, hkhost said:

Except for the English language, all other flags can be changed using the language overrides, example:

have you tried that? I don't think it works - in fact, WHMCS has long seemingly ignored that value within the lang files for locales.

11 minutes ago, hkhost said:

They should offer a free year license for each bug reported...

with a bonus year when that bug gets fixed.

Link to comment
Share on other sites

31 minutes ago, brian! said:

have you tried that? I don't think it works - in fact, WHMCS has long seemingly ignored that value within the lang files for locales.

Yes, it is working, but to see the changes you need to clear the cache for language locales running the following query in the DB

delete from tbltransientdata where name = 'WHMCS\\Language\\ClientLanguageLocales';

 

Link to comment
Share on other sites

  • 4 months later...
On 7/04/2021 at 12:03 PM, brian! said:

I can well imagine how offensive some users will have found it to have that flag appearing representing China.

English shouldn't even be hardcoded in the template to default to the US flag - a value for English should be taken from the Default Country value in the localisation settings if it's UK, US, Canada, Australia, New Zealand etc - if it's not one of them, then I wouldn't object to it being automatically set to USA.

I just had a search here to help a friend! I assume people worked it out in the end! the value is "gb" 

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated