Noticed that using variables in t() doesn't actually make them get translated since t() can't see the text in the variable.

CommentFileSizeAuthor
#6 1014082-direct-t.patch591 bytesdawehner
#1 views-t-1014082-1.patch3.39 KBbrenk28

Comments

brenk28’s picture

StatusFileSize
new3.39 KB

I've made some adjustments that may or may not be correct, can you please take a look?

dawehner’s picture

Version: 7.x-3.x-dev » 6.x-3.x-dev

.

bojanz’s picture

Didn't this get changed when the translation mega-patch got in? Are these left-overs?

merlinofchaos’s picture


--- modules/node/views_handler_filter_node_type.inc	2010-12-29 23:05:13.000000000 -0500
+++ modules/node/views_handler_filter_node_type.inc.fixed	2011-01-03 22:19:36.000000000 -0500
@@ -9,7 +9,7 @@ class views_handler_filter_node_type ext
       $this->value_title = t('Node type');
       $types = node_type_get_types();
       foreach ($types as $type => $info) {
-        $options[$type] = t($info->name);
+        $options[$type] = $info->name;
       }
       $this->value_options = $options;
     }

Copied straight from core. There's even an issue from when it went in, so that's definitely correct as-is.

Not sure about the others. Those do all seem like they should be translated with the view, not on output.

dawehner’s picture

Status: Active » Needs work

You seem to have a old version of views 3.x. There are already fixt some of this example, because the patch doesn't apply

dawehner’s picture

Status: Needs work » Needs review
StatusFileSize
new591 bytes

Here is a patch for the only place which makes sense: exposed_form

       elseif (!empty($definition['translatable']) && !empty($definition['default'])) {
-        $storage[$option] = t($definition['default']);
+        $storage[$option] = $definition['default'];
       }

I'm not 100% sure about this part

But the others a fixed/by design, for example the node type label.

dawehner’s picture

Status: Needs review » Active

Commited this patch to 6.x-3.x and 7.x-3.x the rest is still in discussion, but i guess it's either fixed or works as designed.

Patrick_Willam’s picture

Status: Active » Fixed
Issue tags: +dvcs11

No further feedback in 6 months, therefore the problem seems to be solved by the commited patches.

Please re-try with current dev-version of Views and re-activate if necessary.

Status: Fixed » Closed (fixed)
Issue tags: -dvcs11

Automatically closed -- issue fixed for 2 weeks with no activity.