Skip to content

Commit 2d029c5

Browse files
committed
remove hardcoded strings
1 parent de92ffd commit 2d029c5

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

block_helloworld.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ public function get_content()
4646
return $this->content;
4747
}
4848
$this->content = new stdClass;
49-
$this->content->text = $this->config->text ? $this->config->text : '<h4>Hello world default text</h4>';
50-
$this->content->footer = '<p><i>hello world footer</i></p>';
49+
$this->content->text = $this->config->text ? $this->config->text : '<h4>'.get_string('helloworld:defaultblocktext','block_helloworld').'</h4>';
50+
$this->content->footer = '<p><i>'.get_string('helloworld:defaultblockfooter','block_helloworld').'</i></p>';
5151
return $this->content;
5252
}
5353

edit_form.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ protected function specific_definition($mform)
3333

3434
// A sample string variable with a default value.
3535
$mform->addElement('text', 'config_text', get_string('helloworld:contentinputlabel', 'block_helloworld'));
36-
$mform->setDefault('config_text', 'default value');
36+
$mform->setDefault('config_text', get_string('helloworld:typeatext', 'block_helloworld'));
3737
$mform->setType('config_text', PARAM_RAW);
3838

3939
$mform->addElement('text', 'config_title', get_string('helloworld:titleinputlabel', 'block_helloworld'));
40-
$mform->setDefault('config_title', 'default value');
40+
$mform->setDefault('config_title', get_string('helloworld:typeatext', 'block_helloworld'));
4141
$mform->setType('config_title', PARAM_TEXT);
4242

4343
}

lang/en/block_helloworld.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@
2727
$string['helloworld:contentinputlabel'] = 'Hello world block content';
2828
$string['helloworld:titleinputlabel'] = 'Hello world block title';
2929
$string['helloworld:defaultblocktitle'] = 'Hello world default title';
30+
$string['helloworld:defaultblocktext'] = 'Hello world default text';
31+
$string['helloworld:defaultblockfooter'] = 'Hello world footer';
3032
$string['helloworld:headerconfig'] = 'Hello world global configuration';
3133
$string['helloworld:descconfig'] = 'Here is the global configuration of the hello world block';
3234
$string['helloworld:labelcoloredtext'] = 'Colored text ?';
33-
$string['helloworld:desccoloredtext'] = 'This will enabled a colored text for the block';
35+
$string['helloworld:desccoloredtext'] = 'This will enabled a colored text for the block';
36+
$string['helloworld:typeatext'] = 'Type a text';

lang/fr/block_helloworld.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,10 @@
2727
$string['helloworld:contentinputlabel'] = 'Contenu du bloc world';
2828
$string['helloworld:titleinputlabel'] = 'Titre du bloc world';
2929
$string['helloworld:defaultblocktitle'] = 'Titre par défaut du bloc world';
30+
$string['helloworld:defaultblocktext'] = 'Hello world texte par défaut';
31+
$string['helloworld:defaultblockfooter'] = 'Hello world footer';
3032
$string['helloworld:headerconfig'] = 'Configuration globale du bloc hello world';
3133
$string['helloworld:descconfig'] = 'Configuration globale du bloc hello world';
3234
$string['helloworld:labelcoloredtext'] = 'Texte coloré ?';
3335
$string['helloworld:desccoloredtext'] = 'Active un texte coloré pour le bloc hello world';
34-
36+
$string['helloworld:typeatext'] = 'Saisir un texte';

0 commit comments

Comments
 (0)