Project

General

Profile

« Previous | Next » 

Revision 901

Added by Matthias almost 16 years ago

made news Modul multilingual, see ticket #676 (some additional translations are needed)

View differences:

trunk/CHANGELOG
11 11
! = Update/Change
12 12

  
13 13
------------------------------------- 2.8.0 -------------------------------------
14
04-Jan-2009 Matthias Gallas
15
#	made news Modul multilingual, see ticket #676 (some additional translations are needed)
14 16
03-Jan-2009 Matthias Gallas
15
#	fixed bug in view.php of news module (ticket 676 Thanks to susigross)
17
#	fixed bug in view.php of news module (ticket #676 Thanks to susigross)
16 18
#	fixed another bug in view.php of news modul introduced in changeset [892]
17 19
30-Dec-2008 Matthias Gallas
18 20
+	added default new language variables to all language files
trunk/wb/modules/news/comment_page.php
41 41
	echo "\n</style>\n";
42 42
}
43 43

  
44
// check if module language file exists for the language set by the user (e.g. DE, EN)
45
if(!file_exists(WB_PATH .'/modules/news/languages/'.LANGUAGE .'.php')) {
46
	// no module language file exists for the language set by the user, include default module language file EN.php
47
	require_once(WB_PATH .'/modules/news/languages/EN.php');
48
} else {
49
	// a module language file exists for the language defined by the user, load it
50
	require_once(WB_PATH .'/modules/news/languages/'.LANGUAGE .'.php');
51
}
52

  
44 53
require_once(WB_PATH.'/include/captcha/captcha.php');
45 54

  
46 55
// Get comments page template details from db
......
52 61
	$settings = $query_settings->fetchRow();
53 62

  
54 63
	// Print comments page
55
	echo str_replace('[POST_TITLE]', POST_TITLE, ($settings['comments_page']));
64
	$vars = array('[POST_TITLE]','[TEXT_COMMENT]');
65
	$values = array(POST_TITLE, $MOD_NEWS['TEXT_COMMENT']);
66
	echo str_replace($vars, $values, ($settings['comments_page']));
56 67
	?>
57 68
	<form name="comment" action="<?php echo WB_URL.'/modules/news/submit_comment.php?page_id='.PAGE_ID.'&amp;section_id='.SECTION_ID.'&amp;post_id='.POST_ID; ?>" method="post">
58 69
	<?php if(ENABLED_ASP) { // add some honeypot-fields
......
109 120
	<?php
110 121
	}
111 122
	?>
112
	<input type="submit" name="submit" value="<?php echo $TEXT['ADD']; ?> <?php echo $TEXT['COMMENT']; ?>" />
123
	<input type="submit" name="submit" value="<?php echo $MOD_NEWS['TEXT_ADD_COMMENT']; ?>" />
113 124
	</form>	
114 125
	<?php
115 126
}
116 127

  
117
?>
128
?>
trunk/wb/modules/news/view.php
33 33
   echo "\n</style>\n";
34 34
} 
35 35

  
36
// check if module language file exists for the language set by the user (e.g. DE, EN)
37
if(!file_exists(WB_PATH .'/modules/news/languages/'.LANGUAGE .'.php')) {
38
	// no module language file exists for the language set by the user, include default module language file EN.php
39
	require_once(WB_PATH .'/modules/news/languages/EN.php');
40
} else {
41
	// a module language file exists for the language defined by the user, load it
42
	require_once(WB_PATH .'/modules/news/languages/'.LANGUAGE .'.php');
43
}
44

  
36 45
//overwrite php.ini on Apache servers for valid SESSION ID Separator
37 46
if(function_exists('ini_set')) {
38 47
	ini_set('arg_separator.output', '&amp;');
......
214 223
					if($post_long_len < 9) {
215 224
						$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, $publ_date, $publ_time, $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email'], '');
216 225
					} else {
217
						$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, $publ_date, $publ_time, $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email'], $TEXT['READ_MORE']);
226
						$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, $publ_date, $publ_time, $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email'], $MOD_NEWS['TEXT_READ_MORE']);
218 227
					}
219 228
				} else {
220 229
					if($post_long_len < 9) {
221 230
						$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, $publ_date, $publ_time, '', '', '', '', '');
222 231
					} else {
223
						$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, $publ_date, $publ_time, '', '', '', '', $TEXT['READ_MORE']);
