default_language.xsl 14 KB
<xsl:stylesheet version="1.0"
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns:php="http://php.net/xsl" >
		<xsl:variable name="lang_clipboard"><xsl:apply-templates select="/content/Language/lang[@name='clipboard']"/></xsl:variable>
		<xsl:variable name="lang_category"><xsl:apply-templates select="/content/Language/lang[@name='category']"/></xsl:variable>
		<xsl:variable name="lang_search"><xsl:apply-templates select="/content/Language/lang[@name='search']"/></xsl:variable>
		<xsl:variable name="lang_all"><xsl:apply-templates select="/content/Language/lang[@name='all']"/></xsl:variable>
		<xsl:variable name="lang_reset"><xsl:apply-templates select="/content/Language/lang[@name='reset']"/></xsl:variable>
		<xsl:variable name="lang_more"><xsl:apply-templates select="/content/Language/lang[@name='more']"/></xsl:variable>
		<xsl:variable name="lang_repeatString"><xsl:apply-templates select="/content/Language/lang[@name='repeatString']"/></xsl:variable>
		<xsl:variable name="lang_positionString"><xsl:apply-templates select="/content/Language/lang[@name='positionString']"/></xsl:variable>

		<!-- specific lang Functions -->
		<xsl:template name="fnc_langGetStyledText">
			<xsl:param name="param_kind" />
			<xsl:choose>
				<xsl:when test="$param_kind='expl_content'">
					Mit <span class="red bold">*</span> gekennzeichnete Felder müssen ausgefüllt werden! / Les champs avec un <span class="red bold">*</span> doivent être remplis (vous pouvez mettre juste un point/une seule lettre en ce qui concerne le texte)
				</xsl:when>
			</xsl:choose>
		</xsl:template>

		<xsl:template name="fnc_langAskRights">
			<xsl:param name="param_title"/>
				Rechte von "<xsl:value-of select="$param_title"/>" übernehmen oder neue Lese-/Schreibrechte erstellen? / Cet élément a-t-il les permissions par défaut de la page d'accueil ?
		</xsl:template>

<!-- commen function -->
		<xsl:template name="fnc_langEditUnderHead">
			<xsl:param name="param_class"/>
			<xsl:param name="param_title"/>
			<xsl:choose>
				<xsl:when test="param_title = not('')">
					<xsl:apply-templates select="/content/Language/lang[@name='editUnderHead']"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:apply-templates select="/content/Language/lang[@name='editRightsUnderHead']"/>
				</xsl:otherwise>
			</xsl:choose>
			<xsl:apply-templates select="/content/Language/lang[@name=$param_class]"/>
			<xsl:if test="param_title = not('')">
			 - <xsl:value-of select="$param_title"/>
			</xsl:if>
		</xsl:template>

		<xsl:template name="fnc_langGetLabel">
			<xsl:param name="param_kind" select="@label"/>
			<xsl:apply-templates select="/content/Language/lang[@name=$param_kind]"/>
		</xsl:template>

		<xsl:template name="fnc_langInputTitle">
			<xsl:param name="param_kind" select="@objvar"/>
			<xsl:param name="param_class" select="@class"/>

			<xsl:choose>
				<xsl:when test="$param_kind='Name' or $param_kind='NickName'">
					<xsl:apply-templates select="/content/Language/lang[@name='input_Name']"/>
				</xsl:when>
 				<xsl:when test="$param_kind='TagCloud][form_newTag'">
					<xsl:apply-templates select="/content/Language/lang[@name='input_Tag']"/>
				</xsl:when>
				<xsl:when test="$param_kind='Category][form_newCategory'">
					<xsl:apply-templates select="/content/Language/lang[@name='input_Category']"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:apply-templates select="/content/Language/lang[@name=concat('input_',$param_kind)]"/>
				</xsl:otherwise>
			</xsl:choose>

		</xsl:template>
		<xsl:template name="fnc_langBCCat">
			<xsl:param name="param_name"/>
			<xsl:param name="param_cat" select="substring-after($param_name,'::')"/>

			<xsl:choose>
				<xsl:when test="$param_cat = ''">
					<xsl:apply-templates select="/content/Language/lang[@name=$param_name]"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:apply-templates select="/content/Language/lang[@name=concat(substring-before($param_name,'::'),param_cat)]"/>
				</xsl:otherwise>
			</xsl:choose>

		</xsl:template>

		<xsl:template name="fnc_langCat">
			<xsl:param name="param_name" select="@BECategoryName"/>

			<xsl:variable name="tmp_cat"><xsl:apply-templates select="/content/Language/lang[@name=$param_name]"/></xsl:variable>
			<xsl:choose>
				<xsl:when test="$tmp_cat = ''">
					<xsl:value-of select="$param_name"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="$tmp_cat"/>
				</xsl:otherwise>
			</xsl:choose>

		</xsl:template>


		<xsl:template name="fnc_langBCToBE">
			<xsl:param name="param_class" select="../../@BasisClipboard"/>
			<xsl:choose>
				<xsl:when test="$param_class='TopicBC'">
					<xsl:apply-templates select="/content/Language/lang[@name='TopicBE']"/>
				</xsl:when>
				<xsl:when test="$param_class='CampaignBC'">
					<xsl:apply-templates select="/content/Language/lang[@name='CampaignBE']"/>
				</xsl:when>
				<xsl:when test="$param_class='DateBC'">
					<xsl:apply-templates select="/content/Language/lang[@name='DateBE']"/>
				</xsl:when>
				<xsl:when test="$param_class='ThreadBC'">
					<xsl:apply-templates select="/content/Language/lang[@name='ThreadBE']"/>
				</xsl:when>
				<xsl:when test="$param_class='ThreadMessageUnderBC'">
					<xsl:apply-templates select="/content/Language/lang[@name='ThreadMessageUnderBE']"/>
				</xsl:when>
				<xsl:when test="$param_class='OutBox'">
					<xsl:apply-templates select="/content/Language/lang[@name='PostMessageBE']"/>
				</xsl:when>
				<xsl:when test="$param_class='InBox'">
					<xsl:apply-templates select="/content/Language/lang[@name='PostMessageBE']"/>
				</xsl:when>
				<xsl:when test="$param_class='FileBC'">
					<xsl:apply-templates select="/content/Language/lang[@name='FileBE']"/>
				</xsl:when>
				<xsl:when test="$param_class='Blog'">
					<xsl:apply-templates select="/content/Language/lang[@name='BlogSubGuestbook']"/>
				</xsl:when>
				<xsl:when test="$param_class='BlogSubPages'">
					<xsl:apply-templates select="/content/Language/lang[@name='BlogSubPage']"/>
				</xsl:when>
				<xsl:when test="$param_class='BlogGuestbook'">
					<xsl:apply-templates select="/content/Language/lang[@name='BlogBEGuestbook']"/>
				</xsl:when>
				<xsl:when test="$param_class='ThreadMessageBC'">
					<!--

					@todo language hier gibts sprach probleme, Keyword wird fü news blog artikel und unter forum neu erstellen benutzt!!!!
					@author f@mensch.coop	 @since 10.02.2011
					::Blog - Créer une actualité
					-->
					<xsl:apply-templates select="/content/Language/lang[@name='ThreadMessageBE']"/>
				</xsl:when>
				<xsl:when test="$param_class='ThreadMessageBCBlog'">
					<xsl:apply-templates select="/content/Language/lang[@name='ThreadMessageBEBlog']"/>
				</xsl:when>
				<xsl:when test="$param_class='UrlBC'">
					<xsl:apply-templates select="/content/Language/lang[@name='UrlBE']"/>
				</xsl:when>
				<xsl:when test="$param_class='FileUnderImageBC'">
					<xsl:apply-templates select="/content/Language/lang[@name='FileUnderImageBE']"/>
				</xsl:when>
				<xsl:when test="$param_class='FileBCImage'">
					<xsl:apply-templates select="/content/Language/lang[@name='image']"/>
				</xsl:when>
				<xsl:when test="$param_class='NewsfeedBC'">
					<xsl:apply-templates select="/content/Language/lang[@name='NewsfeedBE']"/>
				</xsl:when>
				<xsl:when test="$param_class='ThreadMessageBCForum'">
					<xsl:apply-templates select="/content/Language/lang[@name='ThreadMessageBE']"/>
				</xsl:when>
				<xsl:when test="$param_class='FriendList'">
					<xsl:apply-templates select="/content/Language/lang[@name='Friend']"/>
				</xsl:when>
				<xsl:when test="$param_class='Clipboard'">
					<xsl:apply-templates select="/content/Language/lang[@name='elem']"/>
				</xsl:when>
				<xsl:when test="$param_class = 'ProfilePreferenceManager'">
					<xsl:apply-templates select="/content/Language/lang[@name='Profile']"/>
				</xsl:when>
				<xsl:when test="$param_class = 'MemberProfileBC'">
					<xsl:apply-templates select="/content/Language/lang[@name='MemberProfileBE']"/>
				</xsl:when>
				<xsl:when test="$param_class = 'AspirantBC'">
					<xsl:apply-templates select="/content/Language/lang[@name='AspirantBE']"/>
				</xsl:when>
				<xsl:when test="$param_class = 'GroupProfileBC'">
					<xsl:apply-templates select="/content/Language/lang[@name='GroupProfileBE']"/>
				</xsl:when>
				<xsl:otherwise>
					BCtoBE fehlende lang für <xsl:value-of select="$param_class"/>
				</xsl:otherwise>

			</xsl:choose>

		</xsl:template>
		<xsl:template name="fnc_langBC">
			<xsl:param name="param_class" select="../../@BasisClipboard"/>

			<xsl:choose>
				<xsl:when test="$param_class='CategoryContentList'">
 					<xsl:call-template name="fnc_langCat">
						<xsl:with-param name="param_name" select="List/CategoryName" />
					</xsl:call-template>
				</xsl:when>
				<xsl:when test="$param_class='FileBC' or $param_class='FileManager'">
					<xsl:apply-templates select="/content/Language/lang[@name='FileBC']"/>
				</xsl:when>
				<xsl:otherwise>
					<xsl:apply-templates select="/content/Language/lang[@name=$param_class]"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:template>

		<xsl:template name="fnc_langGetButtonTitle">
			<xsl:param name="param_kind" select="@kind"/>
			<xsl:param name="param_class">
				 <xsl:value-of select="../../@BasisClipboard"/><xsl:value-of select="../../@Category"/>
			</xsl:param>
			<xsl:choose>
				<xsl:when test="$param_kind='makeNew'">
					<xsl:apply-templates select="/content/Language/lang[@name='makeNew']"/><xsl:value-of select="' '"/><xsl:call-template name="fnc_langBCToBE">
						<xsl:with-param name="param_class" select="$param_class"/>
					</xsl:call-template>
				</xsl:when>
				<xsl:when test="$param_kind='edit'">
					<xsl:apply-templates select="/content/Language/lang[@name='edit']"/><xsl:value-of select="' '"/><xsl:call-template name="fnc_langBC">
						<xsl:with-param name="param_class" select="$param_class"/>
					</xsl:call-template>
				</xsl:when>
				<xsl:when test="$param_kind='post_addAndRemove' or $param_kind='post_add'">
					<xsl:apply-templates select="/content/Language/lang[@name='attach']"/>
						<!--
							macht glaube ich keinen sinn sowas deutsches hier reinzupacken
							@author f@mensch.coop @since 20110210
							<xsl:value-of select="' zu '"/>
						-->
						<xsl:call-template name="fnc_langBC">
						<xsl:with-param name="param_class" select="$param_class"/>
					</xsl:call-template>
				</xsl:when>
				<xsl:when test="$param_kind='post_remove'">
					<xsl:apply-templates select="/content/Language/lang[@name='remove']"/><xsl:text> </xsl:text><xsl:call-template name="fnc_langBCToBE">
						<xsl:with-param name="param_class" select="$param_class"/>
					</xsl:call-template>
				</xsl:when>
				<xsl:otherwise>
					<xsl:apply-templates select="/content/Language/lang[@name=$param_kind]"/>
				</xsl:otherwise>
			</xsl:choose>
		</xsl:template>
		<xsl:template name="fnc_langGetState">
			<xsl:param name="param_key" select="@key"/>
			<xsl:apply-templates select="/content/Language/lang[@name='confirmed']"/>
		</xsl:template>
		<xsl:template match="Language">
 			<xsl:variable name="tmp_title"><xsl:apply-templates select="/content/Language/lang[@name = 'changeLang']"/></xsl:variable>
 			<xsl:variable name="var_ISO"><xsl:apply-templates select="/content/Language/ISO"/></xsl:variable>
			<ul class="lang">
				<li class="lang {/content/Language/@code}" title="{$tmp_title}">
					<text> </text>
					<ul class="hidden">
						<xsl:apply-templates select="/content/Language/ISO"/>
					</ul>
				</li>
			</ul>
		</xsl:template>
		<xsl:template match="Message" mode="lang">
			<xsl:param name="param_name" select="@name"/>
			<xsl:param name="param_bc" select="@classLabel"/>
			<xsl:param name="param_kind" select="@kind"/>
			<xsl:param name="param_state" select="@state"/>
			<p class="notice">
				<xsl:choose>
					<xsl:when test="$param_kind='post_changState'">
						<xsl:apply-templates select="/content/Language/Message/lang[@name=$param_kind]"/>
						<xsl:text> </xsl:text>
						<xsl:apply-templates select="/content/Language/lang[@name=$param_state]"/>
					</xsl:when>
					<xsl:when test="$param_kind='edit'">
						<xsl:value-of select="@name"/>
						<xsl:text> </xsl:text>
						<xsl:apply-templates select="/content/Language/Message/lang[@name=$param_kind]"/>
						<xsl:text> </xsl:text>
						<xsl:apply-templates select="/content/Language/lang[@name=$param_bc]"/>
					</xsl:when>
					<xsl:otherwise>
						<xsl:apply-templates select="/content/Language/lang[@name=$param_name]"/>
						<xsl:text> </xsl:text>
						<xsl:apply-templates select="/content/Language/Message/lang[@name=$param_kind]"/>
						<xsl:text> </xsl:text>
						<xsl:apply-templates select="/content/Language/lang[@name=$param_bc]"/>
						<xsl:if test="$param_state != ''">
							<xsl:text> </xsl:text>
							<xsl:apply-templates select="/content/Language/lang[@name='as']"/>
							<xsl:text> </xsl:text>
							<xsl:apply-templates select="/content/Language/lang[@name=$param_state]"/>
						</xsl:if>
					</xsl:otherwise>
				</xsl:choose>
			</p>
		</xsl:template>
		<xsl:template match="/content/Language/ISO">
			<li class="lang">
				<a class="lang {@code}" href="{concat($var_link_host,'/',$var_link_index,$var_link_parameter,$var_link_special,$var_link_meta)}&#38;lang={@code}" title="{@code}"><text> </text></a>
			</li>
		</xsl:template>
		<xsl:template match="/content/Language/js/lang">
			<xsl:text>'</xsl:text><xsl:value-of select="@name"/><xsl:text>':'</xsl:text><xsl:apply-templates/><xsl:text>',</xsl:text>
		</xsl:template>
		<xsl:template match="/content/Language/js/lang[last()]">
			<xsl:text>'</xsl:text><xsl:value-of select="@name"/><xsl:text>':'</xsl:text><xsl:apply-templates/><xsl:text>'</xsl:text>
		</xsl:template>
		<xsl:template match="Error/Comment">
			<xsl:param name="param_lang" select="."/>
			<span class="large bold"><xsl:value-of select="concat(../Title,': ',.)"/><br/></span>
			<xsl:apply-templates select="/content/Language/Error/lang[@name=$param_lang]"/>
		</xsl:template>
		<xsl:template match="HTML_BR">
			<br/>
		</xsl:template>
		<xsl:template match="HTML_RED">
			<span class="red"><xsl:apply-templates/></span>
		</xsl:template>
		<xsl:template match="HTML_BOLD">
			<span class="bold"><xsl:apply-templates/></span>
		</xsl:template>
</xsl:stylesheet>