Create a language file helloworld.php at "admin\language\en-gb\extension\module\", here en-Gb is the English language folder but if your store is multi-language then you have to create helloworld.php in another folder also like at "admin\language\OTHER_LANGUAGE_FOLDER\extension\module\".
Now in helloworld.php, you will define variable that holds the text for that language. Starting defining a variable with $_['YOUR_VARIABLE_NAME'] and assign the text for that language.
$_['language_variable'] = 'Text for this language';
Now in the controller, you can do the following:
$this->load->language('extension/module/helloworld'); $data['view_variable'] = $this->language->get('language_variable');
In the view, you will show the text as:
In this way, In the view, you will be able to access the text from the language that the controller file stored as a PHP variable.
For our HelloWorld module of OpenCart module development, the following are the needed text and I have assigned to those variables.