Commit dfda2f4f authored by adele@apple.com's avatar adele@apple.com
Browse files

WebCore:

2008-10-28  Adele Peterson  <adele@apple.com>

        Reviewed by John Sullivan.

        Fix for https://bugs.webkit.org/show_bug.cgi?id=21880
        "files" string for multifile uploads needs to be localized

        * page/mac/WebCoreViewFactory.h:
        * platform/LocalizedStrings.h:
        * platform/gtk/FileChooserGtk.cpp: (WebCore::FileChooser::basenameForWidth):
        * platform/gtk/LocalizedStringsGtk.cpp: (WebCore::multipleFileUploadText):
        * platform/mac/FileChooserMac.mm: (WebCore::FileChooser::basenameForWidth):
        * platform/mac/LocalizedStringsMac.mm: (WebCore::multipleFileUploadText):
        * platform/qt/Localizations.cpp: (WebCore::multipleFileUploadText):
        * platform/wx/LocalizedStringsWx.cpp: (WebCore::multipleFileUploadText):

WebKit:

2008-10-28  Adele Peterson  <adele@apple.com>

        Reviewed by John Sullivan.

        Fix for https://bugs.webkit.org/show_bug.cgi?id=21880
        "files" string for multifile uploads needs to be localized

        * English.lproj/Localizable.strings: Updated with new string.

WebKit/mac:

2008-10-28  Adele Peterson  <adele@apple.com>

        Reviewed by John Sullivan.

        Fix for https://bugs.webkit.org/show_bug.cgi?id=21880
        "files" string for multifile uploads needs to be localized

        * WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory multipleFileUploadTextForNumberOfFiles:]):
        Added.

WebKit/win:

2008-10-28  Adele Peterson  <adele@apple.com>

        Reviewed by John Sullivan.

        Fix for https://bugs.webkit.org/show_bug.cgi?id=21880
        "files" string for multifile uploads needs to be localized

        * WebCoreLocalizedStrings.cpp: (multipleFileUploadText):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@37949 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 6eee5b0f
2008-10-28 Adele Peterson <adele@apple.com>
Reviewed by John Sullivan.
Fix for https://bugs.webkit.org/show_bug.cgi?id=21880
"files" string for multifile uploads needs to be localized
* page/mac/WebCoreViewFactory.h:
* platform/LocalizedStrings.h:
* platform/gtk/FileChooserGtk.cpp: (WebCore::FileChooser::basenameForWidth):
* platform/gtk/LocalizedStringsGtk.cpp: (WebCore::multipleFileUploadText):
* platform/mac/FileChooserMac.mm: (WebCore::FileChooser::basenameForWidth):
* platform/mac/LocalizedStringsMac.mm: (WebCore::multipleFileUploadText):
* platform/qt/Localizations.cpp: (WebCore::multipleFileUploadText):
* platform/wx/LocalizedStringsWx.cpp: (WebCore::multipleFileUploadText):
2008-10-28 Brett Wilson <brettw@chromium.org>
 
