Closed Bug 320231 Opened 18 years ago Closed 6 years ago

add localization notes for length-limited PKCS#11 strings in


(Core :: Security: PSM, defect, P5)

Windows XP



Tracking Status
firefox59 --- fixed


(Reporter: prometeo.bugs, Assigned: flod)



(Whiteboard: [kerh-coa][psm-backlog])


(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; it-IT; rv:1.8) Gecko/20051206 SeaMonkey/1.0b
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; it-IT; rv:1.8) Gecko/20051206 SeaMonkey/1.0b

When using a localized version of SM, the password prompt for the security device is being cut at the end. The CertPassPrompt string is ok (that is, is shown fully), but the substitution for the included %S seems to fail for some reason (that is, the last char is being cut).
As an example, if I try to export a personal certificate, the dialog shows the problem (under it-IT): the PrivateTokenDescription entity (in Italian: "Dispositivo di sicurezza") which is used in the dialog shows up as "Dispositivo di sicurezz".

Reproducible: Always

Under guidance from dveditz over IRC, I've tried adding "xxx" at the end of PvtTknDesc, but the outcome doesn't change.
If I change the string to "Dispositivo xxx", it shows up fully in the dialog.
I have tried also adding a space before the fullstop in CertPassPrompt, but it didn't help with the failing substitution (but showed up correctly in the dialog after the cutten string).
Also, dveditz can't see any string limit (nor it is reported as a LOCALIZATION NOTE in the file) anywhere in the code, which was my first wild guess at first.
I also checked the translated file with a hex editor to see if any extraneous char was added, and saw none.
I've still one or two tests I'd like to do, and report back the outcome.
More findings, on the left the string for PrivateTokenDescription, on the right the outcome in the dialog:
"Dispositivo di abcdefghijklmnopqrstuvwxyz" -> "Dispositivo di abcdefghijklmnopq"
"Dispositivo abcdefghijklmnopqrstuvwxyz"    -> "Dispositivo abcdefghijklmnopqrst"
"Dispositivo sicurezza"                     -> "Dispositivo sicurezza"

This makes me think there is actually a real limit on the substitution string of around 32 chars. If you agree, then the limit should be removed, or, if it is a security concern, a LOCALIZATION NOTE should be added to the relevant entries (probably more than only PrivateTokenDescription...) in and maybe even

Before someone asks (and I foget), CertPassPrompt has got %S (capital) also in the translated version.
Need to correct my comment 0: it's not "Dispositivo di sicurezza", but it's "Dispositivo di sicurezza software", and it gets truncated as "Dispositivo di sicurezza softwar" (missing last "e").
More evidence of a 32 chars limit for the string...
Yeah, I bet you're right
Depends on: 317630
Ever confirmed: true
Keywords: intl, l12y
Whiteboard: [kerh-coa]
Priority: -- → P3
Target Milestone: --- → Future
See bug 90956 comment 21 why some of the strings are truncated at 32 bytes and others at 64 bytes. That's defined in PKCS #11, which is an industry standard API.

That bug also added the following comment to
# the following strings have special requirements:
# they must fit in a 32 or 64 byte buffer after being translated
# to UTF8.  Note to translator. It's not easy for you to figure
# whether the escaped unicode string you produce will fit in 
# the space allocated.
Can we mark this bug as WONTFIX/INVALID?
Actually, it looks like we should revisit our localizations and check which are broken, and get bugs on individual locales filed.

I don't have time to do this this week, and my head is going to drop it by then, probably, thus adding a helpwanted keyword.
Keywords: intl, l12yhelpwanted
Please use the standard notation for localization warnings:
LOCALIZAION NOTE (<entityname>): <explanation>
This will help a lot with automated tools, thanks!
In the Italian branch 1.8 (for Firefox and Thunderbird 2) the string is:

Disp. di sicurezza software

so it complies with the 32 characters limit.
QA Contact: ui
Blocks: 629034
reassign bug owner.
Assignee: kaie → nobody
See comment 8.
Component: Security: UI → Security: PSM
Priority: P3 → P5
Summary: Password prompt truncates security device translation → add localization notes for length-limited PKCS#11 strings in
Whiteboard: [kerh-coa] → [kerh-coa][psm-backlog]
Assignee: nobody → francesco.lodolo
Comment on attachment 8934231 [details]
Bug 320231 - Update localization notes for length-limited PKCS#11 strings in

This is basically OK, but I'd like to have some more machine-readable comments, and I think we can do that without making this much harder to read. For one, can we put the whole sentence in one line, so that we don't line-break it at different places? And put the number and unit at the end? Something like

    # LOCALIZATION NOTE (RootCertModuleName):
    # string limit after conversion to UTF-8: 64 bytes
Attachment #8934231 - Flags: review?(l10n) → review-
Updated per IRC discussion with something that clearly looks like a directive, and should be easier to parse.
Comment on attachment 8934231 [details]
Bug 320231 - Update localization notes for length-limited PKCS#11 strings in
Attachment #8934231 - Flags: review?(l10n) → review+
Pushed by
Update localization notes for length-limited PKCS#11 strings in r=Pike
Closed: 6 years ago
Resolution: --- → FIXED
Keywords: helpwanted
Target Milestone: Future → mozilla59
You need to log in before you can comment on or make changes to this bug.