protected MetaLocale removeLikelySubtags ( MetaLocale src ) { // Using "en-Latn-US" for examples. // 1. match "en-Zzzz-ZZ" MetaLocale temp = new MetaLocale ( ) ; temp . setLanguage ( src . _language ( ) ) ; MetaLocale match = addLikelySubtags ( temp ) ; if ( match . equals ( src ) ) { return temp ; } // 2. match "en-Zzzz-US" temp . setTerritory ( src . _territory ( ) ) ; match = addLikelySubtags ( temp ) ; if ( match . equals ( src ) ) { temp . setLanguage ( src . _language ( ) ) ; return temp ; } // 3. match "en-Latn-ZZ" temp . setTerritory ( null ) ; temp . setScript ( temp . _script ( ) ) ; match = addLikelySubtags ( temp ) ; if ( match . equals ( src ) ) { return temp ; } // 4. Nothing matched, return a copy of the original. return src . copy ( ) ; }
Removes all subtags that would be added by addLikelySubtags . This produces the min bundle ID .