232
						$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $short, $post_link, $post_date, $post_time, $publ_date, $publ_time, '', '', '', '', $MOD_NEWS['TEXT_READ_MORE']);
224 233
					}
225 234
				}
226 235
				echo str_replace($vars, $values, $setting_post_loop);
......
291 300
			$group_image = $groups[$group_id]['image'];
292 301
			if($group_image == '') { $display_image = 'none'; } else { $display_image = ''; }
293 302
			if($group_id == 0) { $display_group = 'none'; } else { $display_group = ''; }
294
			$vars = array('[PAGE_TITLE]', '[GROUP_ID]', '[GROUP_TITLE]', '[GROUP_IMAGE]', '[DISPLAY_GROUP]', '[DISPLAY_IMAGE]', '[TITLE]', '[SHORT]', '[BACK]', '[MODI_DATE]', '[MODI_TIME]', '[PUBLISHED_DATE]', '[PUBLISHED_TIME]', '[USER_ID]', '[USERNAME]', '[DISPLAY_NAME]', '[EMAIL]');
303
			$vars = array('[PAGE_TITLE]', '[GROUP_ID]', '[GROUP_TITLE]', '[GROUP_IMAGE]', '[DISPLAY_GROUP]', '[DISPLAY_IMAGE]', '[TITLE]', '[SHORT]', '[BACK]', '[TEXT_BACK]', '[TEXT_LAST_CHANGED]', '[MODI_DATE]', '[TEXT_AT]', '[MODI_TIME]', '[PUBLISHED_DATE]', '[PUBLISHED_TIME]', '[TEXT_POSTED_BY]', '[TEXT_ON]', '[USER_ID]', '[USERNAME]', '[DISPLAY_NAME]', '[EMAIL]');
295 304
			$post_short=$post['content_short'];
296 305
			$wb->preprocess($post_short);
297 306
			if(isset($users[$uid]['username']) AND $users[$uid]['username'] != '') {
298
				$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $post_short, $page_link, $post_date, $post_time, $publ_date, $publ_time, $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email']);
307
				$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $post_short, $page_link, $MOD_NEWS['TEXT_BACK'], $MOD_NEWS['TEXT_LAST_CHANGED'], $post_date, $MOD_NEWS['TEXT_AT'], $post_time, $publ_date, $publ_time, $MOD_NEWS['TEXT_POSTED_BY'], $MOD_NEWS['TEXT_ON'], $uid, $users[$uid]['username'], $users[$uid]['display_name'], $users[$uid]['email']);
299 308
			} else {
300
				$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $post_short, $page_link, $post_date, $post_time, $publ_date, $publ_time, '', '', '', '');
309
				$values = array(PAGE_TITLE, $group_id, $group_title, $group_image, $display_group, $display_image, $post['title'], $post_short, $page_link, $MOD_NEWS['TEXT_BACK'], $MOD_NEWS['TEXT_LAST_CHANGED'], $post_date, $MOD_NEWS['TEXT_AT'], $post_time, $publ_date, $publ_time, $MOD_NEWS['TEXT_POSTED_BY'], $MOD_NEWS['TEXT_ON'], '', '', '', '');
301 310
			}
302 311
			$post_long = ($post['content_long']);
303 312
		}
......
321 330
	if(($post['commenting'] == 'private' AND isset($wb) AND $wb->is_authenticated() == true) OR $post['commenting'] == 'public') {
322 331
		
323 332
		// Print comments header
324
		echo str_replace('[ADD_COMMENT_URL]', WB_URL.'/modules/news/comment.php?id='.POST_ID.'&amp;sid='.$section_id, $setting_comments_header);
333
		$vars = array('[ADD_COMMENT_URL]','[TEXT_COMMENTS]');
334
		$values = array(WB_URL.'/modules/news/comment.php?id='.POST_ID.'&amp;sid='.$section_id, $MOD_NEWS['TEXT_COMMENTS']);
335
		echo str_replace($vars, $values, $setting_comments_header);
325 336
		
326 337
		// Query for comments
327 338
		$query_comments = $database->query("SELECT title,comment,commented_when,commented_by FROM ".TABLE_PREFIX."mod_news_comments WHERE post_id = '".POST_ID."' ORDER BY commented_when ASC");
......
334 345
				$commented_date = gmdate(DATE_FORMAT, $comment['commented_when']+TIMEZONE);
335 346
				$commented_time = gmdate(TIME_FORMAT, $comment['commented_when']+TIMEZONE);
336 347
				$uid = $comment['commented_by'];
337
				$vars = array('[TITLE]','[COMMENT]','[DATE]','[TIME]','[USER_ID]','[USERNAME]','[DISPLAY_NAME]', '[EMAIL]');
348
				$vars = array('[TITLE]','[COMMENT]','[TEXT_ON]','[DATE]','[TEXT_AT]','[TIME]','[TEXT_BY]','[USER_ID]','[USERNAME]','[DISPLAY_NAME]', '[EMAIL]');
338 349
				if(isset($users[$uid]['username']) AND $users[$uid]['username'] != '') {
339
					$values = array(($comment['title']), ($comment['comment']), $commented_date, $commented_time, $uid, ($users[$uid]['username']), ($users[$uid]['display_name']), ($users[$uid]['email']));
350
					$values = array(($comment['title']), ($comment['comment']), $MOD_NEWS['TEXT_ON'], $commented_date, $MOD_NEWS['TEXT_AT'], $commented_time, $MOD_NEWS['TEXT_BY'], $uid, ($users[$uid]['username']), ($users[$uid]['display_name']), ($users[$uid]['email']));
340 351
				} else {
341
					$values = array(($comment['title']), ($comment['comment']), $commented_date, $commented_time, '0', strtolower($TEXT['UNKNOWN']), $TEXT['UNKNOWN'], '');
352
					$values = array(($comment['title']), ($comment['comment']), $MOD_NEWS['TEXT_ON'], $commented_date, $MOD_NEWS['TEXT_AT'], $commented_time, $MOD_NEWS['TEXT_BY'], '0', strtolower($TEXT['UNKNOWN']), $TEXT['UNKNOWN'], '');
342 353
				}
343 354
				echo str_replace($vars, $values, $setting_comments_loop);
344 355
			}
......
352 363
		}
353 364
		
354 365
		// Print comments footer
355
		echo str_replace('[ADD_COMMENT_URL]', WB_URL.'/modules/news/comment.php?id='.POST_ID.'&amp;sid='.$section_id, $setting_comments_footer);
366
		$vars = array('[ADD_COMMENT_URL]','[TEXT_ADD_COMMENT]');
367
		$values = array(WB_URL.'/modules/news/comment.php?id='.POST_ID.'&amp;sid='.$section_id, $MOD_NEWS['TEXT_ADD_COMMENT']);
368
		echo str_replace($vars, $values, $setting_comments_footer);
356 369
	}
