From 5436e6bf4fe819bd9686061b2bdbb43b8bc7ba25 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Wed, 5 Oct 2011 18:56:57 +0200 Subject: [PATCH] Removed some obsolete language variables --- .../files/acp/templates/cronjobAdd.tpl | 2 - .../install/files/acp/templates/option.tpl | 9 +- .../files/acp/templates/optionFieldList.tpl | 2 +- .../files/acp/templates/updateServerAdd.tpl | 1 - .../install/files/acp/templates/userMail.tpl | 2 - .../lib/data/language/Language.class.php | 12 +- .../LangCompilerTemplatePlugin.class.php | 2 +- wcfsetup/install/lang/de.xml | 113 ++++-------------- wcfsetup/install/lang/en.xml | 83 +------------ wcfsetup/setup/lang/setup_de.xml | 2 +- wcfsetup/setup/lang/setup_en.xml | 2 +- 11 files changed, 43 insertions(+), 187 deletions(-) diff --git a/wcfsetup/install/files/acp/templates/cronjobAdd.tpl b/wcfsetup/install/files/acp/templates/cronjobAdd.tpl index 58cc5c8b7c..c8c75f1770 100644 --- a/wcfsetup/install/files/acp/templates/cronjobAdd.tpl +++ b/wcfsetup/install/files/acp/templates/cronjobAdd.tpl @@ -46,7 +46,6 @@ {/if} {/if} - {lang}wcf.acp.cronjob.className.description{/lang} @@ -54,7 +53,6 @@
- {lang}wcf.acp.cronjob.description.description{/lang}
diff --git a/wcfsetup/install/files/acp/templates/option.tpl b/wcfsetup/install/files/acp/templates/option.tpl index 4ffca0ec22..1998aa0d49 100644 --- a/wcfsetup/install/files/acp/templates/option.tpl +++ b/wcfsetup/install/files/acp/templates/option.tpl @@ -13,7 +13,7 @@

{lang}wcf.acp.option.category.{$category->categoryName}{/lang}

-

{lang}wcf.acp.option.category.{$category->categoryName}.description{/lang}

+ {hascontent}

{content}{lang __optional=true}wcf.acp.option.category.{$category->categoryName}.description{/lang}{/content}

