criat Posted October 30, 2013 Share Posted October 30, 2013 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 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted October 31, 2013 Share Posted October 31, 2013 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 0 Quote Link to comment Share on other sites More sharing options...
criat Posted November 1, 2013 Author Share Posted November 1, 2013 Brian, do you know how can I edit the output for {$setlanguage}? It doesn't allows space between words 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted November 1, 2013 Share Posted November 1, 2013 nice spot - this must be hardcoded into WHMCS then. so solutions would be to either: continue to use hyphens for filenames. 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. use flag images which, as above, can be linked to language and/or currency. 0 Quote Link to comment Share on other sites More sharing options...
AllanT Posted July 16, 2020 Share Posted July 16, 2020 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? 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 21, 2020 Share Posted July 21, 2020 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"); 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. 0 Quote Link to comment Share on other sites More sharing options...
AllanT Posted July 23, 2020 Share Posted July 23, 2020 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"); 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. 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 24, 2020 Share Posted July 24, 2020 On 23/07/2020 at 01:48, AllanT said: 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 interesting - just read your summary article on Medium. 0 Quote Link to comment Share on other sites More sharing options...
AllanT Posted July 24, 2020 Share Posted July 24, 2020 8 hours ago, brian! said: interesting - just read your summary article on Medium. Brian, your code worked perfectly as you'll see in the image. I am only displaying English and castellano (Castilian). Thank you again Brian! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.