为什么 ICU 对 "stand alone" 日期值有区别?
Why does ICU have distinctions for "stand alone" values for dates?
ICU 对“独立”值有不同的格式符号。例如:
q Stand Alone quarter
L Stand Alone month in year
c Stand Alone local day of week
"Stand Alone" values refer to those designed to stand on their own, as opposed to being with other formatted values. "2nd quarter" would use the stand alone format (QQQQ), whereas "2nd quarter 2007" would use the regular format (qqqq yyyy).
但是,这并不能解释为什么有区别。我认为这对某些语言很重要,但有哪些例子?
(更令人困惑的是,文档自相矛盾,因为它同时使用 q
和 Q
作为独立版本。)
我还假设其他字段(例如年、小时、分钟、秒)不需要独立版本,因为它们是数字。但是,如果是这样,为什么工作日、月份和季度的独立值支持数字形式?
我最终提交了 ICU-21225 to correct the contradiction in the documentation and to ask for clarification. One of the comments directed me to https://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras,其中指出:
The context is either format (the default), the form used within a complete date format string (such as "Saturday, November 12"), or stand-alone, the form for date elements used independently, such as in calendar headers. The most important distinction between format and stand-alone forms is a grammatical distinction, for languages that require it. For example, many languages require that a month name without an associated day number (i.e. an independent form) be in the basic nominative form, while a month name with an associated day number (as in a complete date format) should be in a different grammatical form: genitive, partitive, etc.
不过,我仍然对具体示例(哪些语言?)感到好奇。
ICU 对“独立”值有不同的格式符号。例如:
q Stand Alone quarter
L Stand Alone month in year
c Stand Alone local day of week
"Stand Alone" values refer to those designed to stand on their own, as opposed to being with other formatted values. "2nd quarter" would use the stand alone format (QQQQ), whereas "2nd quarter 2007" would use the regular format (qqqq yyyy).
但是,这并不能解释为什么有区别。我认为这对某些语言很重要,但有哪些例子?
(更令人困惑的是,文档自相矛盾,因为它同时使用 q
和 Q
作为独立版本。)
我还假设其他字段(例如年、小时、分钟、秒)不需要独立版本,因为它们是数字。但是,如果是这样,为什么工作日、月份和季度的独立值支持数字形式?
我最终提交了 ICU-21225 to correct the contradiction in the documentation and to ask for clarification. One of the comments directed me to https://www.unicode.org/reports/tr35/tr35-dates.html#months_days_quarters_eras,其中指出:
The context is either format (the default), the form used within a complete date format string (such as "Saturday, November 12"), or stand-alone, the form for date elements used independently, such as in calendar headers. The most important distinction between format and stand-alone forms is a grammatical distinction, for languages that require it. For example, many languages require that a month name without an associated day number (i.e. an independent form) be in the basic nominative form, while a month name with an associated day number (as in a complete date format) should be in a different grammatical form: genitive, partitive, etc.
不过,我仍然对具体示例(哪些语言?)感到好奇。