Jump to content

Change Language names into Country names


criat

Recommended Posts

Hello,

 

I would like to change language names in WHMCS, for example:

 

[table=width: 500, class: outer_border, align: left]

[tr]

[td]Original[/td]

[td]Desired[/td]

[/tr]

[tr]

[td]Portuguese-br[/td]

[td]Brasil[/td]

[/tr]

[tr]

[td]Portuguese-pt[/td]

[td]Portugal[/td]

[/tr]

[tr]

[td]French[/td]

[td]Canada (Français)[/td]

[/tr]

[tr]

[td]English-Canada (A custom language I'm gonna do)[/td]

[td]Canada (English)[/td]

[/tr]

[tr]

[td]English[/td]

[td]United States[/td]

[/tr]

[tr]

[td]

And so on, with all language files

[/td]

[td][/td]

[/tr]

 

[/table]

 

Is it possible to change Currency when changing language too?

 

Thanks

Link to comment
Share on other sites

I would like to change language names in WHMCS, for example:

to rename a language, you rename it's filename in the "lang" directory - keep the first letter lowercase, but you can use capitals for (Français) and (English) etc - assuming you can have ç in a filename.

 

Is it possible to change Currency when changing language too?

not easily using the default dropdown as it's hardcoded and can't be modified - but there are a number of ways to choose language and currency at the same time...

 

either by using links - http://docs.whmcs.com/Linking_to_WHMCS

 

or by using flag images to select currecncy and/or language -

http://forum.whmcs.com/showthread.php?77818-Currency-selector&p=334110

Link to comment
Share on other sites

nice spot - this must be hardcoded into WHMCS then.

 

so solutions would be to either:

 

  1. continue to use hyphens for filenames.
  2. replace {$setlanguage} with your own dropdown where you would be able to display your languages with spaces if required, and possibly link a currency to the language too.
  3. use flag images which, as above, can be linked to language and/or currency.

Link to comment
Share on other sites

  • 6 years later...
On 10/31/2013 at 12:15 PM, brian! said:

to rename a language, you rename it's filename in the "lang" directory - keep the first letter lowercase, but you can use capitals for (Français) and (English) etc - assuming you can have ç in a filename.

Thank you Brian. In the current version, the technique of renaming the filename seems no longer to affect the language's name in the pulldown menu. Is there a new technique to rename the language and have it appear as such in the language menu?

Link to comment
Share on other sites

On 16/07/2020 at 17:02, AllanT said:

Thank you Brian. In the current version, the technique of renaming the filename seems no longer to affect the language's name in the pulldown menu. Is there a new technique to rename the language and have it appear as such in the language menu?

I think that stopped working about 3 years ago - I posted an action hook to do this in the thread below (create new .php file in /hooks/includes, paste code into it, save)...

<?php

/**
* Change Hindi Language Localised Name
* @author brian!
*/

function locales_hook($vars) {
	$mylocal = $vars['locales'];
	foreach ($mylocal as $key => $value) {
		if ($value["language"] == "english") {
			$mylocal[$key]["localisedName"] = "USA";
		}
	}
	$activelocale = $vars['activeLocale'];
		if ($activelocale["language"] == "english") {
			$activelocale["localisedName"] = "USA";
		}

	return array("locales" => $mylocal, "activeLocale" => $activelocale);
}
add_hook("ClientAreaPage", 1, "locales_hook");

NyrqKwa.png

the obvious problem you may run into with this idea is that multiple countries use the same language, so changing "English" to USA is fine, but Britons, Australians, Canadians etc will use English too; the same would apply to Spanish with the Latin American countries.

Link to comment
Share on other sites

On 7/21/2020 at 11:23 AM, brian! said:

I think that stopped working about 3 years ago - I posted an action hook to do this in the thread below (create new .php file in /hooks/includes, paste code into it, save)...


<?php

/**
* Change Hindi Language Localised Name
* @author brian!
*/

function locales_hook($vars) {
	$mylocal = $vars['locales'];
	foreach ($mylocal as $key => $value) {
		if ($value["language"] == "english") {
			$mylocal[$key]["localisedName"] = "USA";
		}
	}
	$activelocale = $vars['activeLocale'];
		if ($activelocale["language"] == "english") {
			$activelocale["localisedName"] = "USA";
		}

	return array("locales" => $mylocal, "activeLocale" => $activelocale);
}
add_hook("ClientAreaPage", 1, "locales_hook");

NyrqKwa.png

the obvious problem you may run into with this idea is that multiple countries use the same language, so changing "English" to USA is fine, but Britons, Australians, Canadians etc will use English too; the same would apply to Spanish with the Latin American countries.

Thank you Brian. I will certainly try what you are suggesting in /hooks/includes
In my case, I don't want to rename the language with a country name,. I just correct the language name to its proper name, which is the topic of a few of my books: The Castilian Conspiracy, La conspiración del castellano, The Royal Spanish Coverup, El encubrimiento de la Real Academia. Currently, there are six official Spanish languages, i.e. six official languages in Spain, excluding unofficial languages and dialects. Each official Spanish language has its own name, and none of them should be called "Spanish" ("español") since they are all Spanish.  Thank you very much.

Link to comment
Share on other sites

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