Jump to content
  • 0

Custom additional language file for server modules?


bendrop

Question

Can this be done?

I see in the docs how to add additional language strings for add on modules (just make a lang folder), but nothing listed for server modules.

I need to use some new strings in the _ClientArea function and would rather not hard code.

Cheers!

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0
  • WHMCS Staff

Hi @bendrop,

Although not officially supported at this time, perhaps you could create your own lang/ directory and include it?

Example:

Lang file:

<?php

$_MODULELANG['helloworld'] = 'Hello World!';

Module:

function provisioningmodule_ClientArea() {
    require_once(__DIR__ . '/lang/myCustomLangFile.php');

    return $_MODULELANG['helloworld'];
}

Naturally, this advice is being provided personally by me and is provided as a courtesy. This example is provided "as-is" with no guarantee or warranty. The code has not been tested and may need slightly tweaking.

Hopefully, this helps you achieve your requirements!

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
Answer this question...

×   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