Item1725: Oops: we could not recognize you truncated in French language

Priority: Urgent
Current State: Closed
Released In: 1.0.6
Target Release: patch
Applies To: Engine
Reported By: RaulFRodriguez
Waiting For:
Last Change By: KennethLavrsen

When a user tries to login to Foswiki and provides wrong credentials, an error page is displayed with the following string in English language:

"Oops: we could not recognize you. Try again or [[%1][reset your password]]."

In French language the corresponding string from ../core/locale/fr.po is:

"Argh: nous n'avons pu vous authentifier. Réessayez, ou [[%1][réinitialiser votre mot de passe]]."

The French string, though, does not get displayed completely and the string stops after the '. Like that:

Argh: nous n'

this string is applicable to ../core/templates/login.tmpl:8

In this template, the translated string appears on the following line, embedded in a macro:

%TMPL:DEF{"UNRECOGNISED_USER"}%%MAKETEXT{"Oops: we could not recognize you. Try again or [[[_1]][reset your password]]." 


There are many other strings in the French language translation having ' and they seem to be displayed properly.

For instance when attaching a file:

#: ../PatternSkin/templates/attach.pattern.tmpl:55
#: ../core/templates/attach.tmpl:39
msgid "Images will be displayed, for other attachments a link will be created."
msgstr "S'il s'agit d'une image, elle sera affichée ; sinon, un lien vers le fichier attaché sera créé."

In attach.tmpl the translated string's context is like that:

<td align="right">
<input type="checkbox" class="foswikiCheckbox" id="createlink" name="createlink" %ATTACHLINKBOX% />
<label for="createlink">%MAKETEXT{"Create a link to the attached file"}%</label> 
<span class="foswikiGrayText">%MAKETEXT{"Images will be displayed, for other attachments a link will be created."}%</span>

The sentence gets displayed completely and does not stop after the ' (note : I inserted line breaks in the quote above so that the full text gets displayed above)


That is quite annoying, of course, since the user does not get to know the cause for the rejection of his login attempt and he sees an incomplete sentence.

I have no idea on how to fix that.

I am including ArthurClemens in the "WaitingFor" for this task, since the following "last change" is currently appearing in the svn "ArthurClemens: Item2882: change template oopsmore to more " next to the translation files and, since this Item2882 seems to be related to how some messages, including error messages, get displayed, but I don't know if you are the right person which can help with that.

Please feel free to attribute that to someone else.

-- RaulFRodriguez

I have seen this before with especially French.

Depending on the use of the MAKETEXT you may need to escape the ' as \'

If the MAKETEXT is inside a 'something' the French words with ' screw up the strings. Try and replace the ' by \' in the fr.po and try again. And if this fixes it, we need to fix that for 1.0.6

We also need to check for ' in the other languages.

Can you check this quickly Raul?

-- KennethLavrsen - 15 Jun 2009

Fixed it. I bet there are more of those but it takes a long time to find them

-- KennethLavrsen - 16 Jun 2009

Thanks for your fast feedback Kenneth.

I have a question though... Shouldn't the MAKETEXT (or whatever is using that MAKETEXT.. that's unclear to me) escape itself the ' ?

If indeed the only option is to include escaping manually (which is quite unnatural for a translator), I will try to devise a way to exhaustively find the ' across all the .po files and escape them all. Also, I think that the translators should be aware of this also, and that they should include these escaping characters in the translation. How do you suggest we inform them of this? Of course, if that could be addressed programmatically, it would be much better for languages such as French where this character is used very often (and that would be less error prone).

-- RaulFRodriguez - 17 Jun 2009

Kenneth, I guess I did not understand properly what you were saying.

Whether or not escaping the ' is needed cannot be decided unless the code is inspected very carefully or you can actually see a problem in a displayed string (see my attempts Item1750 and Item1751, which I had to revert).

You wrote:

If the MAKETEXT is inside a 'something' the French words with ' screw up the strings.

I do not see single quotes around the MAKETEXT in the portion that was causing problem. The thing I see is that the MAKETEXT string causing a problem with ' is preceded by %% instead of %. Would that be a valid way to identify the possible strings where a ' should not appear unescaped?

I ran a search through all the plugins and core, and there are 235 lines containing %%MAKETEXT.

-- RaulFRodriguez - 18 Jun 2009

ItemTemplate edit

Summary Oops: we could not recognize you truncated in French language
ReportedBy RaulFRodriguez
Codebase 1.0.5
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Engine
Priority Urgent
CurrentState Closed
Checkins distro:9f43136857c3 distro:430961614c54
TargetRelease patch
ReleasedIn 1.0.6
Topic revision: r8 - 22 Jun 2009, KennethLavrsen
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy