Re: [ACTION 107] Locale Filter

Hi Felix,

Sorry I've been away this past week. I actually have an alternate
proposal to simplify things even further: Drop the filter type
entirely. I asked back in April if anybody had a use case for the
"negative"/"exclude" type:

http://lists.w3.org/Archives/Public/public-multilingualweb-lt/2012Apr/0148.html

I still haven't seen one, and I've had a hard time coming up with
one for the examples. If we don't need "exclude", and if "all" and
"none" can be accomplished otherwise, we could just drop the extra
attribute and instead have this:

<its:localeFilterRule selector="//legalnotice"
localeFilter="en-CA,fr-CA"/>

<legalnotice its:localeFilter="en-CA,fr-CA"/>

So does anybody actually need to enumerate locales where content
must be dropped?

--
Shaun

On Tue, 2012-07-31 at 22:40 +0200, Felix Sasaki wrote:
> Hi Shaun, all,
> 
> 
> since there wasn't any further feedback on this, I implemented my
> change proposal on ACTION-107, see
> http://www.w3.org/International/multilingualweb/lt/drafts/its20/its20.html#LocaleFilter
> this means: only two values for filterType ("include" or "exclude"),
> the language range list is mandatory, and it may contain the wildcard
> "*". Comments very welcome. If people disagree with the change I'll
> revert the edits.
> 
> 
> Best,
> 
> 
> Felix 
> 
> 
> 2012/7/25 Felix Sasaki <fsasaki@w3.org>
>         Hi Shaun, all,
>         
>         
>         a question, or rather proposal on this.
>         
>         
>         It seems it is possible to express the meaning of "all" and
>         "none" at
>         http://www.w3.org/International/multilingualweb/lt/drafts/its20/its20.html#LocaleFilter
>         via "include" and "exclude", with just the language range
>         list.
>         
>         
>         <its:localeFilterRule selector="//legalnotice"
>         localeFilterType="include" localeFilterList=""/>
>         
>         
>         = don't add the legalnotice to any local
>         
>         <its:localeFilterRule selector="//legalnotice"
>         localeFilterType="include" localeFilterList="*"/>
>         
>         = add the legalnotice to all locals
>         
>         
>         <its:localeFilterRule selector="//legalnotice"
>         localeFilterType="exclude" localeFilterList="*"/>
>         
>         
>         = don't add the legalnotice to any local
>         
>         <its:localeFilterRule selector="//legalnotice"
>         localeFilterType="exclude" localeFilterList=""/>
>         
>         
>         = don't add the legalnotice to all locals
>         
>         
>         
>         
>         The basic language range in BCP47
>         http://tools.ietf.org/html/bcp47#section-2.1
>         contains the  "*" anyway. So if we keep "all" and "none", the
>         interaction between the four values "all", "none", "inlcude"
>         and "exclude" with "*" or the empty list or ranges gets messy.
>         
>         
>         So the idea would be
>         - get rid of "all" and "none"
>         - make clear in a note that the list may be empty and that
>         languages ranges can be just "*", with the effects described
>         above.
>         
>         
>         I'm happy to draft that if you and others are OK with this.
>         
>         
>         Felix
>         
>         2012/7/16 Shaun McCance <shaunm@gnome.org>
>                 Here's a second take on locale filter. Felix
>                 recommended using
>                 a language range from RFC 4647. In fact, we want a
>                 priority
>                 list of language ranges. RFC 4647 does not define the
>                 syntax
>                 for these, but it defines semantics. [Section 2.3] It
>                 uses
>                 a comma-separated list as an example syntax. I used
>                 that.
>                 
>                 http://tools.ietf.org/html/rfc4647
>                 
>                 Also, I've decided to use basic language ranges rather
>                 than
>                 extended language ranges. [Sections 2.1, 2.2, 3.3.1,
>                 3.3.2]
>                 Basic ranges either match exactly or match initial
>                 substrings
>                 with a hyphen. You can use '*' to mean "anything", but
>                 you
>                 can't use it as a subtag, e.g. '*-CH'. If you want to
>                 filter
>                 for a region, you'll have to enumerate the languages,
>                 e.g.
>                 'de-CH, fr-CH, it-CH'.
>                 
>                 I chose basic filtering because I think the algorithm
>                 for
>                 extended filtering is tricky (but not impossible) to
>                 do in
>                 XSLT 1.0, at least without EXSLT. Basic filtering is
>                 easy.
>                 If anybody feels strongly that we should use extended
>                 filtering, speak up. I'm not really opposed.
>                 
>                 If there's no objections, I'll put together some
>                 examples
>                 and add this to the ODD file.
>                 
>                 
>                 = Locale Filter
>                 
>                 == Definition
>                 
>                 The Locale Filter data category specifies that a node
>                 is only
>                 applicable to certain locales, or that it is not
>                 applicable
>                 to certain locales.
>                 
>                 This data category can be used for several purposes,
>                 including,
>                 but not limited to:
>                 
>                  * Include a legal notice only in locales for certain
>                 regions.
>                  * Drop editorial notes from all localized output.
>                 
>                 
>                 The Locale Filter data category associates with each
>                 selected
>                 node a filter type and a language priority list
>                 conforming to
>                 RFC 4647. The language priority list is a
>                 comma-separated list
>                 of basic language ranges. Whitespace surrounding
>                 language ranges
>                 is ignored.
>                 
>                 The locale filter type can take the following values:
>                 
>                 
>                 
>                  * "all": The node is included in all locales.
>                  * "none": The node is included in no locales.
>                  * "include": The node is only included in locales
>                 that match
>                    at least one language range in the language
>                 priority list
>                    using basic filtering.
>                  * "exclude": The node is included in all locales
>                 except those
>                    that match at least one language range in the
>                 language priority
>                    list using basic filtering.
>                 
>                 
>                 If the locale filter type is "all" or "none", a
>                 language priority
>                 list SHOULD NOT be provided. If one is, it MUST be
>                 ignored. If the
>                 
>                 locale filter type is "include" or "exclude", a
>                 language priority
>                 list SHOULD be provided. If one is not, it MUST
>                 default to the
>                 empty list.
>                 
>                 == Implementation
>                 
>                 The Locale Filter data category can be expressed with
>                 global
>                 rules, or locally on an individual element. The
>                 information
>                 applies to the textual content of the element,
>                 including child
>                 elements and attributes. The default is that the
>                 locale filter
>                 type is "all".
>                 
>                 
>                 Implementations MUST NOT combine language priority
>                 lists from
>                 multiple rules or local attributes.
>                 
>                 GLOBAL: The localeFilterRule element contains the
>                 following:
>                 
>                  * A required selector attribute. It contains an XPath
>                 expression
>                    which selects the nodes to which this rule applies.
>                 
>                  * A required localeFilterType attribute with the
>                 value "all",
>                    "none", "include", or "exclude".
>                 
>                  * An optional localeFilterList attribute with a
>                 comma-separated
>                 
>                    language priority list.
>                 
>                 LOCAL: The following local markup is available for the
>                 Locale
>                 Filter data category:
>                 
>                  * A localeFilterType attribute with the value "all",
>                 "none",
>                    "include", or "exclude".
>                 
>                 
>                  * A localFilterList attribute with a comma-separated
>                 language
>                    priority list.
>                 
>                 
>                 
>                 
>         
>         
>         
>         
>         -- 
>         Felix Sasaki
>         DFKI / W3C Fellow
>         
>         
> 
> 
> 
> 
> -- 
> Felix Sasaki
> DFKI / W3C Fellow
> 
> 

Received on Wednesday, 1 August 2012 15:58:47 UTC