357 370
	if(ENABLED_ASP) {
358 371
		$_SESSION['comes_from_view'] = POST_ID;
trunk/wb/modules/news/languages/NL.php
26 26
//Modul Description
27 27
$module_description = 'Met deze module maak je een nieuwspagina.';
28 28

  
29
//Variables for the  backend
29
//Variables for the backend
30 30
$MOD_NEWS['SETTINGS'] = 'Eigenschappen van de Nieuwsmodule';
31 31

  
32
//Variables for the frontend
33
$MOD_NEWS['TEXT_READ_MORE'] = 'Lees verder';
34
$MOD_NEWS['TEXT_POSTED_BY'] = 'Posted door';
35
$MOD_NEWS['TEXT_ON'] = 'Op';
36
$MOD_NEWS['TEXT_LAST_CHANGED'] = 'Laatst vernieuwd';
37
$MOD_NEWS['TEXT_AT'] = 'at';
38
$MOD_NEWS['TEXT_BACK'] = 'Terug';
39
$MOD_NEWS['TEXT_COMMENTS'] = 'Commentaren';
40
$MOD_NEWS['TEXT_COMMENT'] = 'Commentaar';
41
$MOD_NEWS['TEXT_ADD_COMMENT'] = 'Toevoegen Commentaar';
42
$MOD_NEWS['TEXT_BY'] = 'door';
43

  
32 44
?>
trunk/wb/modules/news/languages/NO.php
26 26
//Modul Description
27 27
$module_description = 'Denne sidetypen er ment for &aring; kunne lage Nyhets sider.';
28 28
  
29
//Variables for the  backend
29
//Variables for the backend
30 30
$MOD_NEWS['SETTINGS'] = 'Innstillinger for Nyheter';
31

  
32
//Variables for the frontend
33
$MOD_NEWS['TEXT_READ_MORE'] = 'Les Mer';
34
$MOD_NEWS['TEXT_POSTED_BY'] = 'Posted Av';
35
$MOD_NEWS['TEXT_ON'] = 'P&aring;';
36
$MOD_NEWS['TEXT_LAST_CHANGED'] = 'Sist Endret';
37
$MOD_NEWS['TEXT_AT'] = 'at';
38
$MOD_NEWS['TEXT_BACK'] = 'Tilbake';
39
$MOD_NEWS['TEXT_COMMENTS'] = 'Kommentarer';
40
$MOD_NEWS['TEXT_COMMENT'] = 'Kommentar';
41
$MOD_NEWS['TEXT_ADD_COMMENT'] = 'Legg Til Kommentar';
42
$MOD_NEWS['TEXT_BY'] = 'Av';
31 43
  
32 44
?>
trunk/wb/modules/news/languages/EN.php
26 26
//Modul Description
27 27
$module_description = 'This page type is designed for making a news page.';
28 28

  
29
//Variables for the  backend
29
//Variables for the backend
30 30
$MOD_NEWS['SETTINGS'] = 'News Settings';
31 31

  
32
//Variables for the frontend
33
$MOD_NEWS['TEXT_READ_MORE'] = 'Read More';
34
$MOD_NEWS['TEXT_POSTED_BY'] = 'Posted by';
35
$MOD_NEWS['TEXT_ON'] = 'on';
36
$MOD_NEWS['TEXT_LAST_CHANGED'] = 'Last changed';
37
$MOD_NEWS['TEXT_AT'] = 'at';
38
$MOD_NEWS['TEXT_BACK'] = 'Back';
39
$MOD_NEWS['TEXT_COMMENTS'] = 'Comments';
40
$MOD_NEWS['TEXT_COMMENT'] = 'Comment';
41
$MOD_NEWS['TEXT_ADD_COMMENT'] = 'Add Comment';
42
$MOD_NEWS['TEXT_BY'] = 'By';
43

  
32 44
?>
trunk/wb/modules/news/languages/RU.php
26 26
//Modul Description
27 27
$module_description = '&#1052;&#1086;&#1076;&#1091;&#1083;&#1100; &#1087;&#1088;&#1077;&#1076;&#1085;&#1072;&#1079;&#1085;&#1072;&#1095;&#1077;&#1085; &#1076;&#1083;&#1103; &#1089;&#1086;&#1079;&#1076;&#1072;&#1085;&#1080;&#1103; &#1083;&#1077;&#1085;&#1090;&#1099; &#1085;&#1086;&#1074;&#1086;&#1089;&#1090;&#1077;&#1081;';
28 28

  
29
//Variables for the  backend
29
//Variables for the backend
30 30
$MOD_NEWS['SETTINGS'] = '&#1053;&#1072;&#1089;&#1090;&#1088;&#1086;&#1081;&#1082;&#1080; &#1085;&#1086;&#1074;&#1086;&#1089;&#1090;&#1085;&#1086;&#1081; &#1083;&#1077;&#1085;&#1090;&#1099;';
31 31

  
32
?>
32
//Variables for the frontend
33
$MOD_NEWS['TEXT_READ_MORE'] = '&#1063;&#1080;&#1090;&#1072;&#1090;&#1100; &#1076;&#1072;&#1083;&#1100;&#1096;&#1077;';
34
$MOD_NEWS['TEXT_POSTED_BY'] = 'Posted by';
35
$MOD_NEWS['TEXT_ON'] = 'on';
36
$MOD_NEWS['TEXT_LAST_CHANGED'] = '&#1055;&#1086;&#1089;&#1083;&#1077;&#1076;&#1085;&#1077;&#1077; &#1086;&#1073;&#1085;&#1086;&#1074;&#1083;&#1077;&#1085;&#1080;&#1077;';
37
$MOD_NEWS['TEXT_AT'] = 'at';
38
$MOD_NEWS['TEXT_BACK'] = '&#1053;&#1072;&#1079;&#1072;&#1076;';
39
$MOD_NEWS['TEXT_COMMENTS'] = '&#1050;&#1086;&#1084;&#1084;&#1077;&#1085;&#1090;&#1072;&#1088;&#1080;&#1080;';
40
$MOD_NEWS['TEXT_COMMENT'] = '&#1050;&#1086;&#1084;&#1084;&#1077;&#1085;&#1090;&#1080;&#1088;&#1086;&#1074;&#1072;&#1090;&#1100;';
41
$MOD_NEWS['TEXT_ADD_COMMENT'] = '&#1044;&#1086;&#1073;&#1072;&#1074;&#1080;&#1090;&#1100; &#1050;&#1086;&#1084;&#1084;&#1077;&#1085;&#1090;&#1080;&#1088;&#1086;&#1074;&#1072;&#1090;&#1100;';
42
$MOD_NEWS['TEXT_BY'] = 'By';
43

  
44
?>
trunk/wb/modules/news/languages/DE.php
23 23

  
24 24
*/
25 25

  
26
//Modulbeschreibung
26
//Modul Description
27 27
$module_description = 'Mit diesem Modul k&ouml;nnen sie eine News Seite ihrer Seite hinzuf&uuml;gen.';
28 28

  
29
//Variablen fuer backend Texte
29
//Variables for the backend
30 30
$MOD_NEWS['SETTINGS'] = 'News Einstellungen';
31 31

  
32
//Variables for the frontend
33
$MOD_NEWS['TEXT_READ_MORE'] = 'Weiterlesen';
34
$MOD_NEWS['TEXT_POSTED_BY'] = 'Ver&ouml;ffentlicht von';
35
$MOD_NEWS['TEXT_ON'] = 'am';
36
$MOD_NEWS['TEXT_LAST_CHANGED'] = 'Zuletzt ge&auml;ndert am';
37
$MOD_NEWS['TEXT_AT'] = 'um';
38
$MOD_NEWS['TEXT_BACK'] = 'Zur&uuml;ck';
39
$MOD_NEWS['TEXT_COMMENTS'] = 'Kommentare';
40
$MOD_NEWS['TEXT_COMMENT'] = 'Kommentar';
41
$MOD_NEWS['TEXT_ADD_COMMENT'] = 'Kommentar hinzuf&uuml;gen';
42
$MOD_NEWS['TEXT_BY'] = 'von';
43

  
32 44
?>
trunk/wb/modules/news/add.php
51 51
<td rowspan="3" style="display: [DISPLAY_IMAGE]"><img src="[GROUP_IMAGE]" alt="[GROUP_TITLE]" /></td>
52 52
</tr>
53 53
<tr>
54
<td valign="top"><b>Posted by [DISPLAY_NAME] ([USERNAME]) on [PUBLISHED_DATE]</b></td>
54
<td valign="top"><b>[TEXT_POSTED_BY] [DISPLAY_NAME] ([USERNAME]) [TEXT_ON] [PUBLISHED_DATE]</b></td>
55 55
</tr>
56 56
<tr style="display: [DISPLAY_GROUP]">
57 57
<td valign="top"><a href="[BACK]">[PAGE_TITLE]</a> >> <a href="[BACK]?g=[GROUP_ID]">[GROUP_TITLE]</a></td>
58 58
</tr>
59 59
</table>');
60
$post_footer = '<p>Last changed: [MODI_DATE] at [MODI_TIME]</p>
61
<a href=\"[BACK]\">Back</a>';
60
$post_footer = '<p>[TEXT_LAST_CHANGED]: [MODI_DATE] [TEXT_AT] [MODI_TIME]</p>
61
<a href=\"[BACK]\">[TEXT_BACK]</a>';
62 62
$comments_header = addslashes('<br /><br />
63
<h2>Comments</h2>
63
<h2>[TEXT_COMMENTS]</h2>
64 64
<table cellpadding="2" cellspacing="0" border="0" width="98%">');
65 65
$comments_loop = addslashes('<tr>
66 66
<td class="comment_title">[TITLE]</td>
67
<td class="comment_info">By [DISPLAY_NAME] on [DATE] at [TIME]</td>
67
<td class="comment_info">[TEXT_BY] [DISPLAY_NAME] [TEXT_ON] [DATE] [TEXT_AT] [TIME]</td>
68 68
</tr>
69 69
<tr>
70 70
<td colspan="2" class="comment_text">[COMMENT]</td>
71 71
</tr>');
72 72
$comments_footer = '</table>
73
<br /><a href=\"[ADD_COMMENT_URL]\">Add Comment</a>';
74
$comments_page = '<h1>Comment</h1>
73
<br /><a href=\"[ADD_COMMENT_URL]\">[TEXT_ADD_COMMENT]</a>';
74
$comments_page = '<h1>[TEXT_COMMENT]</h1>
75 75
<h2>[POST_TITLE]</h2>
76 76
<br />';
77 77
$commenting = 'none';

Also available in: Unified diff