Jump to content

How to add translations to a module?


Recommended Posts

I don't quite understand how to add translations to a module, and I am hoping you can shed some light on my confusion, for I may have misunderstood how it works.
I read the information about overriding language at https://developers.whmcs.com/languages/overrides/, but I struggle with understanding the following:

- when are the files in this override folder executed, is it run whenever you need to add new translations, or does it just sit there and is used on runtime?
- the files do not seem to be specific for a given module (in example: whmcs/lang/overrides/english.php), so does that mean someone tries to install my module not realizing this, may end removing other module's translation when they replace the entire file?

- in case there exists override files in "whmcs/lang/overrides/", is a user (owner/maintainer of any given WHMCS platform)  expected to manually append the translations to the files that have the same name?

In my case I already have a module (payment gateway) and would like to add translations to it.
The WHMCS version is 8 and above.

 

Any help is appreciated, thank you.

Link to comment
Share on other sites

For WHMCS modules (addon or gateway), you should not use the whmcs/lang/overrides/ folder. That folder is meant only for global WHMCS string overrides and must be manually maintained by the site owner, adding or replacing files there can accidentally overwrite other modules’ translations.

Instead, each module should provide its own /lang/ folder inside the module directory: More details are here: WHMCS Addon Module Multi-Language

Link to comment
Share on other sites

Thanks for confirming the first part.
As for the second, given the link you shared, which seems to be for Module Addons, I don't know if that is compatible with payment gateways, at the very least I did try it with no success.
Am I missing something?
Could it be that even the native (third party) payment gateways are not translated or just use the global files? 
I can't look it up since everything is hashed for ion-cube.

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