Can't translate <Any>

bwynants - December 17, 2008 - 11:18
Project:Views
Version:6.x-2.x-dev
Component:User interface
Category:bug report
Priority:critical
Assigned:Unassigned
Status:won't fix
Description

I have a string (in use by views) but I can not translate it. locale says unsupported html.

#1

oriol_e9g - December 18, 2008 - 21:38

Probably it's a problem with a module that are not using the t() function with the "Any" string.

You have to localize the string in the code... or give us more clues :D

What modules are you using? Where/When appear the string?

#2

bwynants - December 19, 2008 - 10:54

nope, that's not the problem. In de code the string uses t(). I can translate it but I can not use the '<' and '>' symbols in the translation.

(it is a string from an exposed filter of views)

#3

oriol_e9g - December 20, 2008 - 20:18

Could you try yo use this?

&lt; instead of <
&gt; instead of >

&lt;Any&gt; instead of <Any>

I think that could be a problem with HTML filter.

#4

bwynants - December 24, 2008 - 13:36

then it shows up as &lt ;Any&gt ; in the UI....

#5

pwolanin - December 23, 2008 - 17:19

This sounds like a bug with Views - why is it wrapping something in a pseudo-tag?

#6

cezio - January 4, 2009 - 19:02

Moving away '<'/'>' from translated strings will help. I've made a patch for Views 6.x-2.2 to fix t() function calls with those pseudotags.

AttachmentSize
views_6.x_2.2.t_without_pseudotags.patch 2.85 KB

#7

oriol_e9g - January 4, 2009 - 21:08
Project:Drupal» Views
Version:6.x-dev» 6.x-2.x-dev
Component:locale.module» Code
Status:active» needs review

For me it's fine.

#8

merlinofchaos - January 27, 2009 - 21:02
Status:needs review» needs work

It's in a place where we're not placing HTML. Apparently locale can't tell the difference. :/

This patch completely fails my style check -- It conforms neither to the Drupal 6 nor Drupal 7 usage of the . operator. (I conform to the Drupal 7 use of the . operator and always have).

#9

thePanz - April 8, 2009 - 14:48

@merlinofchaos : I try to provide a patch, but something strange happened: some files I try to edit:

1. views_handler_filter.inc
2. admin.inc

Have a MAC lines encoding instead of UNIX, so my patch will interpret the whole file as changed.
The files that includes these "pseudotags" are:

1. views_handler_filter.inc
2. admin.inc
3. views_plugin_style.inc

all committed by you (the third file have a Windows line-endings) If out have a fix for this encoding issue I can provide a patch for these replacements:

t('<Any>') to '<'. t('Any') .'>'
t('<None>') to '<'. t('None') .'>'
t('<All>') to '<'. t('All') .'>'

Maybe you can find-replace these occurrences..

Regards

#10

thePanz - April 15, 2009 - 09:08
Component:Code» User interface
Priority:normal» critical

These pseudo-tags couldn't be translated neither using Drupal builtin translation tool or importing a .po file: pseudo-tags get removed and not inserted into translation table. Moving to Critical and to "User Interface".

Any help?

#11

dereine - April 19, 2009 - 19:46
Status:needs work» needs review

mh here i could create the patch without problems.

sure the wronge filendings has to be solved, but this should be in another issue.

AttachmentSize
views-348130.patch 4.29 KB

#12

thePanz - May 19, 2009 - 13:08
Status:needs review» needs work

Your patch fails on "includes/admin.inc" and in "hadlers/views_handler_filter.inc" (maybe for the MAC line-endings commented before)

Regards

#13

merlinofchaos - June 1, 2009 - 22:02
Status:needs work» won't fix

I see no reason to bother. You can switch from <Any> to - Any - which *is* translatable in the settings. This doesn't affect existing installs.

 
 

Drupal is a registered trademark of Dries Buytaert.