Jump to content
bagfuloz

How to add new lang extension in language dropdown

Recommended Posts

Hello everyone, Hope you guys doing good. 

I came up with something new :17_heart_eyes: or maybe old :D .  I want to implement whmcs lang from English to Hindi. for my indian customers.  So i will convert each and every English Words to hindi words.  Already 50% done.  but please anyone tell me how to Add a extension ex- Hindi in header dropdown menu and target it to my Hindi lang File. 

Check the screenshot for more info,

 

 

So i have added a Hindi.php file in Lang directory but in dropdown its showing English 2 times.

Sorry for my Bad English.  Here is all. 

Thanks

Bagful International

lang-idea.JPG

Share this post


Link to post
Share on other sites

Yes i did same.   i have created  one file name Hindi.php

 

Right now this file included english.php file data,  but in dropdown, there is showing two English lang selections.  

 

Thanks

Share this post


Link to post
Share on other sites

one of the WHMCS guys, e.g @WHMCS John, @WHMCS Nate etc, may want to comment on this, but i'm not convinced the documentation on this is 100% correct (yes I was shocked too! :P)

Quote
  1. Begin by opening an existing language file, for example lang/english.php
  2. Save this file with a new name. The name you choose will be shown in the language selection dropdown menu inside WHMCS.

I don't think that's true for v6 or later that the language name is being taken from the filename - it's certainly true for v5.3.14 as i've just tested it, but failed on v6.2.2...

PpnMxVh.png

in v7.2.3, i'm seeing the same as @bagfuloz.

Quote

Each language file in WHMCS requires a locale to be defined in the following format:


$_LANG['locale'] = "en_GB";

The above defines that the language is English (en), and the region is Great Britain (GB).

The locale information is used by WHMCS to localise and display the language name localised to the native language within the WHMCS client area.

Failure to provide a valid locale will prevent the language file from showing up as available for use within WHMCS.

i'm not sure if any of that is valid in v7 - i've set the above variable to fr_FR in hindi.php and it's still showing en_GB in $locales (which is the array used for the localised name shown in the language menu) - on multiple browsers, with cleared browser and template caches... even if you totally remove the line from the file, the language file still works (contrary to what it says should happen in the docs)... it looks to me like $locales is hard-coded and not taking the locales from the language files. :?:

as also specified in the docs, both files are utf-8 encoded without BOM (though even with BOM it still works).

the only way I could think to fix this is to use a modified version of the hook I posted in the thread below...

<?php

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

function locales_hook($vars) {
	$mylocal = $vars['locales'];
	foreach ($mylocal as $key => $value) {
		if ($value["language"] == "hindi") {
			$mylocal[$key]["localisedName"] = "हिंदी";
		}
	}
	$activelocale = $vars['activeLocale'];
		if ($activelocale["language"] == "hindi") {
			$activelocale["localisedName"] = "हिंदी";
		}
   
	return array("locales" => $mylocal, "activeLocale" => $activelocale);
}
add_hook("ClientAreaPage", 1, "locales_hook");
?>

xT0CZq8.png

either the documentation is wrong, or this has been a bug since v6... or i'm missing something obvious as I assume users shouldn't need to use a hook to do something like this.. (though these days, any excuse WHMCS can find to require hooks to be used for the most trivial of things is seemingly enabled by default!) 9_9

Share this post


Link to post
Share on other sites
2 hours ago, brian! said:

I assume users shouldn't need to use a hook to do something like this.. (though these days, any excuse WHMCS can find to require hooks to be used for the most trivial of things is seemingly enabled by default!) 9_9

All roads do seem to be leading to that. I suppose I'd better learn how to use them better. ;)

Edited by bear

Share this post


Link to post
Share on other sites
2 hours ago, bagfuloz said:

i have created  one file name Hindi.php

it will have to be called hindi.php (lowercase - the docs seem to be correct on that part at least!)

Share this post


Link to post
Share on other sites

Whooo,  That's why i said, we are missing someone on this thread, and that was brian.

Yes, that provided doc, isnt much usefull.  HOPE, WHMCS guys will update it. 

 Its working buddy,  now i can continue my WHMCS hindi language journey.

Thanks  B & B (Bear & Brian)   :16_relieved:

Share this post


Link to post
Share on other sites

Guys,  there is one more issue. 

Hindi lang is selected from dropdown menu, and its working as should be. but But selected lang name still showing - English

check screenshot for more info.

Thanks

Madan Malhotra

screen-lang02.JPG

Edited by bagfuloz
Forgot Name

Share this post


Link to post
Share on other sites
5 hours ago, bagfuloz said:

Guys,  there is one more issue. 

take a look at the hook, I updated it yesterday when the same thing occurred to me... if you try the above hook again, it should work fine. :idea:

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Similar Content

    • By ModulesGarden
      1. OpenStack VPS For WHMCS 1.7.0 
      There are at least several essential improvements you may expect from our latest release, and none of them has made it on this list without a good reason. 
      For example, thanks to the neatly secured integration with OpenStack Rocky, you may rest assured that your clients will be always supplied with virtual server solutions meeting the most recent technological standards. 
      The "Scheduled Backups" functionality, in turn, allows your audience to create backups of their servers not only manually, but now also in a fully automated manner, through specifying desired backup intervals. And last but not least, whenever needed, you will be empowered to freely edit and apply custom rules for VPS security groups assigned to virtual machines using a configuration file.   
      Interested to know what further perks are to be derived from this spanking new update? The module’s official changelog is open for investigation!
       
      2. EasyDCIM v1.5.3 Released 
      Being in charge of multiple independent data center locations is a tough challenge, but why give yourself even more job when you have the aid of such go-ahead tools like EasyDCIM at your close disposal? 
      Upon the latest 1.5.3 update, you can make use of remote applications that are to be installed on your owned locations, and assign various tasks between those facilities from a single pane of glass – your EasyDCIM. Launching an operating system on a server placed on the other side of the world, and in a completely different network? Nothing easier. 
      Gain a complete picture of all transformations on the EasyDCIM release Blog and head over to the official YouTube channel for a series of short tutorial videos as well! 
       
      Need Custom Software Development For Your Business?

      Get Your Free Quote Now!


      Specially for you we will adapt an application and its design to your own needs, create a new module or even a completely new system built from scratch!
    • By ModulesGarden
      1. Today we would like to offer you an exclusive insight into the high-powered DNS Manager For WHMCS 2.10.0 update released only recently.  
      The module had its extensive scope of features scaled up even further, owing to which you can now: 
      Let your clients perform and handle backups of DNS zones on their own whenever needed Define if customers shall be given full control over DNS zones, rDNS zones, or both Enable DNSSEC validation for the newly supported Simple DNS Plus V8 servers type If you would like to gain a broader perspective on those, as well as other newly available possibilities, you may do so by visiting the module’s changelog.
      Interested in a discount? Send us a note and let’s talk!
       
      2. See what else we released this week:
      WordPress Manager For WHMCS - v1.2.1 Multibrand For WHMCS - v2.2.2 Unban Center For WHMCS - v2.1.1 DirectAdmin Extended For WHMCS - v3.0.1  

      Need Custom Software Development For Your Business?
      Get Your Free Quote Now!
      Specially for you we will adapt an application and its design to your own needs, create a new module or even a completely new system built from scratch!
    • By ModulesGarden
      1. Cyber Monday Promotion
      Yesterday marked the closure of our four-day long Cyber Monday shopping spree which means that our special deal is technically no longer viable. 
      Were you very much intent on purchasing a particular open source product for -25% of the price, but simply couldn’t get there on time?  
      Let’s talk and see what can be done about it! 
       
      2. The Quotes Automation For WHMCS 2.0 module has been vastly modernized to facilitate your ordering processes much further. 
      For example, you will not have to leave the addon area anymore whenever wanting to create or edit a template, adjust template items, or apply a desired template to a new quote. Additionally, in an equally convenient manner you may also connect any quote item with a chosen WHMCS product, addon, or domain on a quote page directly. Apart from greater functionality, the product boasts of an overhauled design and a brand-new code behind it. Be sure to consult the changelog for other improvements as well. 
      Learn all about Quotes Automation For WHMCS 2.0!
       
      3. EasyDCIM & MetricsCube for -25% less! 
      The clock is ticking, counting down the time left to acquire any of these great tools at a shapely 25% discount! To tap into this time-sensitive occasion, choose the pricing plan of EasyDCIM or MetricsCube you wish to go along with, and enter the "BLACKWEEK" promo code while at the checkout. Once correctly applied, it will enable you to save 25% on your monthly subscription throughout up to three months. Hurry up before the end of 30th November! 
      There is not a single minute to waste. View the available pricing models of MetricsCube and EasyDCIM now! 
       
      Need Custom Software Development For Your Business?
      Get Your Free Quote Now!
      Specially for you we will adapt an application and its design to your own needs, create a new module or even a completely new system built from scratch!
       
    • By WGS
      50% OFF sale at WHMCS Global Services will end today, don't miss the chance to avail this biggest discount today.
      Use coupon code: BLACK50
      Shop at: http://whmcsglobalservices.com
    • By WGS
      A new update of our Vmware module is released. the new 2.0.4 version is available to download. 
      Whats New!
      New Feature:
      Now you can choose network adapter on which you want to create the new VM. Bugs Fixed:
      Delete IP from IP pool - Fixed - You can now easily delete IP's from IP Pool  
      Checkout the module at: https://whmcsglobalservices.com/vmware-whmcs-module/
  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines