Bug 28792

Summary: update-webkit-localizable-strings script can no longer complete
Product: WebKit Reporter: John Sullivan <sullivan>
Component: AccessibilityAssignee: chris fleizach <cfleizach>
Status: RESOLVED FIXED    
Severity: Critical CC: adele, bdakin, darin
Priority: P1 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Attachments:
Description Flags
patch
sullivan: review-
patch sullivan: review+

Description John Sullivan 2009-08-27 17:19:44 PDT
The update-webkit-localizable-strings script, used to update the Localizable.strings file on Macintosh, can no longer complete. It fails due to this line in WebViewFactory.mm:

    return UI_STRING([ariaType UTF8String], "A description for a specified ARIA grouping role.");    

The script expects to find a quoted string literal here, not a function/method result. Since the script can't finish, Localizable.strings can't be updated for WebKit, which is a showstopper.

This line was introduced in http://trac.webkit.org/changeset/47626 on August 21, 2009.
Comment 1 John Sullivan 2009-08-27 17:22:13 PDT
<rdar://problem/7177446>
Comment 2 chris fleizach 2009-08-28 00:05:17 PDT
Created attachment 38719 [details]
patch

the patch makes sure that only static strings are used in UI_STRING
Comment 3 John Sullivan 2009-08-28 06:17:37 PDT
Comment on attachment 38719 [details]
patch

I don't understand why these strings should be localized, since they look like technical terms rather than natural language. Can you explain?
Comment 4 chris fleizach 2009-08-28 07:05:11 PDT
those strings are used for NSAccessibilityRoleDescription.

From NSAccessibility document.

NSAccessibilityRoleDescriptionAttribute

    Localized, user-readable description of role, such as radio button (NSString)
Comment 5 Darin Adler 2009-08-28 07:53:53 PDT
Comment on attachment 38719 [details]
patch

It seems very strange to me to use these computer style strings like ARIAApplicationLog as the group text, and yet ask localizers to translate them.

I'm going to say r=me, because the change seems fine mechanically, but I think you should discuss this with other architects of the VoiceOver application and localization of terms used by it. I am surprised that it's a good idea to include the word "ARIA" in the terms that are spoken aloud.
Comment 6 chris fleizach 2009-08-28 08:32:15 PDT
VoiceOver doesn't actually speak ARIAApplicationLog, it speaks the localized word "log" in this case. ARIAApplicationLog is just the key to find the right word.
Comment 7 John Sullivan 2009-08-28 08:39:56 PDT
How does the word "log" get into Localizable.strings? The construct UI_STRING("ARIAApplicationLog", "comment") puts "ARIAApplicationLog" into Localizable.strings.
Comment 8 chris fleizach 2009-08-28 08:42:07 PDT
maybe i don't understand something here

in the previous check in (r47626) I added these

trunk/WebKit/English.lproj/Localizable.strings 

 	445	/* Short descriptions of WAI-ARIA content roles */ 
 	446	"ARIAApplicationLog" = "log"; 
 	447	"ARIAApplicationMarquee" = "marquee"; 
 	448	"ARIAApplicationStatus" = "status"; 
 	449	"ARIAApplicationTimer" = "timer"; 
 	450	"ARIADocument" = "document"; 
 	451	"ARIADocumentArticle" = "article"; 
 	452	"ARIADocumentNote" = "note"; 
 	453	"ARIADocumentRegion" = "region"; 
 	454	"ARIALandmarkApplication" = "application"; 
 	455	"ARIALandmarkBanner" = "banner"; 
 	456	"ARIALandmarkComplementary" = "complementary"; 
 	457	"ARIALandmarkContentInfo" = "content"; 
 	458	"ARIALandmarkMain" = "main"; 
 	459	"ARIALandmarkNavigation" = "navigation"; 
 	460	"ARIALandmarkSearch" = "search"; 
 	461	"ARIAUserInterfaceTooltip" = "tooltip";
Comment 9 John Sullivan 2009-08-28 09:22:30 PDT
Yeah, I think there is a misunderstanding here. In WebKit, Localizable.strings is re-generated automatically by running the script update-webkit-localizable-strings. This script looks through the source code and finds instances of the UI_STRING macro, and then creates entries for them in the Localizable.strings file. Hand-editing the file won't work, because the hand-edited entries will get clobbered the next time the script is run. So the UI_STRING macro must have the English localized string as the first parameter, and the localizer comment as the 2nd parameter.

So your patch should look more like this:

+    if ([ariaType isEqualToString:@"ARIAApplicationLog"])
+        return UI_STRING("log", "A description for a specified ARIA grouping role.");    
+    if ([ariaType isEqualToString:@"ARIAApplicationMarquee"])
+        return UI_STRING("marquee", "A description for a specified ARIA grouping role.");    

etc.

You should also re-run update-webkit-localizable-strings with this change in place, and make the updated version of Localizable.strings be part of your patch.
Comment 10 John Sullivan 2009-08-28 09:23:16 PDT
Comment on attachment 38719 [details]
patch

Changing back to r- given the subsequent discussion.
Comment 11 chris fleizach 2009-08-28 09:23:51 PDT
Thanks for that clarification. I was unaware of the process.
Comment 12 chris fleizach 2009-08-28 11:06:42 PDT
Created attachment 38744 [details]
patch
Comment 13 John Sullivan 2009-08-28 11:28:41 PDT
Comment on attachment 38744 [details]
patch

Looks great!
Comment 14 chris fleizach 2009-08-28 11:35:03 PDT
http://trac.webkit.org/changeset/47870