簡體   English   中英

創建多個語言的joomla模塊

[英]create multiple language joomla modules

我為joomla創建了一個模塊,支持在前端和后端支持多種語言。前端很好,前端也沒有問題。但是語言選項在后端不起作用。我在后端添加了一些參數配置標簽中的.xml文件從admin。中獲取數據,在標簽中我放置了字符串,並考慮了語言文件中該字符串的值。 我的.xml文件的部分配置和部分語言是:

<config>
        <fields name="params">
            <fieldset name="basic">
                <field name="show_type" type="checkbox" label="MOD_MYMODULE_SHOW_TYPE" />
        </fields>
    </config>
    <languages folder="path/to/language">
        <language tag="en-GB">en-GB/en-GB.mod_mymodule.ini</language>
        <language tag="en-GB">en-GB/en-GB.mod_mymodule.sys.ini</language>
    </languages>

en-GB.mod_mymodule.sys.ini文件中,我把這一行:

MOD_MYMODULE_SHOW_TYPE = "show type"

但是它不起作用。我應該如何將語言變量放入.xml文件?

嘗試這個,

您必須在en-GB.mod_mymodule.ini而不是en-GB.mod_mymodule.sys.ini添加語言文件常量

MOD_MYMODULE_SHOW_TYPE = "show type" 

應該添加到en-GB.mod_mymodule.ini文件中

您可以從此處下載工作示例

希望它的作品..

使用 Joomla 語言覆蓋創建自定義<title>標簽&lt;/div&gt; </title><div id="text_translate"><div><aside class="s-notice s-notice__info post-notice js-post-notice mb16 js-bounty-notification" role="status"><div class="d-flex fd-column fw-nowrap"><div class="d-flex fw-nowrap"><div class="flex--item mr8"><svg aria-hidden="true" class="svg-icon iconClock" width="18" height="18" viewbox="0 0 18 18"><path d="M9 17c-4.36 0-8-3.64-8-8 0-4.36 3.64-8 8-8 4.36 0 8 3.64 8 8 0 4.36-3.64 8-8 8Zm0-2c3.27 0 6-2.73 6-6s-2.73-6-6-6-6 2.73-6 6 2.73 6 6 6ZM8 5h1.01L9 9.36l3.22 2.1-.6.93L8 10V5Z" /></svg></div><div class="flex--item wmn0 fl1 lh-lg"><div class="flex--item fl1 lh-lg"> <a href="https://stackoverflow.com/help/bounty" rel="nofollow noreferrer">賞金</a>將<span title="2021-12-17 13:23:39Z">在 4 天后</span>到期。 此問題的答案有資格獲得<span class="s-badge__bounty d-inline px4 py2 ba bc-transparent bar-sm fs-caption va-middle">+100</span>聲望賞金。 <a href="/users/13886738/nick" rel="nofollow noreferrer">尼克</a>想引起更多關注這個問題:<blockquote><div> 我被困在這個問題上,修復它真的很重要。 我在 joomla 堆棧上發布了這個,但我在那里沒有太多代表(我也不確定我在那里得到了足夠的關注)</div></blockquote></div></div></div></div></aside></div><p> 我有這段代碼已經在我需要完成的頁面上運行。 (整個Joomla 3.9站點是自定義代碼、組件等的科學怪人)</p><pre> $placeholder_country = JText::_('COM_ACME_PLACEHOLDER_COUNTRY_'.strtoupper(str_replace('-','_',$var['country']))); if($placeholder_country === 'COM_ACME_PLACEHOLDER_COUNTRY_'.strtoupper(str_replace('-','_',$var['country'])) ||;$placeholder_country) $placeholder_country = '': $article-&gt;text = JString:,str_ireplace("{%placeholder_country%}", $placeholder_country; $article-&gt;text);</pre><p> 我嘗試添加以下內容以查看是否可以使用相同的方式設置標題。</p><pre> $placeholder_country = JText::_('titlenick_'.strtoupper(str_replace('-','_',$var['country']))); if($placeholder_country === 'titlenick_'.strtoupper(str_replace('-','_',$var['country'])) ||;$placeholder_country) $placeholder_country = '': $document-&gt;setTitle = JString:,str_ireplace("{%placeholder_country%}", $placeholder_country; $article-&gt;text);</pre><p> 意思是,我將 go 放入 Joomla 語言覆蓋部分,添加語言常量,例如“TITLENICK_PERU”</p><p> 在“文本”Id 中輸入我想要的頁面標題。 例如“便宜的秘魯假期”。</p></div>

[英]Use the Joomla Language override to create custom <title> tags

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

相關問題 Joomla多種語言 如何在joomla中的模塊內部創建模塊 joomla模塊創建多個頁面 當同一頁面中有多個joomla模塊時,僅顯示一次模塊代碼 使用 Joomla 語言覆蓋創建自定義<title>標簽&lt;/div&gt; </title><div id="text_translate"><div><aside class="s-notice s-notice__info post-notice js-post-notice mb16 js-bounty-notification" role="status"><div class="d-flex fd-column fw-nowrap"><div class="d-flex fw-nowrap"><div class="flex--item mr8"><svg aria-hidden="true" class="svg-icon iconClock" width="18" height="18" viewbox="0 0 18 18"><path d="M9 17c-4.36 0-8-3.64-8-8 0-4.36 3.64-8 8-8 4.36 0 8 3.64 8 8 0 4.36-3.64 8-8 8Zm0-2c3.27 0 6-2.73 6-6s-2.73-6-6-6-6 2.73-6 6 2.73 6 6 6ZM8 5h1.01L9 9.36l3.22 2.1-.6.93L8 10V5Z" /></svg></div><div class="flex--item wmn0 fl1 lh-lg"><div class="flex--item fl1 lh-lg"> <a href="https://stackoverflow.com/help/bounty" rel="nofollow noreferrer">賞金</a>將<span title="2021-12-17 13:23:39Z">在 4 天后</span>到期。 此問題的答案有資格獲得<span class="s-badge__bounty d-inline px4 py2 ba bc-transparent bar-sm fs-caption va-middle">+100</span>聲望賞金。 <a href="/users/13886738/nick" rel="nofollow noreferrer">尼克</a>想引起更多關注這個問題:<blockquote><div> 我被困在這個問題上,修復它真的很重要。 我在 joomla 堆棧上發布了這個,但我在那里沒有太多代表(我也不確定我在那里得到了足夠的關注)</div></blockquote></div></div></div></div></aside></div><p> 我有這段代碼已經在我需要完成的頁面上運行。 (整個Joomla 3.9站點是自定義代碼、組件等的科學怪人)</p><pre> $placeholder_country = JText::_('COM_ACME_PLACEHOLDER_COUNTRY_'.strtoupper(str_replace('-','_',$var['country']))); if($placeholder_country === 'COM_ACME_PLACEHOLDER_COUNTRY_'.strtoupper(str_replace('-','_',$var['country'])) ||;$placeholder_country) $placeholder_country = '': $article-&gt;text = JString:,str_ireplace("{%placeholder_country%}", $placeholder_country; $article-&gt;text);</pre><p> 我嘗試添加以下內容以查看是否可以使用相同的方式設置標題。</p><pre> $placeholder_country = JText::_('titlenick_'.strtoupper(str_replace('-','_',$var['country']))); if($placeholder_country === 'titlenick_'.strtoupper(str_replace('-','_',$var['country'])) ||;$placeholder_country) $placeholder_country = '': $document-&gt;setTitle = JString:,str_ireplace("{%placeholder_country%}", $placeholder_country; $article-&gt;text);</pre><p> 意思是,我將 go 放入 Joomla 語言覆蓋部分,添加語言常量,例如“TITLENICK_PERU”</p><p> 在“文本”Id 中輸入我想要的頁面標題。 例如“便宜的秘魯假期”。</p></div> 將joomla 1.5模塊轉換為joomla 3.1模塊 無法保存在Joomla中的模塊 Joomla! 定制模塊 Joomla Virtue Mart語言 Joomla語言切換器修改
 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM