From bcfa6dca1e6646a50f12f617425c6087cae97ac8 Mon Sep 17 00:00:00 2001 From: Dries Buytaert <dries@buytaert.net> Date: Sun, 28 Sep 2003 18:23:13 +0000 Subject: [PATCH] - Translation improvements for the block module help. Patch by Gabor. --- modules/block.module | 13 +++++++------ modules/block/block.module | 13 +++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/modules/block.module b/modules/block.module index 81e48fdb0930..a4b29e4656a3 100644 --- a/modules/block.module +++ b/modules/block.module @@ -10,7 +10,7 @@ function block_help($section = "admin/block/help") { $output .= "<p>The sidebar each block appears in depends on both which theme you're using (some are left-only, some right, some both), and on the settings in block management.</p><p>Whether a block is visible in the first place depends on three things:</p><ul><li>It must have its \"enabled\" box checked in block management.</li><li>If it has its \"custom\" box checked in block management, the user must have chosen to display it in their user preferences.</li><li>If the \"path\" field in block management is set, the visitor must be on a page that matches the path specification (more on this later).</li></ul>"; $output .= "<p>The block management screen also lets you specify the vertical sort-order of the blocks within a sidebar. You do this by assigning a <b>weight</b> to each block. Lighter blocks (smaller weight) \"float up\" towards the top of the sidebar. Heavier ones \"sink down\" towards the bottom of it. Once you've positioned things just so, you can preview what the layout will look like in different types of themes by clicking the preview placement link in the menu to the left.</p>"; $output .= "<p>The path setting lets you define the pages on which a specific block is visable. If you leave the path blank it will appear on all pages. The path uses a regular expression syntax so remember to escape special characters!</p>"; - $output .= strtr("<p>In case you do not know what a regular expression is, you should read about them in the PHP manual. The chapter to look at is the one on %pcre</p>", array("%pcre" => "<a href=\"http://php.net/pcre/\">". t("Perl-Compatible Regular Expressions (PCRE)") ."</a>" )); + $output .= "<p>In case you do not know what a regular expression is, you should read about them in the PHP manual. The chapter to look at is the one on %pcre.</p>"; $output .= "<p>However, for basic tasks it is sufficient to look at the following examples:</p>"; $output .= "<p>If the block should only show up on blog pages, use </blog>. To display on all node views use </node/view>. The angular brackets are used as delimiters of the regular expression. To show up on either forum or book pages use <(/forum|/book)>. The round brackets form a group of expressions, divided by the | character. It matches if any of the expressions in it match. A more complicated example is </node/add/(story|blog|image)>. Blocks which have their paths set to this expression will show up on story, block, or image composition pages. If you want to show a block an all pages, but not the search page, use <(^/$|[^(search)$/]+)></p>"; $output .= "<h3>Custom Blocks</h3>"; @@ -34,23 +34,24 @@ function block_help($section = "admin/block/help") { }"; $output .= "</pre></blockquote>"; $output .= "<p>For more in-depth examples, we recommend that you check the existing boxes and use them as a starting point.</p>"; + $output = t($output, array("%pcre" => "<a href=\"http://php.net/pcre/\">". t("Perl-Compatible Regular Expressions (PCRE)") ."</a>")); break; case 'admin/system/modules': - $output = "Controls the boxes that are displayed around the main content."; + $output = t("Controls the boxes that are displayed around the main content."); break; case 'admin/system/block': - $output = strtr("Blocks are the boxes in the left- and right- side bars of the web site, depending on the choosen theme. They are created by <b>active</b> Drupal modules. In order to view a block it must be enabled. You can assign the block's placement by giving it a region and a weight. The region specifies which side of the page the block is on, and the weight sorts blocks within a region. Lighter (smaller weight value) blocks \"float up\" towards the top of the page. The path setting lets you define which pages you want a block to be shown on. The custom checkbox lets your users hide the block using their account setting. You can also create your own blocks, where you specify the content of the block rather than its being generated by a module (you can even use PHP in these). You can create one of these by clicking the %createblock link in the menu to the left. Edit and delete links will become active below for these customized blocks.", array("%createblock" => l(t("create new block"), "admin/block/add"))); + $output = t("Blocks are the boxes in the left- and right- side bars of the web site, depending on the choosen theme. They are created by <b>active</b> Drupal modules. In order to view a block it must be enabled. You can assign the block's placement by giving it a region and a weight. The region specifies which side of the page the block is on, and the weight sorts blocks within a region. Lighter (smaller weight value) blocks \"float up\" towards the top of the page. The path setting lets you define which pages you want a block to be shown on. The custom checkbox lets your users hide the block using their account setting. You can also create your own blocks, where you specify the content of the block rather than its being generated by a module (you can even use PHP in these). You can create one of these by clicking the %createblock link in the menu to the left. Edit and delete links will become active below for these customized blocks.", array("%createblock" => l(t("new block"), "admin/system/block/add"))); ; break; case 'admin/system/block/add': - $output = strtr("Here you can create a custom content block. Once you have created this block you must make it active, and give it a place on the page using %overview. The title is used when displaying the block. The description is used in the \"block\" column on the %overview page. If you are going to place PHP code in the block, and you have <b>create php content</b> permission (see %permission) you <b>must</b> change the type to PHP to make your code active.", array("%overview" => l(t("block management"), "admin/block"), "%permission" => l(t("user management"), "admin/user/permission"))); + $output = t("Here you can create a custom content block. Once you have created this block you must make it active, and give it a place on the page using %overview. The title is used when displaying the block. The description is used in the \"block\" column on the %overview page. If you are going to place PHP code in the block, and you have <b>create php content</b> permission (see the %permission page) you <b>must</b> change the type to PHP to make your code active.", array("%overview" => l(t("blocks"), "admin/system/block"), "%permission" => l(t("permissions"), "admin/user/permission"))); break; case 'admin/system/block/preview': - $output = "This page show you the placement of your blocks in different themes types. The numbers are the weight of each block, which is used to sort them within the sidebars."; + $output = t("This page show you the placement of your blocks in different themes types. The numbers are the weight of each block, which is used to sort them within the sidebars."); break; } - return t($output); + return $output; } function block_system($field){ diff --git a/modules/block/block.module b/modules/block/block.module index 81e48fdb0930..a4b29e4656a3 100644 --- a/modules/block/block.module +++ b/modules/block/block.module @@ -10,7 +10,7 @@ function block_help($section = "admin/block/help") { $output .= "<p>The sidebar each block appears in depends on both which theme you're using (some are left-only, some right, some both), and on the settings in block management.</p><p>Whether a block is visible in the first place depends on three things:</p><ul><li>It must have its \"enabled\" box checked in block management.</li><li>If it has its \"custom\" box checked in block management, the user must have chosen to display it in their user preferences.</li><li>If the \"path\" field in block management is set, the visitor must be on a page that matches the path specification (more on this later).</li></ul>"; $output .= "<p>The block management screen also lets you specify the vertical sort-order of the blocks within a sidebar. You do this by assigning a <b>weight</b> to each block. Lighter blocks (smaller weight) \"float up\" towards the top of the sidebar. Heavier ones \"sink down\" towards the bottom of it. Once you've positioned things just so, you can preview what the layout will look like in different types of themes by clicking the preview placement link in the menu to the left.</p>"; $output .= "<p>The path setting lets you define the pages on which a specific block is visable. If you leave the path blank it will appear on all pages. The path uses a regular expression syntax so remember to escape special characters!</p>"; - $output .= strtr("<p>In case you do not know what a regular expression is, you should read about them in the PHP manual. The chapter to look at is the one on %pcre</p>", array("%pcre" => "<a href=\"http://php.net/pcre/\">". t("Perl-Compatible Regular Expressions (PCRE)") ."</a>" )); + $output .= "<p>In case you do not know what a regular expression is, you should read about them in the PHP manual. The chapter to look at is the one on %pcre.</p>"; $output .= "<p>However, for basic tasks it is sufficient to look at the following examples:</p>"; $output .= "<p>If the block should only show up on blog pages, use </blog>. To display on all node views use </node/view>. The angular brackets are used as delimiters of the regular expression. To show up on either forum or book pages use <(/forum|/book)>. The round brackets form a group of expressions, divided by the | character. It matches if any of the expressions in it match. A more complicated example is </node/add/(story|blog|image)>. Blocks which have their paths set to this expression will show up on story, block, or image composition pages. If you want to show a block an all pages, but not the search page, use <(^/$|[^(search)$/]+)></p>"; $output .= "<h3>Custom Blocks</h3>"; @@ -34,23 +34,24 @@ function block_help($section = "admin/block/help") { }"; $output .= "</pre></blockquote>"; $output .= "<p>For more in-depth examples, we recommend that you check the existing boxes and use them as a starting point.</p>"; + $output = t($output, array("%pcre" => "<a href=\"http://php.net/pcre/\">". t("Perl-Compatible Regular Expressions (PCRE)") ."</a>")); break; case 'admin/system/modules': - $output = "Controls the boxes that are displayed around the main content."; + $output = t("Controls the boxes that are displayed around the main content."); break; case 'admin/system/block': - $output = strtr("Blocks are the boxes in the left- and right- side bars of the web site, depending on the choosen theme. They are created by <b>active</b> Drupal modules. In order to view a block it must be enabled. You can assign the block's placement by giving it a region and a weight. The region specifies which side of the page the block is on, and the weight sorts blocks within a region. Lighter (smaller weight value) blocks \"float up\" towards the top of the page. The path setting lets you define which pages you want a block to be shown on. The custom checkbox lets your users hide the block using their account setting. You can also create your own blocks, where you specify the content of the block rather than its being generated by a module (you can even use PHP in these). You can create one of these by clicking the %createblock link in the menu to the left. Edit and delete links will become active below for these customized blocks.", array("%createblock" => l(t("create new block"), "admin/block/add"))); + $output = t("Blocks are the boxes in the left- and right- side bars of the web site, depending on the choosen theme. They are created by <b>active</b> Drupal modules. In order to view a block it must be enabled. You can assign the block's placement by giving it a region and a weight. The region specifies which side of the page the block is on, and the weight sorts blocks within a region. Lighter (smaller weight value) blocks \"float up\" towards the top of the page. The path setting lets you define which pages you want a block to be shown on. The custom checkbox lets your users hide the block using their account setting. You can also create your own blocks, where you specify the content of the block rather than its being generated by a module (you can even use PHP in these). You can create one of these by clicking the %createblock link in the menu to the left. Edit and delete links will become active below for these customized blocks.", array("%createblock" => l(t("new block"), "admin/system/block/add"))); ; break; case 'admin/system/block/add': - $output = strtr("Here you can create a custom content block. Once you have created this block you must make it active, and give it a place on the page using %overview. The title is used when displaying the block. The description is used in the \"block\" column on the %overview page. If you are going to place PHP code in the block, and you have <b>create php content</b> permission (see %permission) you <b>must</b> change the type to PHP to make your code active.", array("%overview" => l(t("block management"), "admin/block"), "%permission" => l(t("user management"), "admin/user/permission"))); + $output = t("Here you can create a custom content block. Once you have created this block you must make it active, and give it a place on the page using %overview. The title is used when displaying the block. The description is used in the \"block\" column on the %overview page. If you are going to place PHP code in the block, and you have <b>create php content</b> permission (see the %permission page) you <b>must</b> change the type to PHP to make your code active.", array("%overview" => l(t("blocks"), "admin/system/block"), "%permission" => l(t("permissions"), "admin/user/permission"))); break; case 'admin/system/block/preview': - $output = "This page show you the placement of your blocks in different themes types. The numbers are the weight of each block, which is used to sort them within the sidebars."; + $output = t("This page show you the placement of your blocks in different themes types. The numbers are the weight of each block, which is used to sort them within the sidebars."); break; } - return t($output); + return $output; } function block_system($field){ -- GitLab