Reviewed by Darin Adler.
......
......@@ -122,6 +122,7 @@
- (NSString *)AXUncheckedCheckBoxActionVerb;
- (NSString *)AXLinkActionVerb;
- (NSString *)multipleFileUploadTextForNumberOfFiles:(unsigned)numberOfFiles;
// FTP Directory Related
- (NSString *)unknownFileSizeText;
......
......@@ -109,6 +109,7 @@ namespace WebCore {
String AXUncheckedCheckBoxActionVerb();
String AXLinkActionVerb();
String multipleFileUploadText(unsigned numberOfFiles);
String unknownFileSizeText();
#if PLATFORM(WIN)
......
......@@ -63,7 +63,7 @@ String FileChooser::basenameForWidth(const Font& font, int width) const
g_free(systemFilename);
stringByAdoptingFileSystemRepresentation(systemBasename, string);
} else if (m_filenames.size() > 1)
return StringTruncator::rightTruncate(String::number(m_filenames.size()) + " files", width, font, false);
return StringTruncator::rightTruncate(multipleFileUploadText(m_filenames.size()), width, font, false);
return StringTruncator::centerTruncate(string, width, font, false);
}
......
......@@ -326,6 +326,12 @@ String AXLinkActionVerb()
return String::fromUTF8(_("jump"));
}
String multipleFileUploadText(unsigned numberOfFiles)
{
// FIXME: If this file gets localized, this should really be localized as one string with a wildcard for the number.
return String::number(numberOfFiles) + String::fromUTF8(_(" files"));
}
String unknownFileSizeText()
{
return String::fromUTF8(_("Unknown"));
......
......@@ -47,7 +47,7 @@ String FileChooser::basenameForWidth(const Font& font, int width) const
else if (m_filenames.size() == 1)
strToTruncate = [[NSFileManager defaultManager] displayNameAtPath:(m_filenames[0])];
else
return StringTruncator::rightTruncate(String::number(m_filenames.size()) + " files", width, font, false);
return StringTruncator::rightTruncate(multipleFileUploadText(m_filenames.size()), width, font, false);
return StringTruncator::centerTruncate(strToTruncate, width, font, false);
}
......
......@@ -561,6 +561,14 @@ String AXLinkActionVerb()
return String();
}
String multipleFileUploadText(unsigned numberOfFiles)
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
return [[WebCoreViewFactory sharedFactory] multipleFileUploadTextForNumberOfFiles:numberOfFiles];
END_BLOCK_OBJC_EXCEPTIONS;
return String();
}
String unknownFileSizeText()
{
BEGIN_BLOCK_OBJC_EXCEPTIONS;
......
......@@ -333,6 +333,11 @@ String AXLinkActionVerb()
return String();
}
String multipleFileUploadText(unsigned)
{
return String();
}
String unknownFileSizeText()
{
return QCoreApplication::translate("QWebPage", "Unknown", "Unknown filesize FTP directory listing item");
......
......@@ -261,6 +261,12 @@ String contextMenuItemTagInspectElement()
return String("Inspect Element");
}
String multipleFileUploadText(unsigned numberOfFiles)
{
// FIXME: If this file gets localized, this should really be localized as one string with a wildcard for the number.
return String::number(numberOfFiles) + String(" files");
}
String unknownFileSizeText()
{
return String("Unknown");
......
2008-10-28 Adele Peterson <adele@apple.com>
Reviewed by John Sullivan.
Fix for https://bugs.webkit.org/show_bug.cgi?id=21880
"files" string for multifile uploads needs to be localized
* English.lproj/Localizable.strings: Updated with new string.
2008-10-28 Adele Peterson <adele@apple.com>
Reviewed by Sam Weinig.
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
2008-10-28 Adele Peterson <adele@apple.com>
Reviewed by John Sullivan.
Fix for https://bugs.webkit.org/show_bug.cgi?id=21880
"files" string for multifile uploads needs to be localized
* WebCoreSupport/WebViewFactory.mm: (-[WebViewFactory multipleFileUploadTextForNumberOfFiles:]):
Added.
2008-10-28 Timothy Hatcher <timothy@apple.com>
Add WebInspector methods to enable the profiler.
......
......@@ -487,6 +487,11 @@
return UI_STRING("jump", "Verb stating the action that will occur when a link is clicked, as used by accessibility");
}
- (NSString *)multipleFileUploadTextForNumberOfFiles:(unsigned)numberOfFiles
{
return [NSString stringWithFormat:UI_STRING("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files"), numberOfFiles];
}
- (NSString *)unknownFileSizeText
{
return UI_STRING("Unknown", "Unknown filesize FTP directory listing item");
......
2008-10-28 Adele Peterson <adele@apple.com>
Reviewed by John Sullivan.
Fix for https://bugs.webkit.org/show_bug.cgi?id=21880
"files" string for multifile uploads needs to be localized
* WebCoreLocalizedStrings.cpp: (multipleFileUploadText):
2008-10-28 Adele Peterson <adele@apple.com>
 
Reviewed by Sam Weinig.
......
......@@ -103,3 +103,11 @@ String WebCore::imageTitle(const String& filename, const IntSize& size)
return result.get();
}
String multipleFileUploadText(unsigned numberOfFiles)
{
static RetainPtr<CFStringRef> format(AdoptCF, UI_STRING("%d files", "Label to describe the number of files selected in a file upload control that allows multiple files"));
RetainPtr<CFStringRef> result(AdoptCF, CFStringCreateWithFormat(0, 0, format.get(), numberOfFiles));
return result.get();
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment