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. MetricsCube – business analysis tool with full WHMCS integration
      To stand a chance in the competition-ruled web hosting industry, you need clever tactics. It has always been obvious, but not always as achievable as it is now, thanks to the recent launch of MetricsCube.
      40 business reports on most often analyzed factors like billing, churn, MRR, ARPU, LTV? Intelligent dashboard with dynamic statistics? Fully-fledged WHMCS integration and many more on the agenda? MetricsCube may look and feel like a fairly simple tool, but it is capable of performing even most complex data analysis operations with minimum involvement on your part! 
      What is there to wait for? Claim the one-off discount exclusively from ModulesGarden and spend 20% less on MetricsCube for entire 3 months!
      Code: WHMCS20%_MC 
      Delve into the world of easy metrics and flexible reports with MetricsCube!
       
      2. Zendesk For WHMCS 2.1.0.
      This extra handy customer service tool just had the list of its utilities fairly expanded with the much awaited WHMCS "Contact Us" feature. What it does is to basically forward all tickets submitted by visitors to the previously set Zendesk department directly. 
      It really is as easy and convenient as it sounds. See for yourself, giving our updated changelog a closer study!
      Find out more about Zendesk For WHMCS 2.1.0!
       
      3. EURid Registrar For WHMCS 1.2.0
      Curious to know what this past week brought to EURid Registrar For WHMCS? A wider set of admin utilities, that is for certain! 
      Among other things, you will be now authorized to request the deletion of your clients’ domains at any moment, or configure the module to let expired domains be removed automatically after specified number of days. 
      Willing to know more? 
      Learn more about EURid Registrar For WHMCS 1.2.0!
       
      4. Since last week we have also released:
      Product Linker For WHMCS - 1.3.7 Plesk Extended For WHMCS - 3.0.4 Quotes Automation For WHMCS - 1.2.8
      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 wp4all
      Hi @ all,
      got some problems with modifying the configuredomains.tpl
      This is what I have at the moment :

      This is what I would like to have :

       
      That's the part that drives me to despair :
      {foreach key=domainfieldname item=domainfield from=$domain.fields} <div class="form-group"> <label class="{$responsio.classes.col}-3 {$responsio.classes.label} control-label">{$domainfieldname}</label> <div class="{$responsio.classes.col}-8"> {if $domainfield.type == "tickbox"}<div class="checkbox {$responsio.classes.checkbox}">{$domainfield}</div>{else}{$domainfield|replace:"type=\"text\"":"type=\"text\" class=\"form-control `$responsio.classes.input`\""|replace:"type=\"password\"":"type=\"password\" class=\"form-control `$responsio.classes.input`\""|replace:"<select":"<select class=\"form-control `$responsio.classes.input`\""|replace:"<textarea":"<textarea class=\"form-control `$responsio.classes.input`\""|replace:"style=\"width:90%;\"":""}{/if} </div> </div>{/foreach} Maybe someone has an idea how I could solve it .
      Thanks and best regards
      Christian
    • By ModulesGarden
      1. MetricsCube with WHMCS synchronization
       
      Always thought that data mining and in-depth reports analysis are reserved for big enterprises only? Or that such a complex process will certainly require from the person involved a broad know-how and technical expertise? MetricsCube will prove you wrong!
      With just a few simple clicks you will connect with the WHMCS platform, dissect your web hosting venture into tiny parts, and generate up to 40 most popular reports for subscription-based businesses. But still the most compelling thing about MetricsCube is that it is perfect for companies of all sizes. Also, getting access to all those detailed statistics is easy as pie, and takes only a few moments! 
      Redefine your approach to doing business here and now with MetricsCube!
       
      2. Hosting Quota Notifications For WHMCS 2.0.
      As part of our weekly release we reconstructed the entire code behind the module from the ground up to achieve a smoother experience with this tool. Also, owing to the 2.0 update, you will be able to: 

      Automatically suspend & terminate your clients' products whenever a predefined resource usage has been exceeded. Automatically create a new support ticket informing the client about resource overage.


      For a more detailed description of the module's functionalities, be sure to head over to its changelog page.  Learn all about Hosting Quota Notifications For WHMCS 2.0!
       
      3. Since last week we have also released:

      ModulesGarden Widget For WHMCS - 1.1.0 DirectAdmin Extended For WHMCS - 2.2.3 Emoji Picker For WHMCS - 1.1.0 Stripe SEPA Payments For WHMCS - 1.0.2 Domain Allocator For WHMCS - 1.0.3 Domains Reseller For WHMCS - 1.6.12


      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 So, who am I ?
      Hello 😊
      I need to merge two WHMCS, I need to import clients, invoices, domains, services... and all from one database to another.
      While I was searching for solution I found ImportAssist ( https://marketplace.whmcs.com/product/46 ) that is developed by WHCMS but reviews are quite confusing, has anyone here ever tried this addon or any other that woks just fine and I won't lose any information during import process ?
       
      Any suggestions would be much appreciated 😊
    • By ModulesGarden
      1. Having multiple brands under your attentive care may feel at times like a cumbersome duty you would rather delegate to someone else. But no such bleak thought will ever cross your mind when you make the manifold utilities of our renowned Multibrand For WHMCS module a part of your everyday routine. 
      Additionally, we have just released a bulky 2.2.0 update of the tool so as to raise the suite of offered possibilities a level up. As a result, from this moment on you will be able to look up the desired branded invoice using the WHMCS ″Quick Search″ function, send blind carbon copies as well as carbon copies to the address specified in the branded email template, and let the ″Billable Items″ to be branded together with the invoices generated from them. 
      While we could shed more light on every single opportunity now ready for the taking, we simply do not want to deprive you of all the fun. Make your way to the module's changelog and rekindle your passion for multibranding craft! 
      Learn all about Multibrand For WHMCS 2.2.0!
       
      2. Bolstered with an array of various refinements, our Domain & Email Forwarding For WHMCS 1.3.0 module is worth of your attention now more than ever. 
      You may be particularly keen on noticing that your clients gained the means to adjust key attributes of domain and email forwarders via API, SSL mode for DirectAdmin server is now perfectly supported, and the ″Port″ field can now contain custom values. 
      We will not be taking any more of your precious time by enumerating all the fresh developments, while you can easily view them on our website! 
      Learn all about Domain & Email Forwarding For WHMCS 1.3.0!
       
      3. Customers who stand by you through thick and thin is the best form of gratification a company could ever wish for. And in this respect we are truly blessed, as recently the number of our own loyal supporters has skyrocketed to 20,000! 
      Today we would love to extend our appreciation to every single one of you, in whatever corner of the universe you are right now, with the first-class promotion that goes far beyond the mundane.
      Welcome with open arms the superb 33% discount compatible with the annual license of our products, and the no less attractive 11% promo code applying to open source software. Cannot decide which one to choose? Why not have both! 
      Make off with as many deals as you want!
       
      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!
  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

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