{/hascontent}
@@ -39,7 +39,7 @@ + {include file='footer'} diff --git a/wcfsetup/install/files/acp/templates/optionFieldList.tpl b/wcfsetup/install/files/acp/templates/optionFieldList.tpl index c815e94b5d..d16ee009e6 100644 --- a/wcfsetup/install/files/acp/templates/optionFieldList.tpl +++ b/wcfsetup/install/files/acp/templates/optionFieldList.tpl @@ -17,7 +17,7 @@ {/if} {/if} - {lang}{@$langPrefix}{$option->optionName}.description{/lang} + {lang __optional=true}{@$langPrefix}{$option->optionName}.description{/lang} {/foreach} \ No newline at end of file diff --git a/wcfsetup/install/files/acp/templates/updateServerAdd.tpl b/wcfsetup/install/files/acp/templates/updateServerAdd.tpl index 3af61a997a..f557ad24e2 100644 --- a/wcfsetup/install/files/acp/templates/updateServerAdd.tpl +++ b/wcfsetup/install/files/acp/templates/updateServerAdd.tpl @@ -44,7 +44,6 @@ {/if} {/if} - {lang}wcf.acp.updateServer.serverURL.description{/lang} diff --git a/wcfsetup/install/files/acp/templates/userMail.tpl b/wcfsetup/install/files/acp/templates/userMail.tpl index 0c9cacb0d4..27c8efc463 100644 --- a/wcfsetup/install/files/acp/templates/userMail.tpl +++ b/wcfsetup/install/files/acp/templates/userMail.tpl @@ -102,7 +102,6 @@ {/if} {/if} - {lang}wcf.acp.user.sendMail.subject.description{/lang} @@ -136,7 +135,6 @@ {/if} {/if} - {lang}wcf.acp.user.sendMail.text.description{/lang} diff --git a/wcfsetup/install/files/lib/data/language/Language.class.php b/wcfsetup/install/files/lib/data/language/Language.class.php index def6ea30c2..9970a7db41 100644 --- a/wcfsetup/install/files/lib/data/language/Language.class.php +++ b/wcfsetup/install/files/lib/data/language/Language.class.php @@ -80,9 +80,10 @@ class Language extends DatabaseObject { * Returns a single language variable. * * @param string $item + * @param boolean $optional * @return string */ - public function get($item) { + public function get($item, $optional = false) { if (!isset($this->items[$item])) { // load category file $explodedItem = explode('.', $item); @@ -103,6 +104,7 @@ class Language extends DatabaseObject { } // return plain variable + if ($optional) return ''; return $item; } @@ -110,11 +112,13 @@ class Language extends DatabaseObject { * Executes template scripting in a language variable. * * @param string $item - * @param array $variables + * @param array $variables + * @param boolean $optional * @return string result */ - public function getDynamicVariable($item, array $variables = array()) { - $staticItem = $this->get($item); + public function getDynamicVariable($item, array $variables = array(), $optional = false) { + $staticItem = $this->get($item, $optional); + if (!$staticItem) return ''; if (isset($this->dynamicItems[$this->languageID][$item])) { return WCF::getTPL()->fetchString($this->dynamicItems[$this->languageID][$item], $variables); diff --git a/wcfsetup/install/files/lib/system/template/plugin/LangCompilerTemplatePlugin.class.php b/wcfsetup/install/files/lib/system/template/plugin/LangCompilerTemplatePlugin.class.php index 5f68b22094..8ec0d31288 100644 --- a/wcfsetup/install/files/lib/system/template/plugin/LangCompilerTemplatePlugin.class.php +++ b/wcfsetup/install/files/lib/system/template/plugin/LangCompilerTemplatePlugin.class.php @@ -39,6 +39,6 @@ class LangCompilerTemplatePlugin implements ICompilerTemplatePlugin { public function executeEnd(TemplateScriptingCompiler $compiler) { $compiler->popTag('lang'); $hash = StringUtil::getRandomID(); - return "getDynamicVariable(\$_lang".$hash.", \$this->tagStack[count(\$this->tagStack) - 1][1]); array_pop(\$this->tagStack); ?>"; + return "getDynamicVariable(\$_lang".$hash.", \$this->tagStack[count(\$this->tagStack) - 1][1], (isset(\$this->tagStack[count(\$this->tagStack) - 1][1]['__optional']) ? \$this->tagStack[count(\$this->tagStack) - 1][1]['__optional'] : false)); array_pop(\$this->tagStack); ?>"; } } diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index e868fc8ea3..83508f9ea4 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -21,11 +21,9 @@ - - Newbie: Intro to cron]]> @@ -61,77 +59,43 @@ - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - @@ -199,120 +163,90 @@ - - - - - - - - + - + - + - - - - + - - + - - - - - - + - - + - + - - + - - - - - - memcached.org.]]> - + - - + - + - + - + - - - - - + - + - - + @@ -321,12 +255,10 @@ - - - + @@ -340,12 +272,11 @@ - + - + - @@ -414,9 +345,7 @@ - - user->username}!]]> diff --git a/wcfsetup/install/lang/en.xml b/wcfsetup/install/lang/en.xml index a999d88ce8..151de2ba23 100644 --- a/wcfsetup/install/lang/en.xml +++ b/wcfsetup/install/lang/en.xml @@ -21,11 +21,9 @@ - - Newbie: Intro to cron.]]> @@ -59,79 +57,45 @@ - + - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - @@ -199,96 +163,71 @@ - - - - - - - - + - - - - + - - - - - - - - - - - - - - memcached.org.]]> - + - - + @@ -299,18 +238,13 @@ - - - - - @@ -321,9 +255,7 @@ - - @@ -345,7 +277,6 @@ - @@ -414,9 +345,7 @@ - - user->username}.]]> diff --git a/wcfsetup/setup/lang/setup_de.xml b/wcfsetup/setup/lang/setup_de.xml index b18b6e9501..5d85ed2f85 100644 --- a/wcfsetup/setup/lang/setup_de.xml +++ b/wcfsetup/setup/lang/setup_de.xml @@ -47,7 +47,7 @@ WoltLab Community Framework entpackt.]]> WoltLab Community Framework im Ordner "{$foundDirectory}".
Bitte überprüfen Sie diese Angabe bzw. definieren Sie ein anderes Installationsverzeichnis, wenn Sie eine neue Kopie von WoltLab Community Framework installieren möchten.]]>
- WoltLab Community Framework an. Wenn Sie unsicher sind, belassen sie den vom System vorgegebenen Namen und führen die Standard-Installation durch.]]> + WoltLab Community Framework über diese Adresse (URL) erreichbar.]]> diff --git a/wcfsetup/setup/lang/setup_en.xml b/wcfsetup/setup/lang/setup_en.xml index 9785f10610..3515091fa7 100644 --- a/wcfsetup/setup/lang/setup_en.xml +++ b/wcfsetup/setup/lang/setup_en.xml @@ -47,7 +47,7 @@ WoltLab Community Framework will be extracted into the installation-folder.]]> WoltLab Community Framework in the "{$foundDirectory}" folder.
If you would like to install a new copy of the WoltLab Community Framework, then please enter an alternative installation folder.]]>
- WoltLab Community Framework. If you are unsure, keep the name which the system suggests and run the standard-installation.]]> + WoltLab Community Framework through this adress (URL).]]> -- 2.20.1