RESOLVED FIXED 99963
Introduce Localizer::standAloneMonthLabels
https://bugs.webkit.org/show_bug.cgi?id=99963
Summary Introduce Localizer::standAloneMonthLabels
Kent Tamura
Reported 2012-10-22 00:24:25 PDT
We realized full stand-alone month names were necessary for input[type=month] UI in addition to short stand-alone month names.
Attachments
Patch (22.91 KB, patch)
2012-10-22 00:52 PDT, Kent Tamura
haraken: review+
Kent Tamura
Comment 1 2012-10-22 00:52:05 PDT
Kentaro Hara
Comment 2 2012-10-22 05:53:19 PDT
Comment on attachment 169841 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=169841&action=review > Source/WebCore/platform/text/LocaleICU.cpp:334 > + if (m_monthLabels) This should be: if (!m_monthLabels.isEmpty()) > Source/WebCore/platform/text/LocaleICU.cpp:343 > + if (!initializeShortDateFormat()) { > + m_monthLabels = createFallbackMonthLabels(); > + return *m_monthLabels; > + } > + m_monthLabels = createLabelVector(m_shortDateFormat, UDAT_MONTHS, UCAL_JANUARY, 12); > + if (m_monthLabels) > + return *m_monthLabels; > + m_monthLabels = createFallbackMonthLabels(); Just like LocaleICU::standAloneMonthLabels(), I would prefer: if (initializeShortDateFormat()) { if (OwnPtr<Vector<String> > labels = createLabelVector(m_shortDateFormat, UDAT_MONTHS, UCAL_JANUARY, 12)) { m_monthLabels = labels; return *m_monthLabels; } } m_monthLabels = createFallbackMonthLabels();
Kent Tamura
Comment 3 2012-10-22 18:22:58 PDT
Kent Tamura
Comment 4 2012-10-22 18:24:47 PDT
Comment on attachment 169841 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=169841&action=review >> Source/WebCore/platform/text/LocaleICU.cpp:343 >> + m_monthLabels = createFallbackMonthLabels(); > > Just like LocaleICU::standAloneMonthLabels(), I would prefer: > > if (initializeShortDateFormat()) { > if (OwnPtr<Vector<String> > labels = createLabelVector(m_shortDateFormat, UDAT_MONTHS, UCAL_JANUARY, 12)) { > m_monthLabels = labels; > return *m_monthLabels; > } > } > m_monthLabels = createFallbackMonthLabels(); ok. Because m_monthLabels is OwnPtr and I'd like to minimize the change, I have changed this function as follows: { if (m_monthLabels) return *m_monthLabels; if (initializeShortDateFormat()) { m_monthLabels = createLabelVector(m_shortDateFormat, UDAT_MONTHS, UCAL_JANUARY, 12); if (m_monthLabels) return *m_monthLabels; } m_monthLabels = createFallbackMonthLabels(); return *m_monthLabels; }
Note You need to log in before you can comment on or make changes to this bug.