English 中文(简体)
更长的体质:获得分类的分类描述
原标题:More Drupal coodness: getting the transalated description of a taxonomy term
  • 时间:2010-06-18 17:06:49
  •  标签:
  • php
  • drupal

采用特定词汇中的术语,简单地说,这些术语用的是缺省语和额外字。 当时的情况是,无论是哪一种语言是用的,还是用的是固定语言版本,因此我猜测,我在这里找不到什么东西,因为我猜测(显然是错误的)说,这个领域将使用积极的语言版本。 这里使用:

<?php $terms = taxonomy_get_tree(5);    
        for ($index = 0; $index < count($terms); $index++) {?>

                ...

                <div class="info"><?php echo trim_description($terms[$index]->description, 10) ?></div>

                <div class="more-info"><a href="<?php print url(taxonomy_term_path($terms[$index])); ?>">More details</a></div>
            </div>
        <?php }?>

添加:我的缺省语不是english语,我因违约而填满,而成为第二种选择。

最佳回答

如果您正在使用。 http://api.lullabot.com/i18ntaxonomy_translate_terms”rel=“nofollow noretinger”i18ntaxonomy_translate_terms( 请各位翻译。

<?php
global $language
$terms = i18ntaxonomy_translate_terms(taxonomy_get_tree(5), $language->language));
for ($index = 0; $index < count($terms); $index++): ?>
  <div>
    ...
    <div class="info"><?php echo trim_description($terms[$index]->description, 10) ?></div>
    <div class="more-info"><a href="<?php print url(taxonomy_term_path($terms[$index])); ?>">More details</a></div>
  </div>
<?php endfor;?>
问题回答

电话:t():

<div class="info"><?php echo trim_description(t($terms[$index]->description), 10) ?></div>




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签