Browse Source

Switching strings to locale instead of having them hardcoded

Brendan Abolivier 8 years ago
parent
commit
e7a919c46c
2 changed files with 28 additions and 16 deletions
  1. 14
    16
      config.html
  2. 14
    0
      lang/en/auth_macaroons.php

+ 14
- 16
config.html View File

30
 	</tr>
30
 	</tr>
31
 	<tr class="required">
31
 	<tr class="required">
32
 		<td align="right">
32
 		<td align="right">
33
-			<label for="cookie_name">Cookie name</label>
33
+			<label for="cookie_name"><?php print_string('cookie_name_label', 'auth_macaroons'); ?></label>
34
 		</td>
34
 		</td>
35
 		<td>
35
 		<td>
36
 			<input name="cookie_name" id="cookie_name" type="text" size="50" value="<?php echo $config->cookie_name; ?>" required="true" />
36
 			<input name="cookie_name" id="cookie_name" type="text" size="50" value="<?php echo $config->cookie_name; ?>" required="true" />
37
 		</td>
37
 		</td>
38
-		<td>Name of the cookie your macaroon is located in.</td>
38
+		<td><?php print_string('cookie_name_help', 'auth_macaroons'); ?></td>
39
 	</tr>
39
 	</tr>
40
 	<tr class="required">
40
 	<tr class="required">
41
 		<td align="right">
41
 		<td align="right">
42
-			<label for="secret">Secret</label>
42
+			<label for="secret"><?php print_string('secret_label', 'auth_macaroons'); ?></label>
43
 		</td>
43
 		</td>
44
 		<td>
44
 		<td>
45
 			<input name="secret" id="secret" type="text" size="50" value="<?php echo $config->secret; ?>" />
45
 			<input name="secret" id="secret" type="text" size="50" value="<?php echo $config->secret; ?>" />
46
 		</td>
46
 		</td>
47
-		<td>The secret your macaroon was signed with</td>
47
+		<td><?php print_string('secret_help', 'auth_macaroons'); ?></td>
48
 	</tr>
48
 	</tr>
49
 	<tr class="required">
49
 	<tr class="required">
50
 		<td align="right">
50
 		<td align="right">
51
-			<label for="identifier_format">Identifier format</label>
51
+			<label for="identifier_format"><?php print_string('identifier_format_label', 'auth_macaroons'); ?></label>
52
 		</td>
52
 		</td>
53
 		<td>
53
 		<td>
54
 			<input name="identifier_format" id="identifier_format" type="text" size="50" value="<?php echo $config->identifier_format; ?>" required="true" />
54
 			<input name="identifier_format" id="identifier_format" type="text" size="50" value="<?php echo $config->identifier_format; ?>" required="true" />
55
 		</td>
55
 		</td>
56
-		<td>Your Macaroon's identifier format. Available placeholders are {{username}}, {{firstname}}, {{lastname}}. Elements must me delimited with semicolons (";").<br />
57
-eg: {{firstname}};{{lastname}}</td>
56
+		<td><?php print_string('identifier_format_help', 'auth_macaroons'); ?></td>
58
 	</tr>
57
 	</tr>
59
 	<tr class="required">
58
 	<tr class="required">
60
 		<td align="right">
59
 		<td align="right">
61
-			<label for="email_config">E-mail template</label>
60
+			<label for="email_config"><?php print_string('email_config_label', 'auth_macaroons'); ?></label>
62
 		</td>
61
 		</td>
63
 		<td>
62
 		<td>
64
 			<input name="email_config" id="email_config" type="text" size="50" value="<?php echo $config->email_config; ?>" required="true" />
63
 			<input name="email_config" id="email_config" type="text" size="50" value="<?php echo $config->email_config; ?>" required="true" />
65
 		</td>
64
 		</td>
66
-		<td>Template for emails. Available placeholders are {{firstname}} and {{lastname}}.<br />
67
-eg: {{firstname}}.{{lastname}}@company.tld</td>
65
+		<td><?php print_string('email_config_help', 'auth_macaroons'); ?></td>
68
 	</tr>
66
 	</tr>
69
 	<tr>
67
 	<tr>
70
 		<td align="right">
68
 		<td align="right">
71
-			<label for="caveat1_condition">First caveat condition</label>
69
+			<label for="caveat1_condition"><?php print_string('caveat1_condition_label', 'auth_macaroons'); ?></label>
72
 		</td>
70
 		</td>
73
 		<td>
71
 		<td>
74
 			<input name="caveat1_condition" id="caveat1_condition" type="text" size="50" value="<?php echo $config->caveat1_condition; ?>" />
72
 			<input name="caveat1_condition" id="caveat1_condition" type="text" size="50" value="<?php echo $config->caveat1_condition; ?>" />
75
 		</td>
73
 		</td>
76
-		<td>The condition in your macaroon's first caveat (optional)</td>
74
+		<td><?php print_string('caveat1_condition_help', 'auth_macaroons'); ?></td>
77
 	</tr>
75
 	</tr>
78
 	<tr>
76
 	<tr>
79
 		<td align="right">
77
 		<td align="right">
80
-			<label for="caveat2_condition">Second caveat condition</label>
78
+			<label for="caveat2_condition"><?php print_string('caveat2_condition_label', 'auth_macaroons'); ?></label>
81
 		</td>
79
 		</td>
82
 		<td>
80
 		<td>
83
 			<input name="caveat2_condition" id="caveat2_condition" type="text" size="50" value="<?php echo $config->caveat2_condition; ?>" />
81
 			<input name="caveat2_condition" id="caveat2_condition" type="text" size="50" value="<?php echo $config->caveat2_condition; ?>" />
84
 		</td>
82
 		</td>
85
-		<td>The condition in your macaroon's second caveat (optional)</td>
83
+		<td><?php print_string('caveat2_condition_help', 'auth_macaroons'); ?></td>
86
 	</tr>
84
 	</tr>
87
 	<tr>
85
 	<tr>
88
 		<td align="right">
86
 		<td align="right">
89
-			<label for="caveat3_condition">Third caveat condition</label>
87
+			<label for="caveat3_condition"><?php print_string('caveat3_condition_label', 'auth_macaroons'); ?></label>
90
 		</td>
88
 		</td>
91
 		<td>
89
 		<td>
92
 			<input name="caveat3_condition" id="caveat3_condition" type="text" size="50" value="<?php echo $config->caveat3_condition; ?>" />
90
 			<input name="caveat3_condition" id="caveat3_condition" type="text" size="50" value="<?php echo $config->caveat3_condition; ?>" />
93
 		</td>
91
 		</td>
94
-		<td>The condition in your macaroon's third caveat (optional)</td>
92
+		<td><?php print_string('caveat3_condition_help', 'auth_macaroons'); ?></td>
95
 	</tr>
93
 	</tr>
96
 </table>
94
 </table>

+ 14
- 0
lang/en/auth_macaroons.php View File

24
 
24
 
25
 $string['auth_macaroonsdescription'] = 'Macaroons usage for authentication';
25
 $string['auth_macaroonsdescription'] = 'Macaroons usage for authentication';
26
 $string['pluginname'] = 'Macaroons';
26
 $string['pluginname'] = 'Macaroons';
27
+$string['cookie_name_label'] = 'Cookie name';
28
+$string['cookie_name_help'] = 'Name of the cookie your macaroon is located in.';
29
+$string['secret_label'] = 'Secret';
30
+$string['secret_help'] = 'The secret your macaroon was signed with.';
31
+$string['identifier_format_label'] = 'Identifier format';
32
+$string['identifier_format_help'] = 'Your Macaroon\'s identifier format. Available placeholders are {{username}}, {{firstname}}, {{lastname}}. Elements must me delimited with semicolons (";").<br />eg: {{firstname}};{{lastname}}';
33
+$string['email_config_label'] = 'E-mail template';
34
+$string['email_config_help'] = 'Template for emails. Available placeholders are {{firstname}} and {{lastname}}.<br />eg: {{firstname}}.{{lastname}}@company.tld';
35
+$string['caveat1_condition_label'] = 'First caveat condition (optional)';
36
+$string['caveat1_condition_help'] = 'The condition in your macaroon\'s first caveat.';
37
+$string['caveat2_condition_label'] = 'Second caveat condition (optional)';
38
+$string['caveat2_condition_help'] = 'The condition in your macaroon\'s second caveat';
39
+$string['caveat3_condition_label'] = 'Third caveat condition (optional)';
40
+$string['caveat3_condition_help'] = 'The condition in your macaroon\'s third caveat';