תצוגת שפות שונות בתיבת תגיות
יש לי תיבה המציגה את התגיות של סוג התוכן.
אני משתמש ברכיב taxonomy_block.module, למרות שזה לא ממש משנה כי הבעיה מופיעה גם בתצוגה הרגילה של היבט.
בגלל שכמות התגיות מוצגת בסוגריים, למשל:
עיצוב (2)
תכנות (3)
אני מקבל באנגלית תצוגה מרוטלת:
dev(2)
כיצד ניתן לסדר את זה?

צריך שתהיה קריאה לפונקציה t()
צריך שתהיה קריאה לפונקציה t() כזאת :
<?php$label = t('@term_name (@count)',array('@term_name'=>$name,'@count'=>$count))
?>
yakoub abaya
תודה יעקב, היכן אני ממקם את
תודה יעקב,
היכן אני ממקם את הקריאה הזו?
אמיר תייר | TIKKE בונים אתר דרכך
אם זה views אז אולי tpl של
אם זה views אז אולי tpl של field מסוים
yakoub abaya
אני משתמש במודול Taxonomy
אני משתמש במודול taxonomy_block.module
איפה היית ממליץ במצב זה לשתול את זה?
אמיר תייר | TIKKE בונים אתר דרכך
המודול לא כתוב בצורה מתוחכמת
המודול לא כתוב בצורה מתוחכמת , לכן האפשרות היחידה זה שימוש ב פאטש :
diff -up taxonomy_block/taxonomy_block.module taxonomy_block2/taxonomy_block.module
--- taxonomy_block/taxonomy_block.module 2010-10-04 05:41:45.000000000 +0200
+++ taxonomy_block2/taxonomy_block.module 2011-04-08 20:38:39.000000000 +0300
@@ -96,10 +96,10 @@ function taxonomy_block_block($op = 'lis
$term_parent = taxonomy_get_term($tid_parent);
if (module_exists("i18n")) {
- $output .= l(tt("taxonomy:term:$tid_parent:name", $name_parent), taxonomy_term_path($term_parent));
+ $link = l(tt("taxonomy:term:$tid_parent:name", $name_parent), taxonomy_term_path($term_parent));
} else {
//$output .= l(t($name_parent), "taxonomy/term/$tid_parent");
- $output .= l(t($name_parent), taxonomy_term_path($term_parent));
+ $link = l(t($name_parent), taxonomy_term_path($term_parent));
}
if ($node_count) {
$sql_count_parents = " SELECT COUNT(tn.nid) FROM {term_node} tn "
@@ -107,9 +107,12 @@ function taxonomy_block_block($op = 'lis
." WHERE tid = %d AND n.status = 1";
$total_parent = db_result(db_query($sql_count_parents, $tid_parent));
- $output .= " ($total_parent)";
+ $count = " ($total_parent)";
+ $output .= t('@term_link (@count)', array('@term_link' => $link, '@count' => $count));
+ }
+ else {
+ $output .= $link;
}
-
$sql_count_childs = " SELECT count(td.tid) from {term_data} td "
." INNER JOIN {term_hierarchy} th ON th.tid=td.tid "
@@ -139,16 +142,20 @@ function taxonomy_block_block($op = 'lis
$term_child = taxonomy_get_term($tid_child);
if (module_exists("i18n")) {
- $output .= l(tt("taxonomy:term:$tid_child:name", $name_child), taxonomy_term_path($term_child));
+ $link = l(tt("taxonomy:term:$tid_child:name", $name_child), taxonomy_term_path($term_child));
} else {
- $output .= l(t($name_child), taxonomy_term_path($term_child));
+ $link = l(t($name_child), taxonomy_term_path($term_child));
}
if ($node_count) {
$sql_total_child = " SELECT COUNT(tn.nid) FROM {term_node} tn"
." INNER JOIN {node} n ON n.nid=tn.nid"
." WHERE n.status=1 AND tid = %d";
$total_child = db_result(db_query($sql_total_child, $tid_child));
- $output .= " ($total_child)";
+ $count = " ($total_child)";
+ $output .= t('@term_link (@count)', array('@term_link' => $link, '@count' => $count));
+ }
+ else {
+ $output .= $link;
}
$output .= "</li>";
}
yakoub abaya
to apply the patch copy text
to apply the patch
copy text into taxonomy_block_t.patch
cd into taxonomy_block and
patch -p1 < taxonomy_block_t.patchyakoub abaya
המון תודה יעקב אבל לא ממש
המון תודה יעקב אבל לא ממש הבנתי איך אני מטמיע את הפאץ'.
אם אפשר הסבר פשוט.
אמיר תייר | TIKKE בונים אתר דרכך
עכשיו נתקלתי בזה במודול שאני
עכשיו נתקלתי בזה במודול שאני כותב , וכל מה שצריך לסדר היה direction:rtl
yakoub abaya
זה מוגדר כך אלא שהבעיה היא עם
זה מוגדר כך אלא שהבעיה היא עם התגיות שהן באנגלית.
אמיר תייר | TIKKE בונים אתר דרכך